Bug Summary

File:root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h
Warning:line 322, column 11
Assigned value is uninitialized

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -O0 -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=/root/firefox-clang/obj-x86_64-pc-linux-gnu/dom/bindings/test -fcoverage-compilation-dir=/root/firefox-clang/obj-x86_64-pc-linux-gnu/dom/bindings/test -resource-dir /usr/lib/llvm-22/lib/clang/22 -include /root/firefox-clang/config/gcc_hidden.h -include /root/firefox-clang/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D _GLIBCXX_ASSERTIONS -D DEBUG=1 -D IMPL_LIBXUL -D MOZILLA_INTERNAL_API -I /root/firefox-clang/dom/bindings/test -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dom/bindings/test -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dom/bindings -I /root/firefox-clang/dom/bindings -I /root/firefox-clang/js/xpconnect/src -I /root/firefox-clang/js/xpconnect/wrappers -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/ipc/ipdl/_ipdlheaders -I /root/firefox-clang/ipc/chromium/src -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/x86_64-linux-gnu/c++/15 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../include/c++/15/backward -internal-isystem /usr/lib/llvm-22/lib/clang/22/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/15/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wno-error=pessimizing-move -Wno-error=large-by-value-copy=128 -Wno-error=implicit-int-float-conversion -Wno-error=thread-safety-analysis -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 -Wno-character-conversion -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 -fdwarf2-cfi-asm -o /tmp/scan-build-2026-01-17-100050-2808198-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) < std::size(binding_detail::EnumStrings<MyTestEnum>::Values))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(uint32_t(aArgument) < std::size(binding_detail::EnumStrings
<MyTestEnum>::Values))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(uint32_t(aArgument) < std
::size(binding_detail::EnumStrings<MyTestEnum>::Values)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"uint32_t(aArgument) < std::size(binding_detail::EnumStrings<MyTestEnum>::Values)"
, "../TestJSImplGenBinding.cpp", 68); AnnotateMozCrashReason(
"MOZ_ASSERT" "(" "uint32_t(aArgument) < std::size(binding_detail::EnumStrings<MyTestEnum>::Values)"
")"); do { MOZ_CrashSequence(__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 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
113 prototypes::id::TestCImplementedInterface,
114 true,
115 0,
116 "TestCImplementedInterface",
117};
118
119static const DOMIfaceAndProtoJSClass sPrototypeClass = {
120 {
121 "TestCImplementedInterfacePrototype",
122 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
123 JS_NULL_CLASS_OPS,
124 JS_NULL_CLASS_SPEC,
125 JS_NULL_CLASS_EXT,
126 JS_NULL_OBJECT_OPS
127 },
128 eInterfacePrototype,
129 prototypes::id::TestCImplementedInterface,
130 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
131 &sNativePropertyHooks,
132 TestJSImplInterface_Binding::GetProtoObject
133};
134
135void
136CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
137{
138 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface);
139 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface);
140
141 JS::Handle<JSObject*> parentProto(TestJSImplInterface_Binding::GetProtoObjectHandle(aCx));
142 if (!parentProto) {
143 return;
144 }
145
146 JS::Handle<JSObject*> constructorProto(TestJSImplInterface_Binding::GetConstructorObjectHandle(aCx));
147 if (!constructorProto) {
148 return;
149 }
150
151 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
152 &sPrototypeClass, protoCache,
153 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
154 interfaceCache,
155 nullptr,
156 nullptr,
157 "TestCImplementedInterface",
158 aDefineOnGlobal != DefineInterfaceProperty::No,
159 nullptr,
160 false,
161 nullptr);
162}
163
164JS::Handle<JSObject*>
165GetProtoObjectHandle(JSContext* aCx)
166{
167 /* Get the interface prototype object for this class. This will create the
168 object as needed. */
169 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestCImplementedInterface,
170 &CreateInterfaceObjects,
171 DefineInterfaceProperty::CheckExposure);
172
173}
174
175JSObject*
176GetProtoObject(JSContext* aCx)
177{
178 return GetProtoObjectHandle(aCx);
179}
180
181JS::Handle<JSObject*>
182GetConstructorObjectHandle(JSContext* aCx)
183{
184 /* Get the interface object for this class. This will create the object as
185 needed. */
186
187 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestCImplementedInterface,
188 &CreateInterfaceObjects,
189 DefineInterfaceProperty::CheckExposure);
190}
191
192} // namespace TestCImplementedInterface_Binding
193
194
195
196namespace TestCImplementedInterface2_Binding {
197
198bool sNativePropertiesInited = false;
199const NativePropertyHooks sNativePropertyHooks = {
200 nullptr,
201 { nullptr, nullptr, &sNativePropertiesInited },
202 prototypes::id::TestCImplementedInterface2,
203 constructors::id::TestCImplementedInterface2,
204 &DefaultXrayExpandoObjectClass
205};
206
207static const DOMInterfaceInfo sInterfaceObjectInfo = {
208 { ThrowingConstructor, &sNativePropertyHooks },
209 JS::GetRealmFunctionPrototypeHandle,
210 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
211 prototypes::id::TestCImplementedInterface2,
212 true,
213 0,
214 "TestCImplementedInterface2",
215};
216
217static const DOMIfaceAndProtoJSClass sPrototypeClass = {
218 {
219 "TestCImplementedInterface2Prototype",
220 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
221 JS_NULL_CLASS_OPS,
222 JS_NULL_CLASS_SPEC,
223 JS_NULL_CLASS_EXT,
224 JS_NULL_OBJECT_OPS
225 },
226 eInterfacePrototype,
227 prototypes::id::TestCImplementedInterface2,
228 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
229 &sNativePropertyHooks,
230 JS::GetRealmObjectPrototype
231};
232
233void
234CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
235{
236 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface2);
237 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface2);
238
239 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
240 if (!parentProto) {
241 return;
242 }
243
244 JS::Handle<JSObject*> constructorProto(JS::GetRealmFunctionPrototypeHandle(aCx));
245 if (!constructorProto) {
246 return;
247 }
248
249 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
250 &sPrototypeClass, protoCache,
251 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
252 interfaceCache,
253 nullptr,
254 nullptr,
255 "TestCImplementedInterface2",
256 aDefineOnGlobal != DefineInterfaceProperty::No,
257 nullptr,
258 false,
259 nullptr);
260}
261
262JS::Handle<JSObject*>
263GetProtoObjectHandle(JSContext* aCx)
264{
265 /* Get the interface prototype object for this class. This will create the
266 object as needed. */
267 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestCImplementedInterface2,
268 &CreateInterfaceObjects,
269 DefineInterfaceProperty::CheckExposure);
270
271}
272
273JSObject*
274GetProtoObject(JSContext* aCx)
275{
276 return GetProtoObjectHandle(aCx);
277}
278
279JS::Handle<JSObject*>
280GetConstructorObjectHandle(JSContext* aCx)
281{
282 /* Get the interface object for this class. This will create the object as
283 needed. */
284
285 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestCImplementedInterface2,
286 &CreateInterfaceObjects,
287 DefineInterfaceProperty::CheckExposure);
288}
289
290} // namespace TestCImplementedInterface2_Binding
291
292
293
294namespace TestJSImplInterface_Binding {
295
296MOZ_CAN_RUN_SCRIPT static bool
297get_readonlyByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
298{
299 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject302( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
300 "TestJSImplInterface", "readonlyByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject302( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
301 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject302( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
302 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject302( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
303
304 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
305 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
306 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
307 if (objIsXray) {
308 unwrappedObj.emplace(cx, obj);
309 }
310 if (objIsXray) {
311 // Since our object is an Xray, we can just CheckedUnwrapStatic:
312 // we know Xrays have no dynamic unwrap behavior.
313 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
314 if (!unwrappedObj.ref()) {
315 return false;
316 }
317 }
318 FastErrorResult rv;
319 int8_t result(MOZ_KnownLive(self)(self)->GetReadonlyByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
320 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"
)), 0))
) {
321 return false;
322 }
323 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 323); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
324 args.rval().setInt32(int32_t(result));
325 return true;
326}
327
328static const JSJitInfo readonlyByte_getterinfo = {
329 { get_readonlyByte },
330 { prototypes::id::TestJSImplInterface },
331 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
332 JSJitInfo::Getter,
333 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
334 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
335 false, /* isInfallible. False in setters. */
336 false, /* isMovable. Not relevant for setters. */
337 false, /* isEliminatable. Not relevant for setters. */
338 false, /* isAlwaysInSlot. Only relevant for getters. */
339 false, /* isLazilyCachedInSlot. Only relevant for getters. */
340 false, /* isTypedMethod. Only relevant for methods. */
341 0 /* Reserved slot index, if we're stored in a slot, else 0. */
342};
343
344MOZ_CAN_RUN_SCRIPT static bool
345get_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
346{
347 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject350( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
348 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject350( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
349 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject350( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
350 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject350( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
351
352 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
353 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
354 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
355 if (objIsXray) {
356 unwrappedObj.emplace(cx, obj);
357 }
358 if (objIsXray) {
359 // Since our object is an Xray, we can just CheckedUnwrapStatic:
360 // we know Xrays have no dynamic unwrap behavior.
361 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
362 if (!unwrappedObj.ref()) {
363 return false;
364 }
365 }
366 FastErrorResult rv;
367 int8_t result(MOZ_KnownLive(self)(self)->GetWritableByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
368 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"
)), 0))
) {
369 return false;
370 }
371 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 371); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 371); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
372 args.rval().setInt32(int32_t(result));
373 return true;
374}
375
376MOZ_CAN_RUN_SCRIPT static bool
377set_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
378{
379 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject382( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
380 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject382( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
381 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject382( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
382 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject382( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
383
384 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
385 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
386 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
387 if (objIsXray) {
388 unwrappedObj.emplace(cx, obj);
389 }
390 int8_t arg0;
391 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
392 return false;
393 }
394 if (objIsXray) {
395 // Since our object is an Xray, we can just CheckedUnwrapStatic:
396 // we know Xrays have no dynamic unwrap behavior.
397 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
398 if (!unwrappedObj.ref()) {
399 return false;
400 }
401 }
402 FastErrorResult rv;
403 // NOTE: This assert does NOT call the function.
404 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");
405 MOZ_KnownLive(self)(self)->SetWritableByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
406 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"
)), 0))
) {
407 return false;
408 }
409 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 409); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 409); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
410
411 return true;
412}
413
414static const JSJitInfo writableByte_getterinfo = {
415 { get_writableByte },
416 { prototypes::id::TestJSImplInterface },
417 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
418 JSJitInfo::Getter,
419 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
420 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
421 false, /* isInfallible. False in setters. */
422 false, /* isMovable. Not relevant for setters. */
423 false, /* isEliminatable. Not relevant for setters. */
424 false, /* isAlwaysInSlot. Only relevant for getters. */
425 false, /* isLazilyCachedInSlot. Only relevant for getters. */
426 false, /* isTypedMethod. Only relevant for methods. */
427 0 /* Reserved slot index, if we're stored in a slot, else 0. */
428};
429static const JSJitInfo writableByte_setterinfo = {
430 { (JSJitGetterOp)set_writableByte },
431 { prototypes::id::TestJSImplInterface },
432 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
433 JSJitInfo::Setter,
434 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
435 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
436 false, /* isInfallible. False in setters. */
437 false, /* isMovable. Not relevant for setters. */
438 false, /* isEliminatable. Not relevant for setters. */
439 false, /* isAlwaysInSlot. Only relevant for getters. */
440 false, /* isLazilyCachedInSlot. Only relevant for getters. */
441 false, /* isTypedMethod. Only relevant for methods. */
442 0 /* Reserved slot index, if we're stored in a slot, else 0. */
443};
444
445MOZ_CAN_RUN_SCRIPT static bool
446passByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
447{
448 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject451( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
449 "TestJSImplInterface", "passByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject451( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
450 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject451( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
451 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject451( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
452
453 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
454 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByte", 1)) {
455 return false;
456 }
457 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
458 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
459 if (objIsXray) {
460 unwrappedObj.emplace(cx, obj);
461 }
462 int8_t arg0;
463 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
464 return false;
465 }
466 if (objIsXray) {
467 // Since our object is an Xray, we can just CheckedUnwrapStatic:
468 // we know Xrays have no dynamic unwrap behavior.
469 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
470 if (!unwrappedObj.ref()) {
471 return false;
472 }
473 }
474 FastErrorResult rv;
475 // NOTE: This assert does NOT call the function.
476 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");
477 MOZ_KnownLive(self)(self)->PassByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
478 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"
)), 0))
) {
479 return false;
480 }
481 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 481); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
482 args.rval().setUndefined();
483 return true;
484}
485
486static const JSJitInfo passByte_methodinfo = {
487 { (JSJitGetterOp)passByte },
488 { prototypes::id::TestJSImplInterface },
489 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
490 JSJitInfo::Method,
491 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
492 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
493 false, /* isInfallible. False in setters. */
494 false, /* isMovable. Not relevant for setters. */
495 false, /* isEliminatable. Not relevant for setters. */
496 false, /* isAlwaysInSlot. Only relevant for getters. */
497 false, /* isLazilyCachedInSlot. Only relevant for getters. */
498 false, /* isTypedMethod. Only relevant for methods. */
499 0 /* Reserved slot index, if we're stored in a slot, else 0. */
500};
501
502MOZ_CAN_RUN_SCRIPT static bool
503receiveByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
504{
505 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject508( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
506 "TestJSImplInterface", "receiveByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject508( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
507 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject508( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
508 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject508( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
509
510 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
511 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
512 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
513 if (objIsXray) {
514 unwrappedObj.emplace(cx, obj);
515 }
516 if (objIsXray) {
517 // Since our object is an Xray, we can just CheckedUnwrapStatic:
518 // we know Xrays have no dynamic unwrap behavior.
519 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
520 if (!unwrappedObj.ref()) {
521 return false;
522 }
523 }
524 FastErrorResult rv;
525 int8_t result(MOZ_KnownLive(self)(self)->ReceiveByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
526 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"
)), 0))
) {
527 return false;
528 }
529 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 529); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 529); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
530 args.rval().setInt32(int32_t(result));
531 return true;
532}
533
534static const JSJitInfo receiveByte_methodinfo = {
535 { (JSJitGetterOp)receiveByte },
536 { prototypes::id::TestJSImplInterface },
537 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
538 JSJitInfo::Method,
539 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
540 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
541 false, /* isInfallible. False in setters. */
542 false, /* isMovable. Not relevant for setters. */
543 false, /* isEliminatable. Not relevant for setters. */
544 false, /* isAlwaysInSlot. Only relevant for getters. */
545 false, /* isLazilyCachedInSlot. Only relevant for getters. */
546 false, /* isTypedMethod. Only relevant for methods. */
547 0 /* Reserved slot index, if we're stored in a slot, else 0. */
548};
549
550MOZ_CAN_RUN_SCRIPT static bool
551passOptionalByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
552{
553 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject556( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
554 "TestJSImplInterface", "passOptionalByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject556( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
555 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject556( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
556 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject556( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
557
558 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
559 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
560 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
561 if (objIsXray) {
562 unwrappedObj.emplace(cx, obj);
563 }
564 Optional<int8_t> arg0;
565 if (args.hasDefined(0)) {
566 arg0.Construct();
567 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
568 return false;
569 }
570 }
571 if (objIsXray) {
572 // Since our object is an Xray, we can just CheckedUnwrapStatic:
573 // we know Xrays have no dynamic unwrap behavior.
574 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
575 if (!unwrappedObj.ref()) {
576 return false;
577 }
578 }
579 FastErrorResult rv;
580 // NOTE: This assert does NOT call the function.
581 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");
582 MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
583 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"
)), 0))
) {
584 return false;
585 }
586 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 586); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 586); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
587 args.rval().setUndefined();
588 return true;
589}
590
591static const JSJitInfo passOptionalByte_methodinfo = {
592 { (JSJitGetterOp)passOptionalByte },
593 { prototypes::id::TestJSImplInterface },
594 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
595 JSJitInfo::Method,
596 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
597 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
598 false, /* isInfallible. False in setters. */
599 false, /* isMovable. Not relevant for setters. */
600 false, /* isEliminatable. Not relevant for setters. */
601 false, /* isAlwaysInSlot. Only relevant for getters. */
602 false, /* isLazilyCachedInSlot. Only relevant for getters. */
603 false, /* isTypedMethod. Only relevant for methods. */
604 0 /* Reserved slot index, if we're stored in a slot, else 0. */
605};
606
607MOZ_CAN_RUN_SCRIPT static bool
608passOptionalByteBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
609{
610 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject613( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
611 "TestJSImplInterface", "passOptionalByteBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject613( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
612 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject613( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
613 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject613( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
614
615 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
616 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteBeforeRequired", 2)) {
617 return false;
618 }
619 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
620 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
621 if (objIsXray) {
622 unwrappedObj.emplace(cx, obj);
623 }
624 Optional<int8_t> arg0;
625 if (args.hasDefined(0)) {
626 arg0.Construct();
627 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
628 return false;
629 }
630 }
631 int8_t arg1;
632 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
633 return false;
634 }
635 if (objIsXray) {
636 // Since our object is an Xray, we can just CheckedUnwrapStatic:
637 // we know Xrays have no dynamic unwrap behavior.
638 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
639 if (!unwrappedObj.ref()) {
640 return false;
641 }
642 }
643 FastErrorResult rv;
644 // NOTE: This assert does NOT call the function.
645 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");
646 MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
647 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"
)), 0))
) {
648 return false;
649 }
650 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 650); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 650); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
651 args.rval().setUndefined();
652 return true;
653}
654
655static const JSJitInfo passOptionalByteBeforeRequired_methodinfo = {
656 { (JSJitGetterOp)passOptionalByteBeforeRequired },
657 { prototypes::id::TestJSImplInterface },
658 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
659 JSJitInfo::Method,
660 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
661 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
662 false, /* isInfallible. False in setters. */
663 false, /* isMovable. Not relevant for setters. */
664 false, /* isEliminatable. Not relevant for setters. */
665 false, /* isAlwaysInSlot. Only relevant for getters. */
666 false, /* isLazilyCachedInSlot. Only relevant for getters. */
667 false, /* isTypedMethod. Only relevant for methods. */
668 0 /* Reserved slot index, if we're stored in a slot, else 0. */
669};
670
671MOZ_CAN_RUN_SCRIPT static bool
672passOptionalByteWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
673{
674 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject677( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
675 "TestJSImplInterface", "passOptionalByteWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject677( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
676 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject677( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
677 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject677( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
678
679 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
680 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
681 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
682 if (objIsXray) {
683 unwrappedObj.emplace(cx, obj);
684 }
685 int8_t arg0;
686 if (args.hasDefined(0)) {
687 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
688 return false;
689 }
690 } else {
691 arg0 = 0;
692 }
693 if (objIsXray) {
694 // Since our object is an Xray, we can just CheckedUnwrapStatic:
695 // we know Xrays have no dynamic unwrap behavior.
696 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
697 if (!unwrappedObj.ref()) {
698 return false;
699 }
700 }
701 FastErrorResult rv;
702 // NOTE: This assert does NOT call the function.
703 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");
704 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
705 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"
)), 0))
) {
706 return false;
707 }
708 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 708); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 708); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
709 args.rval().setUndefined();
710 return true;
711}
712
713static const JSJitInfo passOptionalByteWithDefault_methodinfo = {
714 { (JSJitGetterOp)passOptionalByteWithDefault },
715 { prototypes::id::TestJSImplInterface },
716 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
717 JSJitInfo::Method,
718 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
719 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
720 false, /* isInfallible. False in setters. */
721 false, /* isMovable. Not relevant for setters. */
722 false, /* isEliminatable. Not relevant for setters. */
723 false, /* isAlwaysInSlot. Only relevant for getters. */
724 false, /* isLazilyCachedInSlot. Only relevant for getters. */
725 false, /* isTypedMethod. Only relevant for methods. */
726 0 /* Reserved slot index, if we're stored in a slot, else 0. */
727};
728
729MOZ_CAN_RUN_SCRIPT static bool
730passOptionalByteWithDefaultBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
731{
732 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject735( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
733 "TestJSImplInterface", "passOptionalByteWithDefaultBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject735( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
734 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject735( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
735 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject735( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
736
737 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
738 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", 2)) {
739 return false;
740 }
741 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
742 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
743 if (objIsXray) {
744 unwrappedObj.emplace(cx, obj);
745 }
746 int8_t arg0;
747 if (args.hasDefined(0)) {
748 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
749 return false;
750 }
751 } else {
752 arg0 = 0;
753 }
754 int8_t arg1;
755 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
756 return false;
757 }
758 if (objIsXray) {
759 // Since our object is an Xray, we can just CheckedUnwrapStatic:
760 // we know Xrays have no dynamic unwrap behavior.
761 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
762 if (!unwrappedObj.ref()) {
763 return false;
764 }
765 }
766 FastErrorResult rv;
767 // NOTE: This assert does NOT call the function.
768 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");
769 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
770 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"
)), 0))
) {
771 return false;
772 }
773 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 773); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 773); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
774 args.rval().setUndefined();
775 return true;
776}
777
778static const JSJitInfo passOptionalByteWithDefaultBeforeRequired_methodinfo = {
779 { (JSJitGetterOp)passOptionalByteWithDefaultBeforeRequired },
780 { prototypes::id::TestJSImplInterface },
781 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
782 JSJitInfo::Method,
783 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
784 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
785 false, /* isInfallible. False in setters. */
786 false, /* isMovable. Not relevant for setters. */
787 false, /* isEliminatable. Not relevant for setters. */
788 false, /* isAlwaysInSlot. Only relevant for getters. */
789 false, /* isLazilyCachedInSlot. Only relevant for getters. */
790 false, /* isTypedMethod. Only relevant for methods. */
791 0 /* Reserved slot index, if we're stored in a slot, else 0. */
792};
793
794MOZ_CAN_RUN_SCRIPT static bool
795passNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
796{
797 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject800( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
798 "TestJSImplInterface", "passNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject800( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
799 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject800( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
800 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject800( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
801
802 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
803 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByte", 1)) {
804 return false;
805 }
806 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
807 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
808 if (objIsXray) {
809 unwrappedObj.emplace(cx, obj);
810 }
811 Nullable<int8_t> arg0;
812 if (args[0].isNullOrUndefined()) {
813 arg0.SetNull();
814 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
815 return false;
816 }
817 if (objIsXray) {
818 // Since our object is an Xray, we can just CheckedUnwrapStatic:
819 // we know Xrays have no dynamic unwrap behavior.
820 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
821 if (!unwrappedObj.ref()) {
822 return false;
823 }
824 }
825 FastErrorResult rv;
826 // NOTE: This assert does NOT call the function.
827 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");
828 MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
829 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"
)), 0))
) {
830 return false;
831 }
832 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 832); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 832); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
833 args.rval().setUndefined();
834 return true;
835}
836
837static const JSJitInfo passNullableByte_methodinfo = {
838 { (JSJitGetterOp)passNullableByte },
839 { prototypes::id::TestJSImplInterface },
840 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
841 JSJitInfo::Method,
842 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
843 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
844 false, /* isInfallible. False in setters. */
845 false, /* isMovable. Not relevant for setters. */
846 false, /* isEliminatable. Not relevant for setters. */
847 false, /* isAlwaysInSlot. Only relevant for getters. */
848 false, /* isLazilyCachedInSlot. Only relevant for getters. */
849 false, /* isTypedMethod. Only relevant for methods. */
850 0 /* Reserved slot index, if we're stored in a slot, else 0. */
851};
852
853MOZ_CAN_RUN_SCRIPT static bool
854passOptionalNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
855{
856 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject859( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
857 "TestJSImplInterface", "passOptionalNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject859( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
858 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject859( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
859 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject859( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
860
861 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
862 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
863 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
864 if (objIsXray) {
865 unwrappedObj.emplace(cx, obj);
866 }
867 Optional<Nullable<int8_t>> arg0;
868 if (args.hasDefined(0)) {
869 arg0.Construct();
870 if (args[0].isNullOrUndefined()) {
871 arg0.Value().SetNull();
872 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value().SetValue())) {
873 return false;
874 }
875 }
876 if (objIsXray) {
877 // Since our object is an Xray, we can just CheckedUnwrapStatic:
878 // we know Xrays have no dynamic unwrap behavior.
879 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
880 if (!unwrappedObj.ref()) {
881 return false;
882 }
883 }
884 FastErrorResult rv;
885 // NOTE: This assert does NOT call the function.
886 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");
887 MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
888 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"
)), 0))
) {
889 return false;
890 }
891 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 891); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 891); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
892 args.rval().setUndefined();
893 return true;
894}
895
896static const JSJitInfo passOptionalNullableByte_methodinfo = {
897 { (JSJitGetterOp)passOptionalNullableByte },
898 { prototypes::id::TestJSImplInterface },
899 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
900 JSJitInfo::Method,
901 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
902 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
903 false, /* isInfallible. False in setters. */
904 false, /* isMovable. Not relevant for setters. */
905 false, /* isEliminatable. Not relevant for setters. */
906 false, /* isAlwaysInSlot. Only relevant for getters. */
907 false, /* isLazilyCachedInSlot. Only relevant for getters. */
908 false, /* isTypedMethod. Only relevant for methods. */
909 0 /* Reserved slot index, if we're stored in a slot, else 0. */
910};
911
912MOZ_CAN_RUN_SCRIPT static bool
913passVariadicByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
914{
915 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject918( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
916 "TestJSImplInterface", "passVariadicByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject918( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
917 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject918( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
918 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject918( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
919
920 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
921 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
922 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
923 if (objIsXray) {
924 unwrappedObj.emplace(cx, obj);
925 }
926 AutoSequence<int8_t> arg0;
927 if (args.length() > 0) {
928 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
929 JS_ReportOutOfMemory(cx);
930 return false;
931 }
932 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
933 // OK to do infallible append here, since we ensured capacity already.
934 int8_t& slot = *arg0.AppendElement();
935 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[variadicArg], "Argument 1", &slot)) {
936 return false;
937 }
938 }
939 }
940 if (objIsXray) {
941 // Since our object is an Xray, we can just CheckedUnwrapStatic:
942 // we know Xrays have no dynamic unwrap behavior.
943 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
944 if (!unwrappedObj.ref()) {
945 return false;
946 }
947 }
948 FastErrorResult rv;
949 // NOTE: This assert does NOT call the function.
950 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");
951 MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
952 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"
)), 0))
) {
953 return false;
954 }
955 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 955); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 955); __attribute__((nomerge)) ::abort(); } while (false
); } } while (false)
;
956 args.rval().setUndefined();
957 return true;
958}
959
960static const JSJitInfo passVariadicByte_methodinfo = {
961 { (JSJitGetterOp)passVariadicByte },
962 { prototypes::id::TestJSImplInterface },
963 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
964 JSJitInfo::Method,
965 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
966 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
967 false, /* isInfallible. False in setters. */
968 false, /* isMovable. Not relevant for setters. */
969 false, /* isEliminatable. Not relevant for setters. */
970 false, /* isAlwaysInSlot. Only relevant for getters. */
971 false, /* isLazilyCachedInSlot. Only relevant for getters. */
972 false, /* isTypedMethod. Only relevant for methods. */
973 0 /* Reserved slot index, if we're stored in a slot, else 0. */
974};
975
976MOZ_CAN_RUN_SCRIPT static bool
977get_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
978{
979 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject982( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
980 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject982( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
981 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject982( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
982 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject982( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
983
984 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
985 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
986 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
987 if (objIsXray) {
988 unwrappedObj.emplace(cx, obj);
989 }
990 if (objIsXray) {
991 // Since our object is an Xray, we can just CheckedUnwrapStatic:
992 // we know Xrays have no dynamic unwrap behavior.
993 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
994 if (!unwrappedObj.ref()) {
995 return false;
996 }
997 }
998 FastErrorResult rv;
999 int8_t result(MOZ_KnownLive(self)(self)->GetSideEffectFreeByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1000 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"
)), 0))
) {
1001 return false;
1002 }
1003 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1003); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1003); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1004 args.rval().setInt32(int32_t(result));
1005 return true;
1006}
1007
1008MOZ_CAN_RUN_SCRIPT static bool
1009set_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1010{
1011 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1014( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1012 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1014( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1013 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1014( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1014 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1014( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1015
1016 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1017 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1018 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1019 if (objIsXray) {
1020 unwrappedObj.emplace(cx, obj);
1021 }
1022 int8_t arg0;
1023 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1024 return false;
1025 }
1026 if (objIsXray) {
1027 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1028 // we know Xrays have no dynamic unwrap behavior.
1029 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1030 if (!unwrappedObj.ref()) {
1031 return false;
1032 }
1033 }
1034 FastErrorResult rv;
1035 // NOTE: This assert does NOT call the function.
1036 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");
1037 MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1038 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"
)), 0))
) {
1039 return false;
1040 }
1041 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1041); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1041); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1042
1043 return true;
1044}
1045
1046static const JSJitInfo sideEffectFreeByte_getterinfo = {
1047 { get_sideEffectFreeByte },
1048 { prototypes::id::TestJSImplInterface },
1049 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1050 JSJitInfo::Getter,
1051 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1052 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1053 false, /* isInfallible. False in setters. */
1054 false, /* isMovable. Not relevant for setters. */
1055 false, /* isEliminatable. Not relevant for setters. */
1056 false, /* isAlwaysInSlot. Only relevant for getters. */
1057 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1058 false, /* isTypedMethod. Only relevant for methods. */
1059 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1060};
1061static const JSJitInfo sideEffectFreeByte_setterinfo = {
1062 { (JSJitGetterOp)set_sideEffectFreeByte },
1063 { prototypes::id::TestJSImplInterface },
1064 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1065 JSJitInfo::Setter,
1066 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1067 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1068 false, /* isInfallible. False in setters. */
1069 false, /* isMovable. Not relevant for setters. */
1070 false, /* isEliminatable. Not relevant for setters. */
1071 false, /* isAlwaysInSlot. Only relevant for getters. */
1072 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1073 false, /* isTypedMethod. Only relevant for methods. */
1074 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1075};
1076
1077MOZ_CAN_RUN_SCRIPT static bool
1078get_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1079{
1080 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1083( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1081 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1083( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1082 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1083( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1083 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1083( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1084
1085 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1086 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1087 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1088 if (objIsXray) {
1089 unwrappedObj.emplace(cx, obj);
1090 }
1091 if (objIsXray) {
1092 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1093 // we know Xrays have no dynamic unwrap behavior.
1094 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1095 if (!unwrappedObj.ref()) {
1096 return false;
1097 }
1098 }
1099 FastErrorResult rv;
1100 int8_t result(MOZ_KnownLive(self)(self)->GetDomDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1101 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"
)), 0))
) {
1102 return false;
1103 }
1104 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1104); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1104); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1105 args.rval().setInt32(int32_t(result));
1106 return true;
1107}
1108
1109MOZ_CAN_RUN_SCRIPT static bool
1110set_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1111{
1112 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1115( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1113 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1115( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1114 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1115( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1115 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1115( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1116
1117 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1118 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1119 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1120 if (objIsXray) {
1121 unwrappedObj.emplace(cx, obj);
1122 }
1123 int8_t arg0;
1124 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1125 return false;
1126 }
1127 if (objIsXray) {
1128 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1129 // we know Xrays have no dynamic unwrap behavior.
1130 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1131 if (!unwrappedObj.ref()) {
1132 return false;
1133 }
1134 }
1135 FastErrorResult rv;
1136 // NOTE: This assert does NOT call the function.
1137 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");
1138 MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1139 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"
)), 0))
) {
1140 return false;
1141 }
1142 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1142); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1143
1144 return true;
1145}
1146
1147static const JSJitInfo domDependentByte_getterinfo = {
1148 { get_domDependentByte },
1149 { prototypes::id::TestJSImplInterface },
1150 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1151 JSJitInfo::Getter,
1152 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1153 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1154 false, /* isInfallible. False in setters. */
1155 false, /* isMovable. Not relevant for setters. */
1156 false, /* isEliminatable. Not relevant for setters. */
1157 false, /* isAlwaysInSlot. Only relevant for getters. */
1158 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1159 false, /* isTypedMethod. Only relevant for methods. */
1160 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1161};
1162static const JSJitInfo domDependentByte_setterinfo = {
1163 { (JSJitGetterOp)set_domDependentByte },
1164 { prototypes::id::TestJSImplInterface },
1165 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1166 JSJitInfo::Setter,
1167 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1168 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1169 false, /* isInfallible. False in setters. */
1170 false, /* isMovable. Not relevant for setters. */
1171 false, /* isEliminatable. Not relevant for setters. */
1172 false, /* isAlwaysInSlot. Only relevant for getters. */
1173 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1174 false, /* isTypedMethod. Only relevant for methods. */
1175 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1176};
1177
1178MOZ_CAN_RUN_SCRIPT static bool
1179get_constantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1180{
1181 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1184( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1182 "TestJSImplInterface", "constantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1184( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1183 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1184( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1184 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1184( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1185
1186 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1187 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1188 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1189 if (objIsXray) {
1190 unwrappedObj.emplace(cx, obj);
1191 }
1192 if (objIsXray) {
1193 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1194 // we know Xrays have no dynamic unwrap behavior.
1195 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1196 if (!unwrappedObj.ref()) {
1197 return false;
1198 }
1199 }
1200 FastErrorResult rv;
1201 int8_t result(MOZ_KnownLive(self)(self)->GetConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1202 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"
)), 0))
) {
1203 return false;
1204 }
1205 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1205); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1205); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1206 args.rval().setInt32(int32_t(result));
1207 return true;
1208}
1209
1210static const JSJitInfo constantByte_getterinfo = {
1211 { get_constantByte },
1212 { prototypes::id::TestJSImplInterface },
1213 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1214 JSJitInfo::Getter,
1215 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1216 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1217 false, /* isInfallible. False in setters. */
1218 false, /* isMovable. Not relevant for setters. */
1219 false, /* isEliminatable. Not relevant for setters. */
1220 false, /* isAlwaysInSlot. Only relevant for getters. */
1221 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1222 false, /* isTypedMethod. Only relevant for methods. */
1223 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1224};
1225
1226MOZ_CAN_RUN_SCRIPT static bool
1227get_deviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1228{
1229 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1232( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1230 "TestJSImplInterface", "deviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1232( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1231 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1232( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1232 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1232( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1233
1234 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1235 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1236 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1237 if (objIsXray) {
1238 unwrappedObj.emplace(cx, obj);
1239 }
1240 if (objIsXray) {
1241 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1242 // we know Xrays have no dynamic unwrap behavior.
1243 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1244 if (!unwrappedObj.ref()) {
1245 return false;
1246 }
1247 }
1248 FastErrorResult rv;
1249 int8_t result(MOZ_KnownLive(self)(self)->GetDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1250 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"
)), 0))
) {
1251 return false;
1252 }
1253 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1253); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1254 args.rval().setInt32(int32_t(result));
1255 return true;
1256}
1257
1258static const JSJitInfo deviceStateDependentByte_getterinfo = {
1259 { get_deviceStateDependentByte },
1260 { prototypes::id::TestJSImplInterface },
1261 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1262 JSJitInfo::Getter,
1263 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1264 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1265 false, /* isInfallible. False in setters. */
1266 false, /* isMovable. Not relevant for setters. */
1267 false, /* isEliminatable. Not relevant for setters. */
1268 false, /* isAlwaysInSlot. Only relevant for getters. */
1269 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1270 false, /* isTypedMethod. Only relevant for methods. */
1271 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1272};
1273
1274MOZ_CAN_RUN_SCRIPT static bool
1275returnByteSideEffectFree(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1276{
1277 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1280( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1278 "TestJSImplInterface", "returnByteSideEffectFree", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1280( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1279 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1280( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1280 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1280( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1281
1282 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1283 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1284 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1285 if (objIsXray) {
1286 unwrappedObj.emplace(cx, obj);
1287 }
1288 if (objIsXray) {
1289 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1290 // we know Xrays have no dynamic unwrap behavior.
1291 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1292 if (!unwrappedObj.ref()) {
1293 return false;
1294 }
1295 }
1296 FastErrorResult rv;
1297 int8_t result(MOZ_KnownLive(self)(self)->ReturnByteSideEffectFree(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1298 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"
)), 0))
) {
1299 return false;
1300 }
1301 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1301); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1301); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1302 args.rval().setInt32(int32_t(result));
1303 return true;
1304}
1305
1306static const JSJitInfo::ArgType returnByteSideEffectFree_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1307static const JSTypedMethodJitInfo returnByteSideEffectFree_methodinfo = {
1308 {
1309 { (JSJitGetterOp)returnByteSideEffectFree },
1310 { prototypes::id::TestJSImplInterface },
1311 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1312 JSJitInfo::Method,
1313 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1314 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1315 false, /* isInfallible. False in setters. */
1316 false, /* isMovable. Not relevant for setters. */
1317 false, /* isEliminatable. Not relevant for setters. */
1318 false, /* isAlwaysInSlot. Only relevant for getters. */
1319 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1320 true, /* isTypedMethod. Only relevant for methods. */
1321 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1322 },
1323 returnByteSideEffectFree_methodinfo_argTypes
1324};
1325
1326MOZ_CAN_RUN_SCRIPT static bool
1327returnDOMDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1328{
1329 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1332( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1330 "TestJSImplInterface", "returnDOMDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1332( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1331 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1332( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1332 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1332( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1333
1334 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1335 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1336 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1337 if (objIsXray) {
1338 unwrappedObj.emplace(cx, obj);
1339 }
1340 if (objIsXray) {
1341 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1342 // we know Xrays have no dynamic unwrap behavior.
1343 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1344 if (!unwrappedObj.ref()) {
1345 return false;
1346 }
1347 }
1348 FastErrorResult rv;
1349 int8_t result(MOZ_KnownLive(self)(self)->ReturnDOMDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1350 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"
)), 0))
) {
1351 return false;
1352 }
1353 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1353); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1353); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1354 args.rval().setInt32(int32_t(result));
1355 return true;
1356}
1357
1358static const JSJitInfo::ArgType returnDOMDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1359static const JSTypedMethodJitInfo returnDOMDependentByte_methodinfo = {
1360 {
1361 { (JSJitGetterOp)returnDOMDependentByte },
1362 { prototypes::id::TestJSImplInterface },
1363 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1364 JSJitInfo::Method,
1365 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1366 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1367 false, /* isInfallible. False in setters. */
1368 false, /* isMovable. Not relevant for setters. */
1369 false, /* isEliminatable. Not relevant for setters. */
1370 false, /* isAlwaysInSlot. Only relevant for getters. */
1371 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1372 true, /* isTypedMethod. Only relevant for methods. */
1373 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1374 },
1375 returnDOMDependentByte_methodinfo_argTypes
1376};
1377
1378MOZ_CAN_RUN_SCRIPT static bool
1379returnConstantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1380{
1381 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1384( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1382 "TestJSImplInterface", "returnConstantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1384( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1383 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1384( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1384 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1384( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1385
1386 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1387 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1388 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1389 if (objIsXray) {
1390 unwrappedObj.emplace(cx, obj);
1391 }
1392 if (objIsXray) {
1393 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1394 // we know Xrays have no dynamic unwrap behavior.
1395 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1396 if (!unwrappedObj.ref()) {
1397 return false;
1398 }
1399 }
1400 FastErrorResult rv;
1401 int8_t result(MOZ_KnownLive(self)(self)->ReturnConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1402 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"
)), 0))
) {
1403 return false;
1404 }
1405 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1406 args.rval().setInt32(int32_t(result));
1407 return true;
1408}
1409
1410static const JSJitInfo::ArgType returnConstantByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1411static const JSTypedMethodJitInfo returnConstantByte_methodinfo = {
1412 {
1413 { (JSJitGetterOp)returnConstantByte },
1414 { prototypes::id::TestJSImplInterface },
1415 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1416 JSJitInfo::Method,
1417 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1418 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1419 false, /* isInfallible. False in setters. */
1420 false, /* isMovable. Not relevant for setters. */
1421 false, /* isEliminatable. Not relevant for setters. */
1422 false, /* isAlwaysInSlot. Only relevant for getters. */
1423 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1424 true, /* isTypedMethod. Only relevant for methods. */
1425 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1426 },
1427 returnConstantByte_methodinfo_argTypes
1428};
1429
1430MOZ_CAN_RUN_SCRIPT static bool
1431returnDeviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1432{
1433 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1436( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1434 "TestJSImplInterface", "returnDeviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1436( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1435 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1436( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1436 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1436( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1437
1438 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1439 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1440 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1441 if (objIsXray) {
1442 unwrappedObj.emplace(cx, obj);
1443 }
1444 if (objIsXray) {
1445 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1446 // we know Xrays have no dynamic unwrap behavior.
1447 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1448 if (!unwrappedObj.ref()) {
1449 return false;
1450 }
1451 }
1452 FastErrorResult rv;
1453 int8_t result(MOZ_KnownLive(self)(self)->ReturnDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1454 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"
)), 0))
) {
1455 return false;
1456 }
1457 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1457); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1457); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1458 args.rval().setInt32(int32_t(result));
1459 return true;
1460}
1461
1462static const JSJitInfo::ArgType returnDeviceStateDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1463static const JSTypedMethodJitInfo returnDeviceStateDependentByte_methodinfo = {
1464 {
1465 { (JSJitGetterOp)returnDeviceStateDependentByte },
1466 { prototypes::id::TestJSImplInterface },
1467 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1468 JSJitInfo::Method,
1469 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1470 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1471 false, /* isInfallible. False in setters. */
1472 false, /* isMovable. Not relevant for setters. */
1473 false, /* isEliminatable. Not relevant for setters. */
1474 false, /* isAlwaysInSlot. Only relevant for getters. */
1475 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1476 true, /* isTypedMethod. Only relevant for methods. */
1477 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1478 },
1479 returnDeviceStateDependentByte_methodinfo_argTypes
1480};
1481
1482MOZ_CAN_RUN_SCRIPT static bool
1483get_readonlyShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1484{
1485 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1488( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1486 "TestJSImplInterface", "readonlyShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1488( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1487 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1488( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1488 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1488( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1489
1490 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1491 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1492 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1493 if (objIsXray) {
1494 unwrappedObj.emplace(cx, obj);
1495 }
1496 if (objIsXray) {
1497 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1498 // we know Xrays have no dynamic unwrap behavior.
1499 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1500 if (!unwrappedObj.ref()) {
1501 return false;
1502 }
1503 }
1504 FastErrorResult rv;
1505 int16_t result(MOZ_KnownLive(self)(self)->GetReadonlyShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1506 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"
)), 0))
) {
1507 return false;
1508 }
1509 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1509); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1509); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1510 args.rval().setInt32(int32_t(result));
1511 return true;
1512}
1513
1514static const JSJitInfo readonlyShort_getterinfo = {
1515 { get_readonlyShort },
1516 { prototypes::id::TestJSImplInterface },
1517 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1518 JSJitInfo::Getter,
1519 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1520 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1521 false, /* isInfallible. False in setters. */
1522 false, /* isMovable. Not relevant for setters. */
1523 false, /* isEliminatable. Not relevant for setters. */
1524 false, /* isAlwaysInSlot. Only relevant for getters. */
1525 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1526 false, /* isTypedMethod. Only relevant for methods. */
1527 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1528};
1529
1530MOZ_CAN_RUN_SCRIPT static bool
1531get_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1532{
1533 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1536( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1534 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1536( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1535 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1536( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1536 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1536( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1537
1538 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1539 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1540 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1541 if (objIsXray) {
1542 unwrappedObj.emplace(cx, obj);
1543 }
1544 if (objIsXray) {
1545 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1546 // we know Xrays have no dynamic unwrap behavior.
1547 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1548 if (!unwrappedObj.ref()) {
1549 return false;
1550 }
1551 }
1552 FastErrorResult rv;
1553 int16_t result(MOZ_KnownLive(self)(self)->GetWritableShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1554 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"
)), 0))
) {
1555 return false;
1556 }
1557 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1557); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1557); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1558 args.rval().setInt32(int32_t(result));
1559 return true;
1560}
1561
1562MOZ_CAN_RUN_SCRIPT static bool
1563set_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1564{
1565 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1568( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1566 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1568( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1567 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1568( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1568 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1568( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1569
1570 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1571 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1572 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1573 if (objIsXray) {
1574 unwrappedObj.emplace(cx, obj);
1575 }
1576 int16_t arg0;
1577 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1578 return false;
1579 }
1580 if (objIsXray) {
1581 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1582 // we know Xrays have no dynamic unwrap behavior.
1583 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1584 if (!unwrappedObj.ref()) {
1585 return false;
1586 }
1587 }
1588 FastErrorResult rv;
1589 // NOTE: This assert does NOT call the function.
1590 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");
1591 MOZ_KnownLive(self)(self)->SetWritableShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1592 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"
)), 0))
) {
1593 return false;
1594 }
1595 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1595); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1595); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1596
1597 return true;
1598}
1599
1600static const JSJitInfo writableShort_getterinfo = {
1601 { get_writableShort },
1602 { prototypes::id::TestJSImplInterface },
1603 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1604 JSJitInfo::Getter,
1605 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1606 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1607 false, /* isInfallible. False in setters. */
1608 false, /* isMovable. Not relevant for setters. */
1609 false, /* isEliminatable. Not relevant for setters. */
1610 false, /* isAlwaysInSlot. Only relevant for getters. */
1611 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1612 false, /* isTypedMethod. Only relevant for methods. */
1613 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1614};
1615static const JSJitInfo writableShort_setterinfo = {
1616 { (JSJitGetterOp)set_writableShort },
1617 { prototypes::id::TestJSImplInterface },
1618 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1619 JSJitInfo::Setter,
1620 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1621 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1622 false, /* isInfallible. False in setters. */
1623 false, /* isMovable. Not relevant for setters. */
1624 false, /* isEliminatable. Not relevant for setters. */
1625 false, /* isAlwaysInSlot. Only relevant for getters. */
1626 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1627 false, /* isTypedMethod. Only relevant for methods. */
1628 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1629};
1630
1631MOZ_CAN_RUN_SCRIPT static bool
1632passShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1633{
1634 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1637( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1635 "TestJSImplInterface", "passShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1637( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1636 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1637( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1637 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1637( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
1638
1639 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1640 if (!args.requireAtLeast(cx, "TestJSImplInterface.passShort", 1)) {
1641 return false;
1642 }
1643 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1644 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1645 if (objIsXray) {
1646 unwrappedObj.emplace(cx, obj);
1647 }
1648 int16_t arg0;
1649 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1650 return false;
1651 }
1652 if (objIsXray) {
1653 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1654 // we know Xrays have no dynamic unwrap behavior.
1655 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1656 if (!unwrappedObj.ref()) {
1657 return false;
1658 }
1659 }
1660 FastErrorResult rv;
1661 // NOTE: This assert does NOT call the function.
1662 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");
1663 MOZ_KnownLive(self)(self)->PassShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1664 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"
)), 0))
) {
1665 return false;
1666 }
1667 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1667); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1667); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1668 args.rval().setUndefined();
1669 return true;
1670}
1671
1672static const JSJitInfo passShort_methodinfo = {
1673 { (JSJitGetterOp)passShort },
1674 { prototypes::id::TestJSImplInterface },
1675 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1676 JSJitInfo::Method,
1677 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1678 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1679 false, /* isInfallible. False in setters. */
1680 false, /* isMovable. Not relevant for setters. */
1681 false, /* isEliminatable. Not relevant for setters. */
1682 false, /* isAlwaysInSlot. Only relevant for getters. */
1683 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1684 false, /* isTypedMethod. Only relevant for methods. */
1685 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1686};
1687
1688MOZ_CAN_RUN_SCRIPT static bool
1689receiveShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1690{
1691 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1694( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1692 "TestJSImplInterface", "receiveShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1694( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1693 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1694( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1694 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1694( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1695
1696 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1697 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1698 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1699 if (objIsXray) {
1700 unwrappedObj.emplace(cx, obj);
1701 }
1702 if (objIsXray) {
1703 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1704 // we know Xrays have no dynamic unwrap behavior.
1705 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1706 if (!unwrappedObj.ref()) {
1707 return false;
1708 }
1709 }
1710 FastErrorResult rv;
1711 int16_t result(MOZ_KnownLive(self)(self)->ReceiveShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1712 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"
)), 0))
) {
1713 return false;
1714 }
1715 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1715); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1715); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1716 args.rval().setInt32(int32_t(result));
1717 return true;
1718}
1719
1720static const JSJitInfo receiveShort_methodinfo = {
1721 { (JSJitGetterOp)receiveShort },
1722 { prototypes::id::TestJSImplInterface },
1723 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1724 JSJitInfo::Method,
1725 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1726 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1727 false, /* isInfallible. False in setters. */
1728 false, /* isMovable. Not relevant for setters. */
1729 false, /* isEliminatable. Not relevant for setters. */
1730 false, /* isAlwaysInSlot. Only relevant for getters. */
1731 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1732 false, /* isTypedMethod. Only relevant for methods. */
1733 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1734};
1735
1736MOZ_CAN_RUN_SCRIPT static bool
1737passOptionalShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1738{
1739 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1742( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1740 "TestJSImplInterface", "passOptionalShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1742( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1741 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1742( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1742 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1742( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1743
1744 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1745 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1746 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1747 if (objIsXray) {
1748 unwrappedObj.emplace(cx, obj);
1749 }
1750 Optional<int16_t> arg0;
1751 if (args.hasDefined(0)) {
1752 arg0.Construct();
1753 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
1754 return false;
1755 }
1756 }
1757 if (objIsXray) {
1758 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1759 // we know Xrays have no dynamic unwrap behavior.
1760 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1761 if (!unwrappedObj.ref()) {
1762 return false;
1763 }
1764 }
1765 FastErrorResult rv;
1766 // NOTE: This assert does NOT call the function.
1767 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");
1768 MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1769 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"
)), 0))
) {
1770 return false;
1771 }
1772 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1772); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1772); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1773 args.rval().setUndefined();
1774 return true;
1775}
1776
1777static const JSJitInfo passOptionalShort_methodinfo = {
1778 { (JSJitGetterOp)passOptionalShort },
1779 { prototypes::id::TestJSImplInterface },
1780 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1781 JSJitInfo::Method,
1782 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1783 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1784 false, /* isInfallible. False in setters. */
1785 false, /* isMovable. Not relevant for setters. */
1786 false, /* isEliminatable. Not relevant for setters. */
1787 false, /* isAlwaysInSlot. Only relevant for getters. */
1788 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1789 false, /* isTypedMethod. Only relevant for methods. */
1790 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1791};
1792
1793MOZ_CAN_RUN_SCRIPT static bool
1794passOptionalShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1795{
1796 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1799( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1797 "TestJSImplInterface", "passOptionalShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1799( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1798 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1799( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1799 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1799( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1800
1801 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1802 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1803 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1804 if (objIsXray) {
1805 unwrappedObj.emplace(cx, obj);
1806 }
1807 int16_t arg0;
1808 if (args.hasDefined(0)) {
1809 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1810 return false;
1811 }
1812 } else {
1813 arg0 = 5;
1814 }
1815 if (objIsXray) {
1816 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1817 // we know Xrays have no dynamic unwrap behavior.
1818 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1819 if (!unwrappedObj.ref()) {
1820 return false;
1821 }
1822 }
1823 FastErrorResult rv;
1824 // NOTE: This assert does NOT call the function.
1825 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");
1826 MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1827 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"
)), 0))
) {
1828 return false;
1829 }
1830 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1830); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1831 args.rval().setUndefined();
1832 return true;
1833}
1834
1835static const JSJitInfo passOptionalShortWithDefault_methodinfo = {
1836 { (JSJitGetterOp)passOptionalShortWithDefault },
1837 { prototypes::id::TestJSImplInterface },
1838 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1839 JSJitInfo::Method,
1840 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1841 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1842 false, /* isInfallible. False in setters. */
1843 false, /* isMovable. Not relevant for setters. */
1844 false, /* isEliminatable. Not relevant for setters. */
1845 false, /* isAlwaysInSlot. Only relevant for getters. */
1846 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1847 false, /* isTypedMethod. Only relevant for methods. */
1848 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1849};
1850
1851MOZ_CAN_RUN_SCRIPT static bool
1852get_readonlyLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1853{
1854 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1857( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1855 "TestJSImplInterface", "readonlyLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1857( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1856 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1857( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1857 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1857( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1858
1859 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1860 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1861 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1862 if (objIsXray) {
1863 unwrappedObj.emplace(cx, obj);
1864 }
1865 if (objIsXray) {
1866 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1867 // we know Xrays have no dynamic unwrap behavior.
1868 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1869 if (!unwrappedObj.ref()) {
1870 return false;
1871 }
1872 }
1873 FastErrorResult rv;
1874 int32_t result(MOZ_KnownLive(self)(self)->GetReadonlyLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1875 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"
)), 0))
) {
1876 return false;
1877 }
1878 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1878); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1879 args.rval().setInt32(int32_t(result));
1880 return true;
1881}
1882
1883static const JSJitInfo readonlyLong_getterinfo = {
1884 { get_readonlyLong },
1885 { prototypes::id::TestJSImplInterface },
1886 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1887 JSJitInfo::Getter,
1888 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1889 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1890 false, /* isInfallible. False in setters. */
1891 false, /* isMovable. Not relevant for setters. */
1892 false, /* isEliminatable. Not relevant for setters. */
1893 false, /* isAlwaysInSlot. Only relevant for getters. */
1894 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1895 false, /* isTypedMethod. Only relevant for methods. */
1896 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1897};
1898
1899MOZ_CAN_RUN_SCRIPT static bool
1900get_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1901{
1902 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1905( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1903 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1905( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1904 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1905( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1905 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1905( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1906
1907 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1908 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1909 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1910 if (objIsXray) {
1911 unwrappedObj.emplace(cx, obj);
1912 }
1913 if (objIsXray) {
1914 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1915 // we know Xrays have no dynamic unwrap behavior.
1916 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1917 if (!unwrappedObj.ref()) {
1918 return false;
1919 }
1920 }
1921 FastErrorResult rv;
1922 int32_t result(MOZ_KnownLive(self)(self)->GetWritableLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1923 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"
)), 0))
) {
1924 return false;
1925 }
1926 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1926); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1927 args.rval().setInt32(int32_t(result));
1928 return true;
1929}
1930
1931MOZ_CAN_RUN_SCRIPT static bool
1932set_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1933{
1934 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1937( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1935 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1937( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1936 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1937( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1937 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1937( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1938
1939 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1940 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1941 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1942 if (objIsXray) {
1943 unwrappedObj.emplace(cx, obj);
1944 }
1945 int32_t arg0;
1946 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1947 return false;
1948 }
1949 if (objIsXray) {
1950 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1951 // we know Xrays have no dynamic unwrap behavior.
1952 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1953 if (!unwrappedObj.ref()) {
1954 return false;
1955 }
1956 }
1957 FastErrorResult rv;
1958 // NOTE: This assert does NOT call the function.
1959 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");
1960 MOZ_KnownLive(self)(self)->SetWritableLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1961 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"
)), 0))
) {
1962 return false;
1963 }
1964 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1964); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 1964); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
1965
1966 return true;
1967}
1968
1969static const JSJitInfo writableLong_getterinfo = {
1970 { get_writableLong },
1971 { prototypes::id::TestJSImplInterface },
1972 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1973 JSJitInfo::Getter,
1974 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1975 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1976 false, /* isInfallible. False in setters. */
1977 false, /* isMovable. Not relevant for setters. */
1978 false, /* isEliminatable. Not relevant for setters. */
1979 false, /* isAlwaysInSlot. Only relevant for getters. */
1980 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1981 false, /* isTypedMethod. Only relevant for methods. */
1982 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1983};
1984static const JSJitInfo writableLong_setterinfo = {
1985 { (JSJitGetterOp)set_writableLong },
1986 { prototypes::id::TestJSImplInterface },
1987 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1988 JSJitInfo::Setter,
1989 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1990 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1991 false, /* isInfallible. False in setters. */
1992 false, /* isMovable. Not relevant for setters. */
1993 false, /* isEliminatable. Not relevant for setters. */
1994 false, /* isAlwaysInSlot. Only relevant for getters. */
1995 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1996 false, /* isTypedMethod. Only relevant for methods. */
1997 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1998};
1999
2000MOZ_CAN_RUN_SCRIPT static bool
2001passLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2002{
2003 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2006( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2004 "TestJSImplInterface", "passLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2006( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2005 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2006( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2006 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2006( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
2007
2008 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2009 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLong", 1)) {
2010 return false;
2011 }
2012 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2013 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2014 if (objIsXray) {
2015 unwrappedObj.emplace(cx, obj);
2016 }
2017 int32_t arg0;
2018 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2019 return false;
2020 }
2021 if (objIsXray) {
2022 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2023 // we know Xrays have no dynamic unwrap behavior.
2024 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2025 if (!unwrappedObj.ref()) {
2026 return false;
2027 }
2028 }
2029 FastErrorResult rv;
2030 // NOTE: This assert does NOT call the function.
2031 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");
2032 MOZ_KnownLive(self)(self)->PassLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2033 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"
)), 0))
) {
2034 return false;
2035 }
2036 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2036); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2036); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2037 args.rval().setUndefined();
2038 return true;
2039}
2040
2041static const JSJitInfo passLong_methodinfo = {
2042 { (JSJitGetterOp)passLong },
2043 { prototypes::id::TestJSImplInterface },
2044 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2045 JSJitInfo::Method,
2046 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2047 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2048 false, /* isInfallible. False in setters. */
2049 false, /* isMovable. Not relevant for setters. */
2050 false, /* isEliminatable. Not relevant for setters. */
2051 false, /* isAlwaysInSlot. Only relevant for getters. */
2052 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2053 false, /* isTypedMethod. Only relevant for methods. */
2054 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2055};
2056
2057MOZ_CAN_RUN_SCRIPT static bool
2058receiveLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2059{
2060 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2063( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2061 "TestJSImplInterface", "receiveLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2063( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2062 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2063( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2063 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2063( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2064
2065 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2066 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2067 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2068 if (objIsXray) {
2069 unwrappedObj.emplace(cx, obj);
2070 }
2071 if (objIsXray) {
2072 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2073 // we know Xrays have no dynamic unwrap behavior.
2074 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2075 if (!unwrappedObj.ref()) {
2076 return false;
2077 }
2078 }
2079 FastErrorResult rv;
2080 int32_t result(MOZ_KnownLive(self)(self)->ReceiveLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2081 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"
)), 0))
) {
2082 return false;
2083 }
2084 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2084); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2084); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2085 args.rval().setInt32(int32_t(result));
2086 return true;
2087}
2088
2089static const JSJitInfo receiveLong_methodinfo = {
2090 { (JSJitGetterOp)receiveLong },
2091 { prototypes::id::TestJSImplInterface },
2092 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2093 JSJitInfo::Method,
2094 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2095 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2096 false, /* isInfallible. False in setters. */
2097 false, /* isMovable. Not relevant for setters. */
2098 false, /* isEliminatable. Not relevant for setters. */
2099 false, /* isAlwaysInSlot. Only relevant for getters. */
2100 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2101 false, /* isTypedMethod. Only relevant for methods. */
2102 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2103};
2104
2105MOZ_CAN_RUN_SCRIPT static bool
2106passOptionalLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2107{
2108 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2111( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2109 "TestJSImplInterface", "passOptionalLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2111( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2110 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2111( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2111 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2111( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2112
2113 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2114 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2115 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2116 if (objIsXray) {
2117 unwrappedObj.emplace(cx, obj);
2118 }
2119 Optional<int32_t> arg0;
2120 if (args.hasDefined(0)) {
2121 arg0.Construct();
2122 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2123 return false;
2124 }
2125 }
2126 if (objIsXray) {
2127 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2128 // we know Xrays have no dynamic unwrap behavior.
2129 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2130 if (!unwrappedObj.ref()) {
2131 return false;
2132 }
2133 }
2134 FastErrorResult rv;
2135 // NOTE: This assert does NOT call the function.
2136 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");
2137 MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2138 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"
)), 0))
) {
2139 return false;
2140 }
2141 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2141); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2142 args.rval().setUndefined();
2143 return true;
2144}
2145
2146static const JSJitInfo passOptionalLong_methodinfo = {
2147 { (JSJitGetterOp)passOptionalLong },
2148 { prototypes::id::TestJSImplInterface },
2149 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2150 JSJitInfo::Method,
2151 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2152 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2153 false, /* isInfallible. False in setters. */
2154 false, /* isMovable. Not relevant for setters. */
2155 false, /* isEliminatable. Not relevant for setters. */
2156 false, /* isAlwaysInSlot. Only relevant for getters. */
2157 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2158 false, /* isTypedMethod. Only relevant for methods. */
2159 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2160};
2161
2162MOZ_CAN_RUN_SCRIPT static bool
2163passOptionalLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2164{
2165 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2168( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2166 "TestJSImplInterface", "passOptionalLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2168( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2167 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2168( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2168 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2168( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2169
2170 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2171 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2172 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2173 if (objIsXray) {
2174 unwrappedObj.emplace(cx, obj);
2175 }
2176 int32_t arg0;
2177 if (args.hasDefined(0)) {
2178 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2179 return false;
2180 }
2181 } else {
2182 arg0 = 7;
2183 }
2184 if (objIsXray) {
2185 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2186 // we know Xrays have no dynamic unwrap behavior.
2187 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2188 if (!unwrappedObj.ref()) {
2189 return false;
2190 }
2191 }
2192 FastErrorResult rv;
2193 // NOTE: This assert does NOT call the function.
2194 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");
2195 MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2196 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"
)), 0))
) {
2197 return false;
2198 }
2199 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2199); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2199); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2200 args.rval().setUndefined();
2201 return true;
2202}
2203
2204static const JSJitInfo passOptionalLongWithDefault_methodinfo = {
2205 { (JSJitGetterOp)passOptionalLongWithDefault },
2206 { prototypes::id::TestJSImplInterface },
2207 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2208 JSJitInfo::Method,
2209 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2210 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2211 false, /* isInfallible. False in setters. */
2212 false, /* isMovable. Not relevant for setters. */
2213 false, /* isEliminatable. Not relevant for setters. */
2214 false, /* isAlwaysInSlot. Only relevant for getters. */
2215 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2216 false, /* isTypedMethod. Only relevant for methods. */
2217 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2218};
2219
2220MOZ_CAN_RUN_SCRIPT static bool
2221get_readonlyLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2222{
2223 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2226( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2224 "TestJSImplInterface", "readonlyLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2226( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2225 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2226( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2226 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2226( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2227
2228 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2229 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2230 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2231 if (objIsXray) {
2232 unwrappedObj.emplace(cx, obj);
2233 }
2234 if (objIsXray) {
2235 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2236 // we know Xrays have no dynamic unwrap behavior.
2237 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2238 if (!unwrappedObj.ref()) {
2239 return false;
2240 }
2241 }
2242 FastErrorResult rv;
2243 int64_t result(MOZ_KnownLive(self)(self)->GetReadonlyLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2244 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"
)), 0))
) {
2245 return false;
2246 }
2247 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2247); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2247); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2248 args.rval().set(JS_NumberValue(double(result)));
2249 return true;
2250}
2251
2252static const JSJitInfo readonlyLongLong_getterinfo = {
2253 { get_readonlyLongLong },
2254 { prototypes::id::TestJSImplInterface },
2255 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2256 JSJitInfo::Getter,
2257 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2258 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2259 false, /* isInfallible. False in setters. */
2260 false, /* isMovable. Not relevant for setters. */
2261 false, /* isEliminatable. Not relevant for setters. */
2262 false, /* isAlwaysInSlot. Only relevant for getters. */
2263 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2264 false, /* isTypedMethod. Only relevant for methods. */
2265 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2266};
2267
2268MOZ_CAN_RUN_SCRIPT static bool
2269get_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2270{
2271 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2274( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2272 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2274( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2273 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2274( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2274 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2274( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2275
2276 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2277 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2278 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2279 if (objIsXray) {
2280 unwrappedObj.emplace(cx, obj);
2281 }
2282 if (objIsXray) {
2283 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2284 // we know Xrays have no dynamic unwrap behavior.
2285 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2286 if (!unwrappedObj.ref()) {
2287 return false;
2288 }
2289 }
2290 FastErrorResult rv;
2291 int64_t result(MOZ_KnownLive(self)(self)->GetWritableLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2292 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"
)), 0))
) {
2293 return false;
2294 }
2295 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2295); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2295); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2296 args.rval().set(JS_NumberValue(double(result)));
2297 return true;
2298}
2299
2300MOZ_CAN_RUN_SCRIPT static bool
2301set_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2302{
2303 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2306( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2304 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2306( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2305 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2306( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2306 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2306( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2307
2308 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2309 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2310 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2311 if (objIsXray) {
2312 unwrappedObj.emplace(cx, obj);
2313 }
2314 int64_t arg0;
2315 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2316 return false;
2317 }
2318 if (objIsXray) {
2319 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2320 // we know Xrays have no dynamic unwrap behavior.
2321 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2322 if (!unwrappedObj.ref()) {
2323 return false;
2324 }
2325 }
2326 FastErrorResult rv;
2327 // NOTE: This assert does NOT call the function.
2328 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");
2329 MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2330 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"
)), 0))
) {
2331 return false;
2332 }
2333 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2333); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2333); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2334
2335 return true;
2336}
2337
2338static const JSJitInfo writableLongLong_getterinfo = {
2339 { get_writableLongLong },
2340 { prototypes::id::TestJSImplInterface },
2341 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2342 JSJitInfo::Getter,
2343 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2344 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2345 false, /* isInfallible. False in setters. */
2346 false, /* isMovable. Not relevant for setters. */
2347 false, /* isEliminatable. Not relevant for setters. */
2348 false, /* isAlwaysInSlot. Only relevant for getters. */
2349 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2350 false, /* isTypedMethod. Only relevant for methods. */
2351 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2352};
2353static const JSJitInfo writableLongLong_setterinfo = {
2354 { (JSJitGetterOp)set_writableLongLong },
2355 { prototypes::id::TestJSImplInterface },
2356 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2357 JSJitInfo::Setter,
2358 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2359 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2360 false, /* isInfallible. False in setters. */
2361 false, /* isMovable. Not relevant for setters. */
2362 false, /* isEliminatable. Not relevant for setters. */
2363 false, /* isAlwaysInSlot. Only relevant for getters. */
2364 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2365 false, /* isTypedMethod. Only relevant for methods. */
2366 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2367};
2368
2369MOZ_CAN_RUN_SCRIPT static bool
2370passLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2371{
2372 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2375( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2373 "TestJSImplInterface", "passLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2375( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2374 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2375( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2375 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2375( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2376
2377 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2378 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLongLong", 1)) {
2379 return false;
2380 }
2381 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2382 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2383 if (objIsXray) {
2384 unwrappedObj.emplace(cx, obj);
2385 }
2386 int64_t arg0;
2387 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2388 return false;
2389 }
2390 if (objIsXray) {
2391 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2392 // we know Xrays have no dynamic unwrap behavior.
2393 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2394 if (!unwrappedObj.ref()) {
2395 return false;
2396 }
2397 }
2398 FastErrorResult rv;
2399 // NOTE: This assert does NOT call the function.
2400 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");
2401 MOZ_KnownLive(self)(self)->PassLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2402 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"
)), 0))
) {
2403 return false;
2404 }
2405 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2406 args.rval().setUndefined();
2407 return true;
2408}
2409
2410static const JSJitInfo passLongLong_methodinfo = {
2411 { (JSJitGetterOp)passLongLong },
2412 { prototypes::id::TestJSImplInterface },
2413 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2414 JSJitInfo::Method,
2415 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2416 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2417 false, /* isInfallible. False in setters. */
2418 false, /* isMovable. Not relevant for setters. */
2419 false, /* isEliminatable. Not relevant for setters. */
2420 false, /* isAlwaysInSlot. Only relevant for getters. */
2421 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2422 false, /* isTypedMethod. Only relevant for methods. */
2423 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2424};
2425
2426MOZ_CAN_RUN_SCRIPT static bool
2427receiveLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2428{
2429 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2432( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2430 "TestJSImplInterface", "receiveLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2432( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2431 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2432( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2432 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2432( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2433
2434 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2435 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2436 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2437 if (objIsXray) {
2438 unwrappedObj.emplace(cx, obj);
2439 }
2440 if (objIsXray) {
2441 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2442 // we know Xrays have no dynamic unwrap behavior.
2443 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2444 if (!unwrappedObj.ref()) {
2445 return false;
2446 }
2447 }
2448 FastErrorResult rv;
2449 int64_t result(MOZ_KnownLive(self)(self)->ReceiveLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2450 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"
)), 0))
) {
2451 return false;
2452 }
2453 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2453); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2453); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2454 args.rval().set(JS_NumberValue(double(result)));
2455 return true;
2456}
2457
2458static const JSJitInfo receiveLongLong_methodinfo = {
2459 { (JSJitGetterOp)receiveLongLong },
2460 { prototypes::id::TestJSImplInterface },
2461 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2462 JSJitInfo::Method,
2463 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2464 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2465 false, /* isInfallible. False in setters. */
2466 false, /* isMovable. Not relevant for setters. */
2467 false, /* isEliminatable. Not relevant for setters. */
2468 false, /* isAlwaysInSlot. Only relevant for getters. */
2469 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2470 false, /* isTypedMethod. Only relevant for methods. */
2471 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2472};
2473
2474MOZ_CAN_RUN_SCRIPT static bool
2475passOptionalLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2476{
2477 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2480( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2478 "TestJSImplInterface", "passOptionalLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2480( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2479 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2480( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2480 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2480( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2481
2482 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2483 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2484 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2485 if (objIsXray) {
2486 unwrappedObj.emplace(cx, obj);
2487 }
2488 Optional<int64_t> arg0;
2489 if (args.hasDefined(0)) {
2490 arg0.Construct();
2491 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2492 return false;
2493 }
2494 }
2495 if (objIsXray) {
2496 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2497 // we know Xrays have no dynamic unwrap behavior.
2498 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2499 if (!unwrappedObj.ref()) {
2500 return false;
2501 }
2502 }
2503 FastErrorResult rv;
2504 // NOTE: This assert does NOT call the function.
2505 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");
2506 MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2507 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"
)), 0))
) {
2508 return false;
2509 }
2510 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2510); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2510); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2511 args.rval().setUndefined();
2512 return true;
2513}
2514
2515static const JSJitInfo passOptionalLongLong_methodinfo = {
2516 { (JSJitGetterOp)passOptionalLongLong },
2517 { prototypes::id::TestJSImplInterface },
2518 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2519 JSJitInfo::Method,
2520 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2521 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2522 false, /* isInfallible. False in setters. */
2523 false, /* isMovable. Not relevant for setters. */
2524 false, /* isEliminatable. Not relevant for setters. */
2525 false, /* isAlwaysInSlot. Only relevant for getters. */
2526 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2527 false, /* isTypedMethod. Only relevant for methods. */
2528 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2529};
2530
2531MOZ_CAN_RUN_SCRIPT static bool
2532passOptionalLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2533{
2534 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2537( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2535 "TestJSImplInterface", "passOptionalLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2537( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2536 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2537( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2537 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2537( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2538
2539 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2540 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2541 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2542 if (objIsXray) {
2543 unwrappedObj.emplace(cx, obj);
2544 }
2545 int64_t arg0;
2546 if (args.hasDefined(0)) {
2547 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2548 return false;
2549 }
2550 } else {
2551 arg0 = -12LL;
2552 }
2553 if (objIsXray) {
2554 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2555 // we know Xrays have no dynamic unwrap behavior.
2556 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2557 if (!unwrappedObj.ref()) {
2558 return false;
2559 }
2560 }
2561 FastErrorResult rv;
2562 // NOTE: This assert does NOT call the function.
2563 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");
2564 MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2565 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"
)), 0))
) {
2566 return false;
2567 }
2568 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2568); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2568); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2569 args.rval().setUndefined();
2570 return true;
2571}
2572
2573static const JSJitInfo passOptionalLongLongWithDefault_methodinfo = {
2574 { (JSJitGetterOp)passOptionalLongLongWithDefault },
2575 { prototypes::id::TestJSImplInterface },
2576 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2577 JSJitInfo::Method,
2578 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2579 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2580 false, /* isInfallible. False in setters. */
2581 false, /* isMovable. Not relevant for setters. */
2582 false, /* isEliminatable. Not relevant for setters. */
2583 false, /* isAlwaysInSlot. Only relevant for getters. */
2584 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2585 false, /* isTypedMethod. Only relevant for methods. */
2586 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2587};
2588
2589MOZ_CAN_RUN_SCRIPT static bool
2590get_readonlyOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2591{
2592 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2595( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2593 "TestJSImplInterface", "readonlyOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2595( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2594 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2595( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2595 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2595( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2596
2597 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2598 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2599 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2600 if (objIsXray) {
2601 unwrappedObj.emplace(cx, obj);
2602 }
2603 if (objIsXray) {
2604 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2605 // we know Xrays have no dynamic unwrap behavior.
2606 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2607 if (!unwrappedObj.ref()) {
2608 return false;
2609 }
2610 }
2611 FastErrorResult rv;
2612 uint8_t result(MOZ_KnownLive(self)(self)->GetReadonlyOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2613 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"
)), 0))
) {
2614 return false;
2615 }
2616 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2616); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2617 args.rval().setInt32(int32_t(result));
2618 return true;
2619}
2620
2621static const JSJitInfo readonlyOctet_getterinfo = {
2622 { get_readonlyOctet },
2623 { prototypes::id::TestJSImplInterface },
2624 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2625 JSJitInfo::Getter,
2626 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2627 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2628 false, /* isInfallible. False in setters. */
2629 false, /* isMovable. Not relevant for setters. */
2630 false, /* isEliminatable. Not relevant for setters. */
2631 false, /* isAlwaysInSlot. Only relevant for getters. */
2632 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2633 false, /* isTypedMethod. Only relevant for methods. */
2634 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2635};
2636
2637MOZ_CAN_RUN_SCRIPT static bool
2638get_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2639{
2640 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2641 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2642 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2643 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2643( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2644
2645 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2646 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2647 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2648 if (objIsXray) {
2649 unwrappedObj.emplace(cx, obj);
2650 }
2651 if (objIsXray) {
2652 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2653 // we know Xrays have no dynamic unwrap behavior.
2654 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2655 if (!unwrappedObj.ref()) {
2656 return false;
2657 }
2658 }
2659 FastErrorResult rv;
2660 uint8_t result(MOZ_KnownLive(self)(self)->GetWritableOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2661 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"
)), 0))
) {
2662 return false;
2663 }
2664 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2664); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2664); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2665 args.rval().setInt32(int32_t(result));
2666 return true;
2667}
2668
2669MOZ_CAN_RUN_SCRIPT static bool
2670set_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2671{
2672 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2675( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2673 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2675( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2674 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2675( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2675 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2675( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2676
2677 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2678 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2679 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2680 if (objIsXray) {
2681 unwrappedObj.emplace(cx, obj);
2682 }
2683 uint8_t arg0;
2684 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2685 return false;
2686 }
2687 if (objIsXray) {
2688 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2689 // we know Xrays have no dynamic unwrap behavior.
2690 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2691 if (!unwrappedObj.ref()) {
2692 return false;
2693 }
2694 }
2695 FastErrorResult rv;
2696 // NOTE: This assert does NOT call the function.
2697 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");
2698 MOZ_KnownLive(self)(self)->SetWritableOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2699 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"
)), 0))
) {
2700 return false;
2701 }
2702 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2702); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2702); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2703
2704 return true;
2705}
2706
2707static const JSJitInfo writableOctet_getterinfo = {
2708 { get_writableOctet },
2709 { prototypes::id::TestJSImplInterface },
2710 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2711 JSJitInfo::Getter,
2712 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2713 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2714 false, /* isInfallible. False in setters. */
2715 false, /* isMovable. Not relevant for setters. */
2716 false, /* isEliminatable. Not relevant for setters. */
2717 false, /* isAlwaysInSlot. Only relevant for getters. */
2718 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2719 false, /* isTypedMethod. Only relevant for methods. */
2720 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2721};
2722static const JSJitInfo writableOctet_setterinfo = {
2723 { (JSJitGetterOp)set_writableOctet },
2724 { prototypes::id::TestJSImplInterface },
2725 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2726 JSJitInfo::Setter,
2727 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2728 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2729 false, /* isInfallible. False in setters. */
2730 false, /* isMovable. Not relevant for setters. */
2731 false, /* isEliminatable. Not relevant for setters. */
2732 false, /* isAlwaysInSlot. Only relevant for getters. */
2733 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2734 false, /* isTypedMethod. Only relevant for methods. */
2735 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2736};
2737
2738MOZ_CAN_RUN_SCRIPT static bool
2739passOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2740{
2741 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2744( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2742 "TestJSImplInterface", "passOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2744( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2743 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2744( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2744 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2744( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
2745
2746 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2747 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOctet", 1)) {
2748 return false;
2749 }
2750 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2751 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2752 if (objIsXray) {
2753 unwrappedObj.emplace(cx, obj);
2754 }
2755 uint8_t arg0;
2756 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2757 return false;
2758 }
2759 if (objIsXray) {
2760 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2761 // we know Xrays have no dynamic unwrap behavior.
2762 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2763 if (!unwrappedObj.ref()) {
2764 return false;
2765 }
2766 }
2767 FastErrorResult rv;
2768 // NOTE: This assert does NOT call the function.
2769 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");
2770 MOZ_KnownLive(self)(self)->PassOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2771 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"
)), 0))
) {
2772 return false;
2773 }
2774 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2774); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2774); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2775 args.rval().setUndefined();
2776 return true;
2777}
2778
2779static const JSJitInfo passOctet_methodinfo = {
2780 { (JSJitGetterOp)passOctet },
2781 { prototypes::id::TestJSImplInterface },
2782 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2783 JSJitInfo::Method,
2784 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2785 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2786 false, /* isInfallible. False in setters. */
2787 false, /* isMovable. Not relevant for setters. */
2788 false, /* isEliminatable. Not relevant for setters. */
2789 false, /* isAlwaysInSlot. Only relevant for getters. */
2790 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2791 false, /* isTypedMethod. Only relevant for methods. */
2792 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2793};
2794
2795MOZ_CAN_RUN_SCRIPT static bool
2796receiveOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2797{
2798 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2799 "TestJSImplInterface", "receiveOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2800 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2801 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2801( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2802
2803 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2804 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2805 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2806 if (objIsXray) {
2807 unwrappedObj.emplace(cx, obj);
2808 }
2809 if (objIsXray) {
2810 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2811 // we know Xrays have no dynamic unwrap behavior.
2812 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2813 if (!unwrappedObj.ref()) {
2814 return false;
2815 }
2816 }
2817 FastErrorResult rv;
2818 uint8_t result(MOZ_KnownLive(self)(self)->ReceiveOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2819 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"
)), 0))
) {
2820 return false;
2821 }
2822 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2822); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2822); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2823 args.rval().setInt32(int32_t(result));
2824 return true;
2825}
2826
2827static const JSJitInfo receiveOctet_methodinfo = {
2828 { (JSJitGetterOp)receiveOctet },
2829 { prototypes::id::TestJSImplInterface },
2830 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2831 JSJitInfo::Method,
2832 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2833 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2834 false, /* isInfallible. False in setters. */
2835 false, /* isMovable. Not relevant for setters. */
2836 false, /* isEliminatable. Not relevant for setters. */
2837 false, /* isAlwaysInSlot. Only relevant for getters. */
2838 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2839 false, /* isTypedMethod. Only relevant for methods. */
2840 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2841};
2842
2843MOZ_CAN_RUN_SCRIPT static bool
2844passOptionalOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2845{
2846 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2849( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2847 "TestJSImplInterface", "passOptionalOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2849( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2848 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2849( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2849 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2849( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2850
2851 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2852 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2853 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2854 if (objIsXray) {
2855 unwrappedObj.emplace(cx, obj);
2856 }
2857 Optional<uint8_t> arg0;
2858 if (args.hasDefined(0)) {
2859 arg0.Construct();
2860 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2861 return false;
2862 }
2863 }
2864 if (objIsXray) {
2865 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2866 // we know Xrays have no dynamic unwrap behavior.
2867 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2868 if (!unwrappedObj.ref()) {
2869 return false;
2870 }
2871 }
2872 FastErrorResult rv;
2873 // NOTE: This assert does NOT call the function.
2874 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");
2875 MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2876 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"
)), 0))
) {
2877 return false;
2878 }
2879 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2879); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2880 args.rval().setUndefined();
2881 return true;
2882}
2883
2884static const JSJitInfo passOptionalOctet_methodinfo = {
2885 { (JSJitGetterOp)passOptionalOctet },
2886 { prototypes::id::TestJSImplInterface },
2887 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2888 JSJitInfo::Method,
2889 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2890 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2891 false, /* isInfallible. False in setters. */
2892 false, /* isMovable. Not relevant for setters. */
2893 false, /* isEliminatable. Not relevant for setters. */
2894 false, /* isAlwaysInSlot. Only relevant for getters. */
2895 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2896 false, /* isTypedMethod. Only relevant for methods. */
2897 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2898};
2899
2900MOZ_CAN_RUN_SCRIPT static bool
2901passOptionalOctetWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2902{
2903 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2906( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2904 "TestJSImplInterface", "passOptionalOctetWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2906( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2905 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2906( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2906 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2906( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2907
2908 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2909 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2910 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2911 if (objIsXray) {
2912 unwrappedObj.emplace(cx, obj);
2913 }
2914 uint8_t arg0;
2915 if (args.hasDefined(0)) {
2916 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2917 return false;
2918 }
2919 } else {
2920 arg0 = 19;
2921 }
2922 if (objIsXray) {
2923 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2924 // we know Xrays have no dynamic unwrap behavior.
2925 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2926 if (!unwrappedObj.ref()) {
2927 return false;
2928 }
2929 }
2930 FastErrorResult rv;
2931 // NOTE: This assert does NOT call the function.
2932 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");
2933 MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2934 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"
)), 0))
) {
2935 return false;
2936 }
2937 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2937); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2937); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2938 args.rval().setUndefined();
2939 return true;
2940}
2941
2942static const JSJitInfo passOptionalOctetWithDefault_methodinfo = {
2943 { (JSJitGetterOp)passOptionalOctetWithDefault },
2944 { prototypes::id::TestJSImplInterface },
2945 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2946 JSJitInfo::Method,
2947 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2948 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2949 false, /* isInfallible. False in setters. */
2950 false, /* isMovable. Not relevant for setters. */
2951 false, /* isEliminatable. Not relevant for setters. */
2952 false, /* isAlwaysInSlot. Only relevant for getters. */
2953 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2954 false, /* isTypedMethod. Only relevant for methods. */
2955 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2956};
2957
2958MOZ_CAN_RUN_SCRIPT static bool
2959get_readonlyUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2960{
2961 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2962 "TestJSImplInterface", "readonlyUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2963 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2964 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2964( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2965
2966 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2967 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2968 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2969 if (objIsXray) {
2970 unwrappedObj.emplace(cx, obj);
2971 }
2972 if (objIsXray) {
2973 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2974 // we know Xrays have no dynamic unwrap behavior.
2975 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2976 if (!unwrappedObj.ref()) {
2977 return false;
2978 }
2979 }
2980 FastErrorResult rv;
2981 uint16_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2982 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"
)), 0))
) {
2983 return false;
2984 }
2985 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2985); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 2985); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
2986 args.rval().setInt32(int32_t(result));
2987 return true;
2988}
2989
2990static const JSJitInfo readonlyUnsignedShort_getterinfo = {
2991 { get_readonlyUnsignedShort },
2992 { prototypes::id::TestJSImplInterface },
2993 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2994 JSJitInfo::Getter,
2995 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2996 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2997 false, /* isInfallible. False in setters. */
2998 false, /* isMovable. Not relevant for setters. */
2999 false, /* isEliminatable. Not relevant for setters. */
3000 false, /* isAlwaysInSlot. Only relevant for getters. */
3001 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3002 false, /* isTypedMethod. Only relevant for methods. */
3003 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3004};
3005
3006MOZ_CAN_RUN_SCRIPT static bool
3007get_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3008{
3009 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3012( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3010 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3012( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3011 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3012( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3012 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3012( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3013
3014 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3015 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3016 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3017 if (objIsXray) {
3018 unwrappedObj.emplace(cx, obj);
3019 }
3020 if (objIsXray) {
3021 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3022 // we know Xrays have no dynamic unwrap behavior.
3023 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3024 if (!unwrappedObj.ref()) {
3025 return false;
3026 }
3027 }
3028 FastErrorResult rv;
3029 uint16_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3030 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"
)), 0))
) {
3031 return false;
3032 }
3033 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3033); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3033); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3034 args.rval().setInt32(int32_t(result));
3035 return true;
3036}
3037
3038MOZ_CAN_RUN_SCRIPT static bool
3039set_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3040{
3041 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3044( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3042 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3044( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3043 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3044( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3044 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3044( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3045
3046 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3047 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3048 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3049 if (objIsXray) {
3050 unwrappedObj.emplace(cx, obj);
3051 }
3052 uint16_t arg0;
3053 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3054 return false;
3055 }
3056 if (objIsXray) {
3057 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3058 // we know Xrays have no dynamic unwrap behavior.
3059 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3060 if (!unwrappedObj.ref()) {
3061 return false;
3062 }
3063 }
3064 FastErrorResult rv;
3065 // NOTE: This assert does NOT call the function.
3066 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");
3067 MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3068 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"
)), 0))
) {
3069 return false;
3070 }
3071 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3071); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3071); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3072
3073 return true;
3074}
3075
3076static const JSJitInfo writableUnsignedShort_getterinfo = {
3077 { get_writableUnsignedShort },
3078 { prototypes::id::TestJSImplInterface },
3079 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3080 JSJitInfo::Getter,
3081 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3082 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3083 false, /* isInfallible. False in setters. */
3084 false, /* isMovable. Not relevant for setters. */
3085 false, /* isEliminatable. Not relevant for setters. */
3086 false, /* isAlwaysInSlot. Only relevant for getters. */
3087 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3088 false, /* isTypedMethod. Only relevant for methods. */
3089 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3090};
3091static const JSJitInfo writableUnsignedShort_setterinfo = {
3092 { (JSJitGetterOp)set_writableUnsignedShort },
3093 { prototypes::id::TestJSImplInterface },
3094 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3095 JSJitInfo::Setter,
3096 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3097 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3098 false, /* isInfallible. False in setters. */
3099 false, /* isMovable. Not relevant for setters. */
3100 false, /* isEliminatable. Not relevant for setters. */
3101 false, /* isAlwaysInSlot. Only relevant for getters. */
3102 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3103 false, /* isTypedMethod. Only relevant for methods. */
3104 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3105};
3106
3107MOZ_CAN_RUN_SCRIPT static bool
3108passUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3109{
3110 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3113( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3111 "TestJSImplInterface", "passUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3113( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3112 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3113( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3113 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3113( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3114
3115 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3116 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedShort", 1)) {
3117 return false;
3118 }
3119 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3120 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3121 if (objIsXray) {
3122 unwrappedObj.emplace(cx, obj);
3123 }
3124 uint16_t arg0;
3125 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3126 return false;
3127 }
3128 if (objIsXray) {
3129 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3130 // we know Xrays have no dynamic unwrap behavior.
3131 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3132 if (!unwrappedObj.ref()) {
3133 return false;
3134 }
3135 }
3136 FastErrorResult rv;
3137 // NOTE: This assert does NOT call the function.
3138 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");
3139 MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3140 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"
)), 0))
) {
3141 return false;
3142 }
3143 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3143); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3143); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3144 args.rval().setUndefined();
3145 return true;
3146}
3147
3148static const JSJitInfo passUnsignedShort_methodinfo = {
3149 { (JSJitGetterOp)passUnsignedShort },
3150 { prototypes::id::TestJSImplInterface },
3151 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3152 JSJitInfo::Method,
3153 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3154 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3155 false, /* isInfallible. False in setters. */
3156 false, /* isMovable. Not relevant for setters. */
3157 false, /* isEliminatable. Not relevant for setters. */
3158 false, /* isAlwaysInSlot. Only relevant for getters. */
3159 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3160 false, /* isTypedMethod. Only relevant for methods. */
3161 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3162};
3163
3164MOZ_CAN_RUN_SCRIPT static bool
3165receiveUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3166{
3167 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3170( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3168 "TestJSImplInterface", "receiveUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3170( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3169 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3170( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3170 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3170( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3171
3172 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3173 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3174 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3175 if (objIsXray) {
3176 unwrappedObj.emplace(cx, obj);
3177 }
3178 if (objIsXray) {
3179 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3180 // we know Xrays have no dynamic unwrap behavior.
3181 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3182 if (!unwrappedObj.ref()) {
3183 return false;
3184 }
3185 }
3186 FastErrorResult rv;
3187 uint16_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3188 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"
)), 0))
) {
3189 return false;
3190 }
3191 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3191); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3191); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3192 args.rval().setInt32(int32_t(result));
3193 return true;
3194}
3195
3196static const JSJitInfo receiveUnsignedShort_methodinfo = {
3197 { (JSJitGetterOp)receiveUnsignedShort },
3198 { prototypes::id::TestJSImplInterface },
3199 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3200 JSJitInfo::Method,
3201 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3202 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3203 false, /* isInfallible. False in setters. */
3204 false, /* isMovable. Not relevant for setters. */
3205 false, /* isEliminatable. Not relevant for setters. */
3206 false, /* isAlwaysInSlot. Only relevant for getters. */
3207 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3208 false, /* isTypedMethod. Only relevant for methods. */
3209 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3210};
3211
3212MOZ_CAN_RUN_SCRIPT static bool
3213passOptionalUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3214{
3215 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3218( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3216 "TestJSImplInterface", "passOptionalUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3218( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3217 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3218( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3218 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3218( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3219
3220 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3221 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3222 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3223 if (objIsXray) {
3224 unwrappedObj.emplace(cx, obj);
3225 }
3226 Optional<uint16_t> arg0;
3227 if (args.hasDefined(0)) {
3228 arg0.Construct();
3229 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3230 return false;
3231 }
3232 }
3233 if (objIsXray) {
3234 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3235 // we know Xrays have no dynamic unwrap behavior.
3236 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3237 if (!unwrappedObj.ref()) {
3238 return false;
3239 }
3240 }
3241 FastErrorResult rv;
3242 // NOTE: This assert does NOT call the function.
3243 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");
3244 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3245 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"
)), 0))
) {
3246 return false;
3247 }
3248 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3248); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3249 args.rval().setUndefined();
3250 return true;
3251}
3252
3253static const JSJitInfo passOptionalUnsignedShort_methodinfo = {
3254 { (JSJitGetterOp)passOptionalUnsignedShort },
3255 { prototypes::id::TestJSImplInterface },
3256 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3257 JSJitInfo::Method,
3258 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3259 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3260 false, /* isInfallible. False in setters. */
3261 false, /* isMovable. Not relevant for setters. */
3262 false, /* isEliminatable. Not relevant for setters. */
3263 false, /* isAlwaysInSlot. Only relevant for getters. */
3264 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3265 false, /* isTypedMethod. Only relevant for methods. */
3266 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3267};
3268
3269MOZ_CAN_RUN_SCRIPT static bool
3270passOptionalUnsignedShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3271{
3272 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3275( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3273 "TestJSImplInterface", "passOptionalUnsignedShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3275( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3274 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3275( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3275 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3275( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3276
3277 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3278 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3279 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3280 if (objIsXray) {
3281 unwrappedObj.emplace(cx, obj);
3282 }
3283 uint16_t arg0;
3284 if (args.hasDefined(0)) {
3285 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3286 return false;
3287 }
3288 } else {
3289 arg0 = 2;
3290 }
3291 if (objIsXray) {
3292 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3293 // we know Xrays have no dynamic unwrap behavior.
3294 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3295 if (!unwrappedObj.ref()) {
3296 return false;
3297 }
3298 }
3299 FastErrorResult rv;
3300 // NOTE: This assert does NOT call the function.
3301 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");
3302 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3303 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"
)), 0))
) {
3304 return false;
3305 }
3306 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3306); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3306); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3307 args.rval().setUndefined();
3308 return true;
3309}
3310
3311static const JSJitInfo passOptionalUnsignedShortWithDefault_methodinfo = {
3312 { (JSJitGetterOp)passOptionalUnsignedShortWithDefault },
3313 { prototypes::id::TestJSImplInterface },
3314 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3315 JSJitInfo::Method,
3316 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3317 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3318 false, /* isInfallible. False in setters. */
3319 false, /* isMovable. Not relevant for setters. */
3320 false, /* isEliminatable. Not relevant for setters. */
3321 false, /* isAlwaysInSlot. Only relevant for getters. */
3322 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3323 false, /* isTypedMethod. Only relevant for methods. */
3324 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3325};
3326
3327MOZ_CAN_RUN_SCRIPT static bool
3328get_readonlyUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3329{
3330 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3333( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3331 "TestJSImplInterface", "readonlyUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3333( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3332 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3333( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3333 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3333( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3334
3335 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3336 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3337 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3338 if (objIsXray) {
3339 unwrappedObj.emplace(cx, obj);
3340 }
3341 if (objIsXray) {
3342 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3343 // we know Xrays have no dynamic unwrap behavior.
3344 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3345 if (!unwrappedObj.ref()) {
3346 return false;
3347 }
3348 }
3349 FastErrorResult rv;
3350 uint32_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3351 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"
)), 0))
) {
3352 return false;
3353 }
3354 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3354); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3354); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3355 args.rval().setNumber(result);
3356 return true;
3357}
3358
3359static const JSJitInfo readonlyUnsignedLong_getterinfo = {
3360 { get_readonlyUnsignedLong },
3361 { prototypes::id::TestJSImplInterface },
3362 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3363 JSJitInfo::Getter,
3364 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3365 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3366 false, /* isInfallible. False in setters. */
3367 false, /* isMovable. Not relevant for setters. */
3368 false, /* isEliminatable. Not relevant for setters. */
3369 false, /* isAlwaysInSlot. Only relevant for getters. */
3370 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3371 false, /* isTypedMethod. Only relevant for methods. */
3372 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3373};
3374
3375MOZ_CAN_RUN_SCRIPT static bool
3376get_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3377{
3378 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3381( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3379 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3381( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3380 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3381( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3381 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3381( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3382
3383 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3384 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3385 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3386 if (objIsXray) {
3387 unwrappedObj.emplace(cx, obj);
3388 }
3389 if (objIsXray) {
3390 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3391 // we know Xrays have no dynamic unwrap behavior.
3392 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3393 if (!unwrappedObj.ref()) {
3394 return false;
3395 }
3396 }
3397 FastErrorResult rv;
3398 uint32_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3399 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"
)), 0))
) {
3400 return false;
3401 }
3402 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3402); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3402); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3403 args.rval().setNumber(result);
3404 return true;
3405}
3406
3407MOZ_CAN_RUN_SCRIPT static bool
3408set_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3409{
3410 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3413( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3411 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3413( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3412 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3413( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3413 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3413( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3414
3415 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3416 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3417 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3418 if (objIsXray) {
3419 unwrappedObj.emplace(cx, obj);
3420 }
3421 uint32_t arg0;
3422 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3423 return false;
3424 }
3425 if (objIsXray) {
3426 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3427 // we know Xrays have no dynamic unwrap behavior.
3428 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3429 if (!unwrappedObj.ref()) {
3430 return false;
3431 }
3432 }
3433 FastErrorResult rv;
3434 // NOTE: This assert does NOT call the function.
3435 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");
3436 MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3437 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"
)), 0))
) {
3438 return false;
3439 }
3440 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3440); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3440); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3441
3442 return true;
3443}
3444
3445static const JSJitInfo writableUnsignedLong_getterinfo = {
3446 { get_writableUnsignedLong },
3447 { prototypes::id::TestJSImplInterface },
3448 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3449 JSJitInfo::Getter,
3450 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3451 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3452 false, /* isInfallible. False in setters. */
3453 false, /* isMovable. Not relevant for setters. */
3454 false, /* isEliminatable. Not relevant for setters. */
3455 false, /* isAlwaysInSlot. Only relevant for getters. */
3456 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3457 false, /* isTypedMethod. Only relevant for methods. */
3458 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3459};
3460static const JSJitInfo writableUnsignedLong_setterinfo = {
3461 { (JSJitGetterOp)set_writableUnsignedLong },
3462 { prototypes::id::TestJSImplInterface },
3463 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3464 JSJitInfo::Setter,
3465 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3466 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3467 false, /* isInfallible. False in setters. */
3468 false, /* isMovable. Not relevant for setters. */
3469 false, /* isEliminatable. Not relevant for setters. */
3470 false, /* isAlwaysInSlot. Only relevant for getters. */
3471 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3472 false, /* isTypedMethod. Only relevant for methods. */
3473 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3474};
3475
3476MOZ_CAN_RUN_SCRIPT static bool
3477passUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3478{
3479 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3482( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3480 "TestJSImplInterface", "passUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3482( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3481 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3482( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3482 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3482( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3483
3484 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3485 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLong", 1)) {
3486 return false;
3487 }
3488 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3489 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3490 if (objIsXray) {
3491 unwrappedObj.emplace(cx, obj);
3492 }
3493 uint32_t arg0;
3494 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3495 return false;
3496 }
3497 if (objIsXray) {
3498 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3499 // we know Xrays have no dynamic unwrap behavior.
3500 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3501 if (!unwrappedObj.ref()) {
3502 return false;
3503 }
3504 }
3505 FastErrorResult rv;
3506 // NOTE: This assert does NOT call the function.
3507 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");
3508 MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3509 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"
)), 0))
) {
3510 return false;
3511 }
3512 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3512); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3513 args.rval().setUndefined();
3514 return true;
3515}
3516
3517static const JSJitInfo passUnsignedLong_methodinfo = {
3518 { (JSJitGetterOp)passUnsignedLong },
3519 { prototypes::id::TestJSImplInterface },
3520 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3521 JSJitInfo::Method,
3522 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3523 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3524 false, /* isInfallible. False in setters. */
3525 false, /* isMovable. Not relevant for setters. */
3526 false, /* isEliminatable. Not relevant for setters. */
3527 false, /* isAlwaysInSlot. Only relevant for getters. */
3528 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3529 false, /* isTypedMethod. Only relevant for methods. */
3530 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3531};
3532
3533MOZ_CAN_RUN_SCRIPT static bool
3534receiveUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3535{
3536 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3539( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3537 "TestJSImplInterface", "receiveUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3539( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3538 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3539( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3539 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3539( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3540
3541 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3542 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3543 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3544 if (objIsXray) {
3545 unwrappedObj.emplace(cx, obj);
3546 }
3547 if (objIsXray) {
3548 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3549 // we know Xrays have no dynamic unwrap behavior.
3550 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3551 if (!unwrappedObj.ref()) {
3552 return false;
3553 }
3554 }
3555 FastErrorResult rv;
3556 uint32_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3557 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"
)), 0))
) {
3558 return false;
3559 }
3560 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3560); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3560); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3561 args.rval().setNumber(result);
3562 return true;
3563}
3564
3565static const JSJitInfo receiveUnsignedLong_methodinfo = {
3566 { (JSJitGetterOp)receiveUnsignedLong },
3567 { prototypes::id::TestJSImplInterface },
3568 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3569 JSJitInfo::Method,
3570 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3571 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3572 false, /* isInfallible. False in setters. */
3573 false, /* isMovable. Not relevant for setters. */
3574 false, /* isEliminatable. Not relevant for setters. */
3575 false, /* isAlwaysInSlot. Only relevant for getters. */
3576 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3577 false, /* isTypedMethod. Only relevant for methods. */
3578 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3579};
3580
3581MOZ_CAN_RUN_SCRIPT static bool
3582passOptionalUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3583{
3584 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3587( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3585 "TestJSImplInterface", "passOptionalUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3587( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3586 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3587( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3587 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3587( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3588
3589 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3590 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3591 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3592 if (objIsXray) {
3593 unwrappedObj.emplace(cx, obj);
3594 }
3595 Optional<uint32_t> arg0;
3596 if (args.hasDefined(0)) {
3597 arg0.Construct();
3598 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3599 return false;
3600 }
3601 }
3602 if (objIsXray) {
3603 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3604 // we know Xrays have no dynamic unwrap behavior.
3605 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3606 if (!unwrappedObj.ref()) {
3607 return false;
3608 }
3609 }
3610 FastErrorResult rv;
3611 // NOTE: This assert does NOT call the function.
3612 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");
3613 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3614 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"
)), 0))
) {
3615 return false;
3616 }
3617 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3617); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3617); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3618 args.rval().setUndefined();
3619 return true;
3620}
3621
3622static const JSJitInfo passOptionalUnsignedLong_methodinfo = {
3623 { (JSJitGetterOp)passOptionalUnsignedLong },
3624 { prototypes::id::TestJSImplInterface },
3625 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3626 JSJitInfo::Method,
3627 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3628 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3629 false, /* isInfallible. False in setters. */
3630 false, /* isMovable. Not relevant for setters. */
3631 false, /* isEliminatable. Not relevant for setters. */
3632 false, /* isAlwaysInSlot. Only relevant for getters. */
3633 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3634 false, /* isTypedMethod. Only relevant for methods. */
3635 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3636};
3637
3638MOZ_CAN_RUN_SCRIPT static bool
3639passOptionalUnsignedLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3640{
3641 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3644( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3642 "TestJSImplInterface", "passOptionalUnsignedLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3644( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3643 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3644( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3644 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3644( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3645
3646 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3647 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3648 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3649 if (objIsXray) {
3650 unwrappedObj.emplace(cx, obj);
3651 }
3652 uint32_t arg0;
3653 if (args.hasDefined(0)) {
3654 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3655 return false;
3656 }
3657 } else {
3658 arg0 = 6U;
3659 }
3660 if (objIsXray) {
3661 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3662 // we know Xrays have no dynamic unwrap behavior.
3663 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3664 if (!unwrappedObj.ref()) {
3665 return false;
3666 }
3667 }
3668 FastErrorResult rv;
3669 // NOTE: This assert does NOT call the function.
3670 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");
3671 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3672 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"
)), 0))
) {
3673 return false;
3674 }
3675 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3675); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3675); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3676 args.rval().setUndefined();
3677 return true;
3678}
3679
3680static const JSJitInfo passOptionalUnsignedLongWithDefault_methodinfo = {
3681 { (JSJitGetterOp)passOptionalUnsignedLongWithDefault },
3682 { prototypes::id::TestJSImplInterface },
3683 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3684 JSJitInfo::Method,
3685 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3686 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3687 false, /* isInfallible. False in setters. */
3688 false, /* isMovable. Not relevant for setters. */
3689 false, /* isEliminatable. Not relevant for setters. */
3690 false, /* isAlwaysInSlot. Only relevant for getters. */
3691 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3692 false, /* isTypedMethod. Only relevant for methods. */
3693 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3694};
3695
3696MOZ_CAN_RUN_SCRIPT static bool
3697get_readonlyUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3698{
3699 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3702( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3700 "TestJSImplInterface", "readonlyUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3702( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3701 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3702( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3702 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3702( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3703
3704 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3705 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3706 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3707 if (objIsXray) {
3708 unwrappedObj.emplace(cx, obj);
3709 }
3710 if (objIsXray) {
3711 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3712 // we know Xrays have no dynamic unwrap behavior.
3713 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3714 if (!unwrappedObj.ref()) {
3715 return false;
3716 }
3717 }
3718 FastErrorResult rv;
3719 uint64_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3720 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"
)), 0))
) {
3721 return false;
3722 }
3723 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3723); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3723); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3724 args.rval().set(JS_NumberValue(double(result)));
3725 return true;
3726}
3727
3728static const JSJitInfo readonlyUnsignedLongLong_getterinfo = {
3729 { get_readonlyUnsignedLongLong },
3730 { prototypes::id::TestJSImplInterface },
3731 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3732 JSJitInfo::Getter,
3733 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3734 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3735 false, /* isInfallible. False in setters. */
3736 false, /* isMovable. Not relevant for setters. */
3737 false, /* isEliminatable. Not relevant for setters. */
3738 false, /* isAlwaysInSlot. Only relevant for getters. */
3739 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3740 false, /* isTypedMethod. Only relevant for methods. */
3741 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3742};
3743
3744MOZ_CAN_RUN_SCRIPT static bool
3745get_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3746{
3747 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3750( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3748 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3750( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3749 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3750( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3750 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3750( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3751
3752 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3753 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3754 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3755 if (objIsXray) {
3756 unwrappedObj.emplace(cx, obj);
3757 }
3758 if (objIsXray) {
3759 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3760 // we know Xrays have no dynamic unwrap behavior.
3761 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3762 if (!unwrappedObj.ref()) {
3763 return false;
3764 }
3765 }
3766 FastErrorResult rv;
3767 uint64_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3768 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"
)), 0))
) {
3769 return false;
3770 }
3771 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3771); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3771); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3772 args.rval().set(JS_NumberValue(double(result)));
3773 return true;
3774}
3775
3776MOZ_CAN_RUN_SCRIPT static bool
3777set_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3778{
3779 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3782( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3780 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3782( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3781 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3782( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3782 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3782( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3783
3784 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3785 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3786 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3787 if (objIsXray) {
3788 unwrappedObj.emplace(cx, obj);
3789 }
3790 uint64_t arg0;
3791 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3792 return false;
3793 }
3794 if (objIsXray) {
3795 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3796 // we know Xrays have no dynamic unwrap behavior.
3797 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3798 if (!unwrappedObj.ref()) {
3799 return false;
3800 }
3801 }
3802 FastErrorResult rv;
3803 // NOTE: This assert does NOT call the function.
3804 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");
3805 MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3806 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"
)), 0))
) {
3807 return false;
3808 }
3809 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3809); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3809); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3810
3811 return true;
3812}
3813
3814static const JSJitInfo writableUnsignedLongLong_getterinfo = {
3815 { get_writableUnsignedLongLong },
3816 { prototypes::id::TestJSImplInterface },
3817 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3818 JSJitInfo::Getter,
3819 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3820 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3821 false, /* isInfallible. False in setters. */
3822 false, /* isMovable. Not relevant for setters. */
3823 false, /* isEliminatable. Not relevant for setters. */
3824 false, /* isAlwaysInSlot. Only relevant for getters. */
3825 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3826 false, /* isTypedMethod. Only relevant for methods. */
3827 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3828};
3829static const JSJitInfo writableUnsignedLongLong_setterinfo = {
3830 { (JSJitGetterOp)set_writableUnsignedLongLong },
3831 { prototypes::id::TestJSImplInterface },
3832 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3833 JSJitInfo::Setter,
3834 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3835 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3836 false, /* isInfallible. False in setters. */
3837 false, /* isMovable. Not relevant for setters. */
3838 false, /* isEliminatable. Not relevant for setters. */
3839 false, /* isAlwaysInSlot. Only relevant for getters. */
3840 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3841 false, /* isTypedMethod. Only relevant for methods. */
3842 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3843};
3844
3845MOZ_CAN_RUN_SCRIPT static bool
3846passUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3847{
3848 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3851( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3849 "TestJSImplInterface", "passUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3851( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3850 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3851( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3851 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3851( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3852
3853 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3854 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLongLong", 1)) {
3855 return false;
3856 }
3857 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3858 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3859 if (objIsXray) {
3860 unwrappedObj.emplace(cx, obj);
3861 }
3862 uint64_t arg0;
3863 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3864 return false;
3865 }
3866 if (objIsXray) {
3867 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3868 // we know Xrays have no dynamic unwrap behavior.
3869 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3870 if (!unwrappedObj.ref()) {
3871 return false;
3872 }
3873 }
3874 FastErrorResult rv;
3875 // NOTE: This assert does NOT call the function.
3876 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");
3877 MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3878 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"
)), 0))
) {
3879 return false;
3880 }
3881 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3881); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3881); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3882 args.rval().setUndefined();
3883 return true;
3884}
3885
3886static const JSJitInfo passUnsignedLongLong_methodinfo = {
3887 { (JSJitGetterOp)passUnsignedLongLong },
3888 { prototypes::id::TestJSImplInterface },
3889 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3890 JSJitInfo::Method,
3891 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3892 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3893 false, /* isInfallible. False in setters. */
3894 false, /* isMovable. Not relevant for setters. */
3895 false, /* isEliminatable. Not relevant for setters. */
3896 false, /* isAlwaysInSlot. Only relevant for getters. */
3897 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3898 false, /* isTypedMethod. Only relevant for methods. */
3899 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3900};
3901
3902MOZ_CAN_RUN_SCRIPT static bool
3903receiveUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3904{
3905 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3908( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3906 "TestJSImplInterface", "receiveUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3908( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3907 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3908( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3908 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3908( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3909
3910 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3911 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3912 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3913 if (objIsXray) {
3914 unwrappedObj.emplace(cx, obj);
3915 }
3916 if (objIsXray) {
3917 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3918 // we know Xrays have no dynamic unwrap behavior.
3919 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3920 if (!unwrappedObj.ref()) {
3921 return false;
3922 }
3923 }
3924 FastErrorResult rv;
3925 uint64_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3926 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"
)), 0))
) {
3927 return false;
3928 }
3929 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3929); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3929); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3930 args.rval().set(JS_NumberValue(double(result)));
3931 return true;
3932}
3933
3934static const JSJitInfo receiveUnsignedLongLong_methodinfo = {
3935 { (JSJitGetterOp)receiveUnsignedLongLong },
3936 { prototypes::id::TestJSImplInterface },
3937 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3938 JSJitInfo::Method,
3939 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3940 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3941 false, /* isInfallible. False in setters. */
3942 false, /* isMovable. Not relevant for setters. */
3943 false, /* isEliminatable. Not relevant for setters. */
3944 false, /* isAlwaysInSlot. Only relevant for getters. */
3945 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3946 false, /* isTypedMethod. Only relevant for methods. */
3947 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3948};
3949
3950MOZ_CAN_RUN_SCRIPT static bool
3951passOptionalUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3952{
3953 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3956( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3954 "TestJSImplInterface", "passOptionalUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3956( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3955 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3956( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3956 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3956( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3957
3958 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3959 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3960 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3961 if (objIsXray) {
3962 unwrappedObj.emplace(cx, obj);
3963 }
3964 Optional<uint64_t> arg0;
3965 if (args.hasDefined(0)) {
3966 arg0.Construct();
3967 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3968 return false;
3969 }
3970 }
3971 if (objIsXray) {
3972 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3973 // we know Xrays have no dynamic unwrap behavior.
3974 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3975 if (!unwrappedObj.ref()) {
3976 return false;
3977 }
3978 }
3979 FastErrorResult rv;
3980 // NOTE: This assert does NOT call the function.
3981 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");
3982 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3983 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"
)), 0))
) {
3984 return false;
3985 }
3986 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3986); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 3986); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
3987 args.rval().setUndefined();
3988 return true;
3989}
3990
3991static const JSJitInfo passOptionalUnsignedLongLong_methodinfo = {
3992 { (JSJitGetterOp)passOptionalUnsignedLongLong },
3993 { prototypes::id::TestJSImplInterface },
3994 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3995 JSJitInfo::Method,
3996 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3997 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3998 false, /* isInfallible. False in setters. */
3999 false, /* isMovable. Not relevant for setters. */
4000 false, /* isEliminatable. Not relevant for setters. */
4001 false, /* isAlwaysInSlot. Only relevant for getters. */
4002 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4003 false, /* isTypedMethod. Only relevant for methods. */
4004 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4005};
4006
4007MOZ_CAN_RUN_SCRIPT static bool
4008passOptionalUnsignedLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
4009{
4010 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4013( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4011 "TestJSImplInterface", "passOptionalUnsignedLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4013( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4012 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4013( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4013 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4013( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4014
4015 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4016 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4017 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4018 if (objIsXray) {
4019 unwrappedObj.emplace(cx, obj);
4020 }
4021 uint64_t arg0;
4022 if (args.hasDefined(0)) {
4023 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
4024 return false;
4025 }
4026 } else {
4027 arg0 = 17ULL;
4028 }
4029 if (objIsXray) {
4030 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4031 // we know Xrays have no dynamic unwrap behavior.
4032 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4033 if (!unwrappedObj.ref()) {
4034 return false;
4035 }
4036 }
4037 FastErrorResult rv;
4038 // NOTE: This assert does NOT call the function.
4039 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");
4040 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4041 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"
)), 0))
) {
4042 return false;
4043 }
4044 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4044); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4044); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4045 args.rval().setUndefined();
4046 return true;
4047}
4048
4049static const JSJitInfo passOptionalUnsignedLongLongWithDefault_methodinfo = {
4050 { (JSJitGetterOp)passOptionalUnsignedLongLongWithDefault },
4051 { prototypes::id::TestJSImplInterface },
4052 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4053 JSJitInfo::Method,
4054 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4055 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4056 false, /* isInfallible. False in setters. */
4057 false, /* isMovable. Not relevant for setters. */
4058 false, /* isEliminatable. Not relevant for setters. */
4059 false, /* isAlwaysInSlot. Only relevant for getters. */
4060 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4061 false, /* isTypedMethod. Only relevant for methods. */
4062 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4063};
4064
4065MOZ_CAN_RUN_SCRIPT static bool
4066get_writableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4067{
4068 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4071( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4069 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4071( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4070 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4071( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4071 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4071( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4072
4073 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4074 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4075 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4076 if (objIsXray) {
4077 unwrappedObj.emplace(cx, obj);
4078 }
4079 if (objIsXray) {
4080 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4081 // we know Xrays have no dynamic unwrap behavior.
4082 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4083 if (!unwrappedObj.ref()) {
4084 return false;
4085 }
4086 }
4087 FastErrorResult rv;
4088 float result(MOZ_KnownLive(self)(self)->GetWritableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4089 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"
)), 0))
) {
4090 return false;
4091 }
4092 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4092); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4092); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4093 args.rval().set(JS_NumberValue(double(result)));
4094 return true;
4095}
4096
4097MOZ_CAN_RUN_SCRIPT static bool
4098set_writableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4099{
4100 BindingCallContext cx(cx_, "TestJSImplInterface.writableFloat setter");
4101 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4104( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4102 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4104( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4103 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4104( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4104 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4104( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4105
4106 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4109 if (objIsXray) {
4110 unwrappedObj.emplace(cx, obj);
4111 }
4112 float arg0;
4113 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4114 return false;
4115 } else if (!std::isfinite(arg0)) {
4116 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4117 return false;
4118 }
4119 if (objIsXray) {
4120 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4121 // we know Xrays have no dynamic unwrap behavior.
4122 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4123 if (!unwrappedObj.ref()) {
4124 return false;
4125 }
4126 }
4127 FastErrorResult rv;
4128 // NOTE: This assert does NOT call the function.
4129 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");
4130 MOZ_KnownLive(self)(self)->SetWritableFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4131 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"
)), 0))
) {
4132 return false;
4133 }
4134 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4134); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4134); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4135
4136 return true;
4137}
4138
4139static const JSJitInfo writableFloat_getterinfo = {
4140 { get_writableFloat },
4141 { prototypes::id::TestJSImplInterface },
4142 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4143 JSJitInfo::Getter,
4144 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4145 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4146 false, /* isInfallible. False in setters. */
4147 false, /* isMovable. Not relevant for setters. */
4148 false, /* isEliminatable. Not relevant for setters. */
4149 false, /* isAlwaysInSlot. Only relevant for getters. */
4150 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4151 false, /* isTypedMethod. Only relevant for methods. */
4152 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4153};
4154static const JSJitInfo writableFloat_setterinfo = {
4155 { (JSJitGetterOp)set_writableFloat },
4156 { prototypes::id::TestJSImplInterface },
4157 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4158 JSJitInfo::Setter,
4159 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4160 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4161 false, /* isInfallible. False in setters. */
4162 false, /* isMovable. Not relevant for setters. */
4163 false, /* isEliminatable. Not relevant for setters. */
4164 false, /* isAlwaysInSlot. Only relevant for getters. */
4165 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4166 false, /* isTypedMethod. Only relevant for methods. */
4167 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4168};
4169
4170MOZ_CAN_RUN_SCRIPT static bool
4171get_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4172{
4173 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4176( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4174 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4176( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4175 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4176( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4176 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4176( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4177
4178 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4179 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4180 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4181 if (objIsXray) {
4182 unwrappedObj.emplace(cx, obj);
4183 }
4184 if (objIsXray) {
4185 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4186 // we know Xrays have no dynamic unwrap behavior.
4187 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4188 if (!unwrappedObj.ref()) {
4189 return false;
4190 }
4191 }
4192 FastErrorResult rv;
4193 float result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4194 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"
)), 0))
) {
4195 return false;
4196 }
4197 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4197); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4197); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4198 args.rval().set(JS_NumberValue(double(result)));
4199 return true;
4200}
4201
4202MOZ_CAN_RUN_SCRIPT static bool
4203set_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4204{
4205 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4208( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4206 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4208( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4207 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4208( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4208 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4208( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4209
4210 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4211 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4212 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4213 if (objIsXray) {
4214 unwrappedObj.emplace(cx, obj);
4215 }
4216 float arg0;
4217 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4218 return false;
4219 }
4220 if (objIsXray) {
4221 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4222 // we know Xrays have no dynamic unwrap behavior.
4223 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4224 if (!unwrappedObj.ref()) {
4225 return false;
4226 }
4227 }
4228 FastErrorResult rv;
4229 // NOTE: This assert does NOT call the function.
4230 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");
4231 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4232 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"
)), 0))
) {
4233 return false;
4234 }
4235 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4235); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4235); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4236
4237 return true;
4238}
4239
4240static const JSJitInfo writableUnrestrictedFloat_getterinfo = {
4241 { get_writableUnrestrictedFloat },
4242 { prototypes::id::TestJSImplInterface },
4243 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4244 JSJitInfo::Getter,
4245 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4246 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4247 false, /* isInfallible. False in setters. */
4248 false, /* isMovable. Not relevant for setters. */
4249 false, /* isEliminatable. Not relevant for setters. */
4250 false, /* isAlwaysInSlot. Only relevant for getters. */
4251 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4252 false, /* isTypedMethod. Only relevant for methods. */
4253 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4254};
4255static const JSJitInfo writableUnrestrictedFloat_setterinfo = {
4256 { (JSJitGetterOp)set_writableUnrestrictedFloat },
4257 { prototypes::id::TestJSImplInterface },
4258 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4259 JSJitInfo::Setter,
4260 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4261 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4262 false, /* isInfallible. False in setters. */
4263 false, /* isMovable. Not relevant for setters. */
4264 false, /* isEliminatable. Not relevant for setters. */
4265 false, /* isAlwaysInSlot. Only relevant for getters. */
4266 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4267 false, /* isTypedMethod. Only relevant for methods. */
4268 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4269};
4270
4271MOZ_CAN_RUN_SCRIPT static bool
4272get_writableNullableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4273{
4274 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4277( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4275 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4277( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4276 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4277( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4277 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4277( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4278
4279 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4280 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4281 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4282 if (objIsXray) {
4283 unwrappedObj.emplace(cx, obj);
4284 }
4285 if (objIsXray) {
4286 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4287 // we know Xrays have no dynamic unwrap behavior.
4288 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4289 if (!unwrappedObj.ref()) {
4290 return false;
4291 }
4292 }
4293 FastErrorResult rv;
4294 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4295 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"
)), 0))
) {
4296 return false;
4297 }
4298 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4298); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4299 if (result.IsNull()) {
4300 args.rval().setNull();
4301 return true;
4302 }
4303 args.rval().set(JS_NumberValue(double(result.Value())));
4304 return true;
4305}
4306
4307MOZ_CAN_RUN_SCRIPT static bool
4308set_writableNullableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4309{
4310 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableFloat setter");
4311 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4314( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4312 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4314( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4313 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4314( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4314 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4314( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4315
4316 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4317 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4318 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4319 if (objIsXray) {
4320 unwrappedObj.emplace(cx, obj);
4321 }
4322 Nullable<float> arg0;
4323 if (args[0].isNullOrUndefined()) {
4324 arg0.SetNull();
4325 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4326 return false;
4327 } else if (!std::isfinite(arg0.Value())) {
4328 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4329 return false;
4330 }
4331 if (objIsXray) {
4332 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4333 // we know Xrays have no dynamic unwrap behavior.
4334 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4335 if (!unwrappedObj.ref()) {
4336 return false;
4337 }
4338 }
4339 FastErrorResult rv;
4340 // NOTE: This assert does NOT call the function.
4341 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");
4342 MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4343 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"
)), 0))
) {
4344 return false;
4345 }
4346 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4346); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4346); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4347
4348 return true;
4349}
4350
4351static const JSJitInfo writableNullableFloat_getterinfo = {
4352 { get_writableNullableFloat },
4353 { prototypes::id::TestJSImplInterface },
4354 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4355 JSJitInfo::Getter,
4356 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4357 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4358 false, /* isInfallible. False in setters. */
4359 false, /* isMovable. Not relevant for setters. */
4360 false, /* isEliminatable. Not relevant for setters. */
4361 false, /* isAlwaysInSlot. Only relevant for getters. */
4362 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4363 false, /* isTypedMethod. Only relevant for methods. */
4364 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4365};
4366static const JSJitInfo writableNullableFloat_setterinfo = {
4367 { (JSJitGetterOp)set_writableNullableFloat },
4368 { prototypes::id::TestJSImplInterface },
4369 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4370 JSJitInfo::Setter,
4371 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4372 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4373 false, /* isInfallible. False in setters. */
4374 false, /* isMovable. Not relevant for setters. */
4375 false, /* isEliminatable. Not relevant for setters. */
4376 false, /* isAlwaysInSlot. Only relevant for getters. */
4377 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4378 false, /* isTypedMethod. Only relevant for methods. */
4379 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4380};
4381
4382MOZ_CAN_RUN_SCRIPT static bool
4383get_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4384{
4385 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4388( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4386 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4388( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4387 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4388( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4388 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4388( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4389
4390 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4391 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4392 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4393 if (objIsXray) {
4394 unwrappedObj.emplace(cx, obj);
4395 }
4396 if (objIsXray) {
4397 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4398 // we know Xrays have no dynamic unwrap behavior.
4399 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4400 if (!unwrappedObj.ref()) {
4401 return false;
4402 }
4403 }
4404 FastErrorResult rv;
4405 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4406 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"
)), 0))
) {
4407 return false;
4408 }
4409 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4409); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4409); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4410 if (result.IsNull()) {
4411 args.rval().setNull();
4412 return true;
4413 }
4414 args.rval().set(JS_NumberValue(double(result.Value())));
4415 return true;
4416}
4417
4418MOZ_CAN_RUN_SCRIPT static bool
4419set_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4420{
4421 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4424( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4422 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4424( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4423 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4424( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4424 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4424( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4425
4426 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4427 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4428 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4429 if (objIsXray) {
4430 unwrappedObj.emplace(cx, obj);
4431 }
4432 Nullable<float> arg0;
4433 if (args[0].isNullOrUndefined()) {
4434 arg0.SetNull();
4435 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4436 return false;
4437 }
4438 if (objIsXray) {
4439 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4440 // we know Xrays have no dynamic unwrap behavior.
4441 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4442 if (!unwrappedObj.ref()) {
4443 return false;
4444 }
4445 }
4446 FastErrorResult rv;
4447 // NOTE: This assert does NOT call the function.
4448 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");
4449 MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4450 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"
)), 0))
) {
4451 return false;
4452 }
4453 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4453); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4453); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4454
4455 return true;
4456}
4457
4458static const JSJitInfo writableNullableUnrestrictedFloat_getterinfo = {
4459 { get_writableNullableUnrestrictedFloat },
4460 { prototypes::id::TestJSImplInterface },
4461 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4462 JSJitInfo::Getter,
4463 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4464 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4465 false, /* isInfallible. False in setters. */
4466 false, /* isMovable. Not relevant for setters. */
4467 false, /* isEliminatable. Not relevant for setters. */
4468 false, /* isAlwaysInSlot. Only relevant for getters. */
4469 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4470 false, /* isTypedMethod. Only relevant for methods. */
4471 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4472};
4473static const JSJitInfo writableNullableUnrestrictedFloat_setterinfo = {
4474 { (JSJitGetterOp)set_writableNullableUnrestrictedFloat },
4475 { prototypes::id::TestJSImplInterface },
4476 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4477 JSJitInfo::Setter,
4478 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4479 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4480 false, /* isInfallible. False in setters. */
4481 false, /* isMovable. Not relevant for setters. */
4482 false, /* isEliminatable. Not relevant for setters. */
4483 false, /* isAlwaysInSlot. Only relevant for getters. */
4484 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4485 false, /* isTypedMethod. Only relevant for methods. */
4486 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4487};
4488
4489MOZ_CAN_RUN_SCRIPT static bool
4490get_writableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4491{
4492 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4495( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4493 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4495( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4494 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4495( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4495 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4495( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4496
4497 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4498 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4499 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4500 if (objIsXray) {
4501 unwrappedObj.emplace(cx, obj);
4502 }
4503 if (objIsXray) {
4504 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4505 // we know Xrays have no dynamic unwrap behavior.
4506 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4507 if (!unwrappedObj.ref()) {
4508 return false;
4509 }
4510 }
4511 FastErrorResult rv;
4512 double result(MOZ_KnownLive(self)(self)->GetWritableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4513 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"
)), 0))
) {
4514 return false;
4515 }
4516 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4516); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4516); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4517 args.rval().set(JS_NumberValue(double(result)));
4518 return true;
4519}
4520
4521MOZ_CAN_RUN_SCRIPT static bool
4522set_writableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4523{
4524 BindingCallContext cx(cx_, "TestJSImplInterface.writableDouble setter");
4525 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4528( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4526 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4528( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4527 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4528( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4528 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4528( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4529
4530 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4531 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4532 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4533 if (objIsXray) {
4534 unwrappedObj.emplace(cx, obj);
4535 }
4536 double arg0;
4537 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4538 return false;
4539 } else if (!std::isfinite(arg0)) {
4540 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4541 return false;
4542 }
4543 if (objIsXray) {
4544 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4545 // we know Xrays have no dynamic unwrap behavior.
4546 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4547 if (!unwrappedObj.ref()) {
4548 return false;
4549 }
4550 }
4551 FastErrorResult rv;
4552 // NOTE: This assert does NOT call the function.
4553 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");
4554 MOZ_KnownLive(self)(self)->SetWritableDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4555 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"
)), 0))
) {
4556 return false;
4557 }
4558 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4558); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4558); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4559
4560 return true;
4561}
4562
4563static const JSJitInfo writableDouble_getterinfo = {
4564 { get_writableDouble },
4565 { prototypes::id::TestJSImplInterface },
4566 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4567 JSJitInfo::Getter,
4568 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4569 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4570 false, /* isInfallible. False in setters. */
4571 false, /* isMovable. Not relevant for setters. */
4572 false, /* isEliminatable. Not relevant for setters. */
4573 false, /* isAlwaysInSlot. Only relevant for getters. */
4574 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4575 false, /* isTypedMethod. Only relevant for methods. */
4576 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4577};
4578static const JSJitInfo writableDouble_setterinfo = {
4579 { (JSJitGetterOp)set_writableDouble },
4580 { prototypes::id::TestJSImplInterface },
4581 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4582 JSJitInfo::Setter,
4583 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4584 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4585 false, /* isInfallible. False in setters. */
4586 false, /* isMovable. Not relevant for setters. */
4587 false, /* isEliminatable. Not relevant for setters. */
4588 false, /* isAlwaysInSlot. Only relevant for getters. */
4589 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4590 false, /* isTypedMethod. Only relevant for methods. */
4591 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4592};
4593
4594MOZ_CAN_RUN_SCRIPT static bool
4595get_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4596{
4597 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4600( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4598 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4600( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4599 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4600( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4600 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4600( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4601
4602 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4603 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4604 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4605 if (objIsXray) {
4606 unwrappedObj.emplace(cx, obj);
4607 }
4608 if (objIsXray) {
4609 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4610 // we know Xrays have no dynamic unwrap behavior.
4611 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4612 if (!unwrappedObj.ref()) {
4613 return false;
4614 }
4615 }
4616 FastErrorResult rv;
4617 double result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4618 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"
)), 0))
) {
4619 return false;
4620 }
4621 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4621); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4621); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4622 args.rval().set(JS_NumberValue(double(result)));
4623 return true;
4624}
4625
4626MOZ_CAN_RUN_SCRIPT static bool
4627set_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4628{
4629 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4632( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4630 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4632( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4631 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4632( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4632 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4632( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4633
4634 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4635 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4636 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4637 if (objIsXray) {
4638 unwrappedObj.emplace(cx, obj);
4639 }
4640 double arg0;
4641 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4642 return false;
4643 }
4644 if (objIsXray) {
4645 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4646 // we know Xrays have no dynamic unwrap behavior.
4647 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4648 if (!unwrappedObj.ref()) {
4649 return false;
4650 }
4651 }
4652 FastErrorResult rv;
4653 // NOTE: This assert does NOT call the function.
4654 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");
4655 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4656 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"
)), 0))
) {
4657 return false;
4658 }
4659 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4659); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4659); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4660
4661 return true;
4662}
4663
4664static const JSJitInfo writableUnrestrictedDouble_getterinfo = {
4665 { get_writableUnrestrictedDouble },
4666 { prototypes::id::TestJSImplInterface },
4667 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4668 JSJitInfo::Getter,
4669 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4670 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4671 false, /* isInfallible. False in setters. */
4672 false, /* isMovable. Not relevant for setters. */
4673 false, /* isEliminatable. Not relevant for setters. */
4674 false, /* isAlwaysInSlot. Only relevant for getters. */
4675 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4676 false, /* isTypedMethod. Only relevant for methods. */
4677 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4678};
4679static const JSJitInfo writableUnrestrictedDouble_setterinfo = {
4680 { (JSJitGetterOp)set_writableUnrestrictedDouble },
4681 { prototypes::id::TestJSImplInterface },
4682 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4683 JSJitInfo::Setter,
4684 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4685 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4686 false, /* isInfallible. False in setters. */
4687 false, /* isMovable. Not relevant for setters. */
4688 false, /* isEliminatable. Not relevant for setters. */
4689 false, /* isAlwaysInSlot. Only relevant for getters. */
4690 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4691 false, /* isTypedMethod. Only relevant for methods. */
4692 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4693};
4694
4695MOZ_CAN_RUN_SCRIPT static bool
4696get_writableNullableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4697{
4698 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4699 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4700 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4701 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4701( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4702
4703 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4704 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4705 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4706 if (objIsXray) {
4707 unwrappedObj.emplace(cx, obj);
4708 }
4709 if (objIsXray) {
4710 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4711 // we know Xrays have no dynamic unwrap behavior.
4712 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4713 if (!unwrappedObj.ref()) {
4714 return false;
4715 }
4716 }
4717 FastErrorResult rv;
4718 Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4719 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"
)), 0))
) {
4720 return false;
4721 }
4722 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4722); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4722); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4723 if (result.IsNull()) {
4724 args.rval().setNull();
4725 return true;
4726 }
4727 args.rval().set(JS_NumberValue(double(result.Value())));
4728 return true;
4729}
4730
4731MOZ_CAN_RUN_SCRIPT static bool
4732set_writableNullableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4733{
4734 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableDouble setter");
4735 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4738( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4736 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4738( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4737 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4738( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4738 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4738( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4739
4740 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4741 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4742 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4743 if (objIsXray) {
4744 unwrappedObj.emplace(cx, obj);
4745 }
4746 Nullable<double> arg0;
4747 if (args[0].isNullOrUndefined()) {
4748 arg0.SetNull();
4749 } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4750 return false;
4751 } else if (!std::isfinite(arg0.Value())) {
4752 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4753 return false;
4754 }
4755 if (objIsXray) {
4756 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4757 // we know Xrays have no dynamic unwrap behavior.
4758 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4759 if (!unwrappedObj.ref()) {
4760 return false;
4761 }
4762 }
4763 FastErrorResult rv;
4764 // NOTE: This assert does NOT call the function.
4765 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");
4766 MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4767 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"
)), 0))
) {
4768 return false;
4769 }
4770 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4770); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4770); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4771
4772 return true;
4773}
4774
4775static const JSJitInfo writableNullableDouble_getterinfo = {
4776 { get_writableNullableDouble },
4777 { prototypes::id::TestJSImplInterface },
4778 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4779 JSJitInfo::Getter,
4780 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4781 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4782 false, /* isInfallible. False in setters. */
4783 false, /* isMovable. Not relevant for setters. */
4784 false, /* isEliminatable. Not relevant for setters. */
4785 false, /* isAlwaysInSlot. Only relevant for getters. */
4786 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4787 false, /* isTypedMethod. Only relevant for methods. */
4788 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4789};
4790static const JSJitInfo writableNullableDouble_setterinfo = {
4791 { (JSJitGetterOp)set_writableNullableDouble },
4792 { prototypes::id::TestJSImplInterface },
4793 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4794 JSJitInfo::Setter,
4795 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4796 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4797 false, /* isInfallible. False in setters. */
4798 false, /* isMovable. Not relevant for setters. */
4799 false, /* isEliminatable. Not relevant for setters. */
4800 false, /* isAlwaysInSlot. Only relevant for getters. */
4801 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4802 false, /* isTypedMethod. Only relevant for methods. */
4803 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4804};
4805
4806MOZ_CAN_RUN_SCRIPT static bool
4807get_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4808{
4809 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4812( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4810 "TestJSImplInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4812( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4811 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4812( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4812 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4812( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4813
4814 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4815 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4816 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4817 if (objIsXray) {
4818 unwrappedObj.emplace(cx, obj);
4819 }
4820 if (objIsXray) {
4821 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4822 // we know Xrays have no dynamic unwrap behavior.
4823 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4824 if (!unwrappedObj.ref()) {
4825 return false;
4826 }
4827 }
4828 FastErrorResult rv;
4829 Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4830 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble getter"
)), 0))
) {
4831 return false;
4832 }
4833 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4833); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4833); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4834 if (result.IsNull()) {
4835 args.rval().setNull();
4836 return true;
4837 }
4838 args.rval().set(JS_NumberValue(double(result.Value())));
4839 return true;
4840}
4841
4842MOZ_CAN_RUN_SCRIPT static bool
4843set_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4844{
4845 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4848( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4846 "TestJSImplInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4848( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4847 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4848( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4848 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4848( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4849
4850 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4851 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4852 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4853 if (objIsXray) {
4854 unwrappedObj.emplace(cx, obj);
4855 }
4856 Nullable<double> arg0;
4857 if (args[0].isNullOrUndefined()) {
4858 arg0.SetNull();
4859 } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4860 return false;
4861 }
4862 if (objIsXray) {
4863 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4864 // we know Xrays have no dynamic unwrap behavior.
4865 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4866 if (!unwrappedObj.ref()) {
4867 return false;
4868 }
4869 }
4870 FastErrorResult rv;
4871 // NOTE: This assert does NOT call the function.
4872 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");
4873 MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4874 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble setter"
)), 0))
) {
4875 return false;
4876 }
4877 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4877); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 4877); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
4878
4879 return true;
4880}
4881
4882static const JSJitInfo writableNullableUnrestrictedDouble_getterinfo = {
4883 { get_writableNullableUnrestrictedDouble },
4884 { prototypes::id::TestJSImplInterface },
4885 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4886 JSJitInfo::Getter,
4887 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4888 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4889 false, /* isInfallible. False in setters. */
4890 false, /* isMovable. Not relevant for setters. */
4891 false, /* isEliminatable. Not relevant for setters. */
4892 false, /* isAlwaysInSlot. Only relevant for getters. */
4893 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4894 false, /* isTypedMethod. Only relevant for methods. */
4895 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4896};
4897static const JSJitInfo writableNullableUnrestrictedDouble_setterinfo = {
4898 { (JSJitGetterOp)set_writableNullableUnrestrictedDouble },
4899 { prototypes::id::TestJSImplInterface },
4900 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4901 JSJitInfo::Setter,
4902 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4903 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4904 false, /* isInfallible. False in setters. */
4905 false, /* isMovable. Not relevant for setters. */
4906 false, /* isEliminatable. Not relevant for setters. */
4907 false, /* isAlwaysInSlot. Only relevant for getters. */
4908 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4909 false, /* isTypedMethod. Only relevant for methods. */
4910 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4911};
4912
4913MOZ_CAN_RUN_SCRIPT static bool
4914passFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
4915{
4916 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat");
4917 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4920( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4918 "TestJSImplInterface", "passFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4920( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4919 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4920( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4920 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4920( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
4921
4922 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4923 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat", 16)) {
4924 return false;
4925 }
4926 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4927 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4928 if (objIsXray) {
4929 unwrappedObj.emplace(cx, obj);
4930 }
4931 float arg0;
4932 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
4933 return false;
4934 } else if (!std::isfinite(arg0)) {
4935 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
4936 return false;
4937 }
4938 float arg1;
4939 if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
4940 return false;
4941 }
4942 Nullable<float> arg2;
4943 if (args[2].isNullOrUndefined()) {
4944 arg2.SetNull();
4945 } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
4946 return false;
4947 } else if (!std::isfinite(arg2.Value())) {
4948 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 3");
4949 return false;
4950 }
4951 Nullable<float> arg3;
4952 if (args[3].isNullOrUndefined()) {
4953 arg3.SetNull();
4954 } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) {
4955 return false;
4956 }
4957 double arg4;
4958 if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) {
4959 return false;
4960 } else if (!std::isfinite(arg4)) {
4961 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5");
4962 return false;
4963 }
4964 double arg5;
4965 if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) {
4966 return false;
4967 }
4968 Nullable<double> arg6;
4969 if (args[6].isNullOrUndefined()) {
4970 arg6.SetNull();
4971 } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) {
4972 return false;
4973 } else if (!std::isfinite(arg6.Value())) {
4974 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 7");
4975 return false;
4976 }
4977 Nullable<double> arg7;
4978 if (args[7].isNullOrUndefined()) {
4979 arg7.SetNull();
4980 } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) {
4981 return false;
4982 }
4983 binding_detail::AutoSequence<float> arg8;
4984 if (args[8].isObject()) {
4985 JS::ForOfIterator iter(cx);
4986 if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) {
4987 return false;
4988 }
4989 if (!iter.valueIsIterable()) {
4990 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
4991 return false;
4992 }
4993 binding_detail::AutoSequence<float> &arr = arg8;
4994 JS::Rooted<JS::Value> temp(cx);
4995 while (true) {
4996 bool done;
4997 if (!iter.next(&temp, &done)) {
4998 return false;
4999 }
5000 if (done) {
5001 break;
5002 }
5003 float* slotPtr = arr.AppendElement(mozilla::fallible);
5004 if (!slotPtr) {
5005 JS_ReportOutOfMemory(cx);
5006 return false;
5007 }
5008 float& slot = *slotPtr;
5009 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) {
5010 return false;
5011 } else if (!std::isfinite(slot)) {
5012 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 9");
5013 return false;
5014 }
5015 }
5016 } else {
5017 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5018 return false;
5019 }
5020 binding_detail::AutoSequence<float> arg9;
5021 if (args[9].isObject()) {
5022 JS::ForOfIterator iter(cx);
5023 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
5024 return false;
5025 }
5026 if (!iter.valueIsIterable()) {
5027 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5028 return false;
5029 }
5030 binding_detail::AutoSequence<float> &arr = arg9;
5031 JS::Rooted<JS::Value> temp(cx);
5032 while (true) {
5033 bool done;
5034 if (!iter.next(&temp, &done)) {
5035 return false;
5036 }
5037 if (done) {
5038 break;
5039 }
5040 float* slotPtr = arr.AppendElement(mozilla::fallible);
5041 if (!slotPtr) {
5042 JS_ReportOutOfMemory(cx);
5043 return false;
5044 }
5045 float& slot = *slotPtr;
5046 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) {
5047 return false;
5048 }
5049 }
5050 } else {
5051 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5052 return false;
5053 }
5054 binding_detail::AutoSequence<Nullable<float>> arg10;
5055 if (args[10].isObject()) {
5056 JS::ForOfIterator iter(cx);
5057 if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) {
5058 return false;
5059 }
5060 if (!iter.valueIsIterable()) {
5061 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5062 return false;
5063 }
5064 binding_detail::AutoSequence<Nullable<float>> &arr = arg10;
5065 JS::Rooted<JS::Value> temp(cx);
5066 while (true) {
5067 bool done;
5068 if (!iter.next(&temp, &done)) {
5069 return false;
5070 }
5071 if (done) {
5072 break;
5073 }
5074 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5075 if (!slotPtr) {
5076 JS_ReportOutOfMemory(cx);
5077 return false;
5078 }
5079 Nullable<float>& slot = *slotPtr;
5080 if (temp.isNullOrUndefined()) {
5081 slot.SetNull();
5082 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) {
5083 return false;
5084 } else if (!std::isfinite(slot.Value())) {
5085 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 11");
5086 return false;
5087 }
5088 }
5089 } else {
5090 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5091 return false;
5092 }
5093 binding_detail::AutoSequence<Nullable<float>> arg11;
5094 if (args[11].isObject()) {
5095 JS::ForOfIterator iter(cx);
5096 if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) {
5097 return false;
5098 }
5099 if (!iter.valueIsIterable()) {
5100 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5101 return false;
5102 }
5103 binding_detail::AutoSequence<Nullable<float>> &arr = arg11;
5104 JS::Rooted<JS::Value> temp(cx);
5105 while (true) {
5106 bool done;
5107 if (!iter.next(&temp, &done)) {
5108 return false;
5109 }
5110 if (done) {
5111 break;
5112 }
5113 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5114 if (!slotPtr) {
5115 JS_ReportOutOfMemory(cx);
5116 return false;
5117 }
5118 Nullable<float>& slot = *slotPtr;
5119 if (temp.isNullOrUndefined()) {
5120 slot.SetNull();
5121 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) {
5122 return false;
5123 }
5124 }
5125 } else {
5126 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5127 return false;
5128 }
5129 binding_detail::AutoSequence<double> arg12;
5130 if (args[12].isObject()) {
5131 JS::ForOfIterator iter(cx);
5132 if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) {
5133 return false;
5134 }
5135 if (!iter.valueIsIterable()) {
5136 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5137 return false;
5138 }
5139 binding_detail::AutoSequence<double> &arr = arg12;
5140 JS::Rooted<JS::Value> temp(cx);
5141 while (true) {
5142 bool done;
5143 if (!iter.next(&temp, &done)) {
5144 return false;
5145 }
5146 if (done) {
5147 break;
5148 }
5149 double* slotPtr = arr.AppendElement(mozilla::fallible);
5150 if (!slotPtr) {
5151 JS_ReportOutOfMemory(cx);
5152 return false;
5153 }
5154 double& slot = *slotPtr;
5155 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) {
5156 return false;
5157 } else if (!std::isfinite(slot)) {
5158 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 13");
5159 return false;
5160 }
5161 }
5162 } else {
5163 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5164 return false;
5165 }
5166 binding_detail::AutoSequence<double> arg13;
5167 if (args[13].isObject()) {
5168 JS::ForOfIterator iter(cx);
5169 if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) {
5170 return false;
5171 }
5172 if (!iter.valueIsIterable()) {
5173 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5174 return false;
5175 }
5176 binding_detail::AutoSequence<double> &arr = arg13;
5177 JS::Rooted<JS::Value> temp(cx);
5178 while (true) {
5179 bool done;
5180 if (!iter.next(&temp, &done)) {
5181 return false;
5182 }
5183 if (done) {
5184 break;
5185 }
5186 double* slotPtr = arr.AppendElement(mozilla::fallible);
5187 if (!slotPtr) {
5188 JS_ReportOutOfMemory(cx);
5189 return false;
5190 }
5191 double& slot = *slotPtr;
5192 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) {
5193 return false;
5194 }
5195 }
5196 } else {
5197 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5198 return false;
5199 }
5200 binding_detail::AutoSequence<Nullable<double>> arg14;
5201 if (args[14].isObject()) {
5202 JS::ForOfIterator iter(cx);
5203 if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) {
5204 return false;
5205 }
5206 if (!iter.valueIsIterable()) {
5207 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5208 return false;
5209 }
5210 binding_detail::AutoSequence<Nullable<double>> &arr = arg14;
5211 JS::Rooted<JS::Value> temp(cx);
5212 while (true) {
5213 bool done;
5214 if (!iter.next(&temp, &done)) {
5215 return false;
5216 }
5217 if (done) {
5218 break;
5219 }
5220 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5221 if (!slotPtr) {
5222 JS_ReportOutOfMemory(cx);
5223 return false;
5224 }
5225 Nullable<double>& slot = *slotPtr;
5226 if (temp.isNullOrUndefined()) {
5227 slot.SetNull();
5228 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) {
5229 return false;
5230 } else if (!std::isfinite(slot.Value())) {
5231 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 15");
5232 return false;
5233 }
5234 }
5235 } else {
5236 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5237 return false;
5238 }
5239 binding_detail::AutoSequence<Nullable<double>> arg15;
5240 if (args[15].isObject()) {
5241 JS::ForOfIterator iter(cx);
5242 if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) {
5243 return false;
5244 }
5245 if (!iter.valueIsIterable()) {
5246 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5247 return false;
5248 }
5249 binding_detail::AutoSequence<Nullable<double>> &arr = arg15;
5250 JS::Rooted<JS::Value> temp(cx);
5251 while (true) {
5252 bool done;
5253 if (!iter.next(&temp, &done)) {
5254 return false;
5255 }
5256 if (done) {
5257 break;
5258 }
5259 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5260 if (!slotPtr) {
5261 JS_ReportOutOfMemory(cx);
5262 return false;
5263 }
5264 Nullable<double>& slot = *slotPtr;
5265 if (temp.isNullOrUndefined()) {
5266 slot.SetNull();
5267 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) {
5268 return false;
5269 }
5270 }
5271 } else {
5272 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5273 return false;
5274 }
5275 if (objIsXray) {
5276 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5277 // we know Xrays have no dynamic unwrap behavior.
5278 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5279 if (!unwrappedObj.ref()) {
5280 return false;
5281 }
5282 }
5283 FastErrorResult rv;
5284 // NOTE: This assert does NOT call the function.
5285 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");
5286 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)));
5287 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat"
)), 0))
) {
5288 return false;
5289 }
5290 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5290); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5290); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5291 args.rval().setUndefined();
5292 return true;
5293}
5294
5295static const JSJitInfo passFloat_methodinfo = {
5296 { (JSJitGetterOp)passFloat },
5297 { prototypes::id::TestJSImplInterface },
5298 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5299 JSJitInfo::Method,
5300 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5301 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5302 false, /* isInfallible. False in setters. */
5303 false, /* isMovable. Not relevant for setters. */
5304 false, /* isEliminatable. Not relevant for setters. */
5305 false, /* isAlwaysInSlot. Only relevant for getters. */
5306 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5307 false, /* isTypedMethod. Only relevant for methods. */
5308 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5309};
5310
5311MOZ_CAN_RUN_SCRIPT static bool
5312passLenientFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5313{
5314 BindingCallContext cx(cx_, "TestJSImplInterface.passLenientFloat");
5315 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5318( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5316 "TestJSImplInterface", "passLenientFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5318( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5317 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5318( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5318 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5318( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5319
5320 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5321 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLenientFloat", 16)) {
5322 return false;
5323 }
5324 bool foundNonFiniteFloat = false;
5325 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5326 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5327 if (objIsXray) {
5328 unwrappedObj.emplace(cx, obj);
5329 }
5330 float arg0;
5331 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
5332 return false;
5333 } else if (!std::isfinite(arg0)) {
5334 foundNonFiniteFloat = true;
5335 }
5336 float arg1;
5337 if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
5338 return false;
5339 }
5340 Nullable<float> arg2;
5341 if (args[2].isNullOrUndefined()) {
5342 arg2.SetNull();
5343 } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
5344 return false;
5345 } else if (!std::isfinite(arg2.Value())) {
5346 foundNonFiniteFloat = true;
5347 }
5348 Nullable<float> arg3;
5349 if (args[3].isNullOrUndefined()) {
5350 arg3.SetNull();
5351 } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) {
5352 return false;
5353 }
5354 double arg4;
5355 if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) {
5356 return false;
5357 } else if (!std::isfinite(arg4)) {
5358 foundNonFiniteFloat = true;
5359 }
5360 double arg5;
5361 if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) {
5362 return false;
5363 }
5364 Nullable<double> arg6;
5365 if (args[6].isNullOrUndefined()) {
5366 arg6.SetNull();
5367 } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) {
5368 return false;
5369 } else if (!std::isfinite(arg6.Value())) {
5370 foundNonFiniteFloat = true;
5371 }
5372 Nullable<double> arg7;
5373 if (args[7].isNullOrUndefined()) {
5374 arg7.SetNull();
5375 } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) {
5376 return false;
5377 }
5378 binding_detail::AutoSequence<float> arg8;
5379 if (args[8].isObject()) {
5380 JS::ForOfIterator iter(cx);
5381 if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) {
5382 return false;
5383 }
5384 if (!iter.valueIsIterable()) {
5385 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5386 return false;
5387 }
5388 binding_detail::AutoSequence<float> &arr = arg8;
5389 JS::Rooted<JS::Value> temp(cx);
5390 while (true) {
5391 bool done;
5392 if (!iter.next(&temp, &done)) {
5393 return false;
5394 }
5395 if (done) {
5396 break;
5397 }
5398 float* slotPtr = arr.AppendElement(mozilla::fallible);
5399 if (!slotPtr) {
5400 JS_ReportOutOfMemory(cx);
5401 return false;
5402 }
5403 float& slot = *slotPtr;
5404 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) {
5405 return false;
5406 } else if (!std::isfinite(slot)) {
5407 foundNonFiniteFloat = true;
5408 }
5409 }
5410 } else {
5411 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5412 return false;
5413 }
5414 binding_detail::AutoSequence<float> arg9;
5415 if (args[9].isObject()) {
5416 JS::ForOfIterator iter(cx);
5417 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
5418 return false;
5419 }
5420 if (!iter.valueIsIterable()) {
5421 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5422 return false;
5423 }
5424 binding_detail::AutoSequence<float> &arr = arg9;
5425 JS::Rooted<JS::Value> temp(cx);
5426 while (true) {
5427 bool done;
5428 if (!iter.next(&temp, &done)) {
5429 return false;
5430 }
5431 if (done) {
5432 break;
5433 }
5434 float* slotPtr = arr.AppendElement(mozilla::fallible);
5435 if (!slotPtr) {
5436 JS_ReportOutOfMemory(cx);
5437 return false;
5438 }
5439 float& slot = *slotPtr;
5440 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) {
5441 return false;
5442 }
5443 }
5444 } else {
5445 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5446 return false;
5447 }
5448 binding_detail::AutoSequence<Nullable<float>> arg10;
5449 if (args[10].isObject()) {
5450 JS::ForOfIterator iter(cx);
5451 if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) {
5452 return false;
5453 }
5454 if (!iter.valueIsIterable()) {
5455 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5456 return false;
5457 }
5458 binding_detail::AutoSequence<Nullable<float>> &arr = arg10;
5459 JS::Rooted<JS::Value> temp(cx);
5460 while (true) {
5461 bool done;
5462 if (!iter.next(&temp, &done)) {
5463 return false;
5464 }
5465 if (done) {
5466 break;
5467 }
5468 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5469 if (!slotPtr) {
5470 JS_ReportOutOfMemory(cx);
5471 return false;
5472 }
5473 Nullable<float>& slot = *slotPtr;
5474 if (temp.isNullOrUndefined()) {
5475 slot.SetNull();
5476 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) {
5477 return false;
5478 } else if (!std::isfinite(slot.Value())) {
5479 foundNonFiniteFloat = true;
5480 }
5481 }
5482 } else {
5483 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5484 return false;
5485 }
5486 binding_detail::AutoSequence<Nullable<float>> arg11;
5487 if (args[11].isObject()) {
5488 JS::ForOfIterator iter(cx);
5489 if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) {
5490 return false;
5491 }
5492 if (!iter.valueIsIterable()) {
5493 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5494 return false;
5495 }
5496 binding_detail::AutoSequence<Nullable<float>> &arr = arg11;
5497 JS::Rooted<JS::Value> temp(cx);
5498 while (true) {
5499 bool done;
5500 if (!iter.next(&temp, &done)) {
5501 return false;
5502 }
5503 if (done) {
5504 break;
5505 }
5506 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5507 if (!slotPtr) {
5508 JS_ReportOutOfMemory(cx);
5509 return false;
5510 }
5511 Nullable<float>& slot = *slotPtr;
5512 if (temp.isNullOrUndefined()) {
5513 slot.SetNull();
5514 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) {
5515 return false;
5516 }
5517 }
5518 } else {
5519 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5520 return false;
5521 }
5522 binding_detail::AutoSequence<double> arg12;
5523 if (args[12].isObject()) {
5524 JS::ForOfIterator iter(cx);
5525 if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) {
5526 return false;
5527 }
5528 if (!iter.valueIsIterable()) {
5529 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5530 return false;
5531 }
5532 binding_detail::AutoSequence<double> &arr = arg12;
5533 JS::Rooted<JS::Value> temp(cx);
5534 while (true) {
5535 bool done;
5536 if (!iter.next(&temp, &done)) {
5537 return false;
5538 }
5539 if (done) {
5540 break;
5541 }
5542 double* slotPtr = arr.AppendElement(mozilla::fallible);
5543 if (!slotPtr) {
5544 JS_ReportOutOfMemory(cx);
5545 return false;
5546 }
5547 double& slot = *slotPtr;
5548 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) {
5549 return false;
5550 } else if (!std::isfinite(slot)) {
5551 foundNonFiniteFloat = true;
5552 }
5553 }
5554 } else {
5555 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5556 return false;
5557 }
5558 binding_detail::AutoSequence<double> arg13;
5559 if (args[13].isObject()) {
5560 JS::ForOfIterator iter(cx);
5561 if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) {
5562 return false;
5563 }
5564 if (!iter.valueIsIterable()) {
5565 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5566 return false;
5567 }
5568 binding_detail::AutoSequence<double> &arr = arg13;
5569 JS::Rooted<JS::Value> temp(cx);
5570 while (true) {
5571 bool done;
5572 if (!iter.next(&temp, &done)) {
5573 return false;
5574 }
5575 if (done) {
5576 break;
5577 }
5578 double* slotPtr = arr.AppendElement(mozilla::fallible);
5579 if (!slotPtr) {
5580 JS_ReportOutOfMemory(cx);
5581 return false;
5582 }
5583 double& slot = *slotPtr;
5584 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) {
5585 return false;
5586 }
5587 }
5588 } else {
5589 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5590 return false;
5591 }
5592 binding_detail::AutoSequence<Nullable<double>> arg14;
5593 if (args[14].isObject()) {
5594 JS::ForOfIterator iter(cx);
5595 if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) {
5596 return false;
5597 }
5598 if (!iter.valueIsIterable()) {
5599 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5600 return false;
5601 }
5602 binding_detail::AutoSequence<Nullable<double>> &arr = arg14;
5603 JS::Rooted<JS::Value> temp(cx);
5604 while (true) {
5605 bool done;
5606 if (!iter.next(&temp, &done)) {
5607 return false;
5608 }
5609 if (done) {
5610 break;
5611 }
5612 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5613 if (!slotPtr) {
5614 JS_ReportOutOfMemory(cx);
5615 return false;
5616 }
5617 Nullable<double>& slot = *slotPtr;
5618 if (temp.isNullOrUndefined()) {
5619 slot.SetNull();
5620 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) {
5621 return false;
5622 } else if (!std::isfinite(slot.Value())) {
5623 foundNonFiniteFloat = true;
5624 }
5625 }
5626 } else {
5627 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5628 return false;
5629 }
5630 binding_detail::AutoSequence<Nullable<double>> arg15;
5631 if (args[15].isObject()) {
5632 JS::ForOfIterator iter(cx);
5633 if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) {
5634 return false;
5635 }
5636 if (!iter.valueIsIterable()) {
5637 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5638 return false;
5639 }
5640 binding_detail::AutoSequence<Nullable<double>> &arr = arg15;
5641 JS::Rooted<JS::Value> temp(cx);
5642 while (true) {
5643 bool done;
5644 if (!iter.next(&temp, &done)) {
5645 return false;
5646 }
5647 if (done) {
5648 break;
5649 }
5650 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5651 if (!slotPtr) {
5652 JS_ReportOutOfMemory(cx);
5653 return false;
5654 }
5655 Nullable<double>& slot = *slotPtr;
5656 if (temp.isNullOrUndefined()) {
5657 slot.SetNull();
5658 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) {
5659 return false;
5660 }
5661 }
5662 } else {
5663 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5664 return false;
5665 }
5666 if (foundNonFiniteFloat) {
5667 args.rval().setUndefined();
5668 return true;
5669 }
5670 if (objIsXray) {
5671 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5672 // we know Xrays have no dynamic unwrap behavior.
5673 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5674 if (!unwrappedObj.ref()) {
5675 return false;
5676 }
5677 }
5678 FastErrorResult rv;
5679 // NOTE: This assert does NOT call the function.
5680 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");
5681 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)));
5682 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLenientFloat"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLenientFloat"
)), 0))
) {
5683 return false;
5684 }
5685 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5685); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5685); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5686 args.rval().setUndefined();
5687 return true;
5688}
5689
5690static const JSJitInfo passLenientFloat_methodinfo = {
5691 { (JSJitGetterOp)passLenientFloat },
5692 { prototypes::id::TestJSImplInterface },
5693 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5694 JSJitInfo::Method,
5695 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5696 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5697 false, /* isInfallible. False in setters. */
5698 false, /* isMovable. Not relevant for setters. */
5699 false, /* isEliminatable. Not relevant for setters. */
5700 false, /* isAlwaysInSlot. Only relevant for getters. */
5701 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5702 false, /* isTypedMethod. Only relevant for methods. */
5703 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5704};
5705
5706MOZ_CAN_RUN_SCRIPT static bool
5707get_lenientFloatAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
5708{
5709 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5712( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5710 "TestJSImplInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5712( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5711 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5712( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5712 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5712( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5713
5714 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5715 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5716 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5717 if (objIsXray) {
5718 unwrappedObj.emplace(cx, obj);
5719 }
5720 if (objIsXray) {
5721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5722 // we know Xrays have no dynamic unwrap behavior.
5723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5724 if (!unwrappedObj.ref()) {
5725 return false;
5726 }
5727 }
5728 FastErrorResult rv;
5729 float result(MOZ_KnownLive(self)(self)->GetLenientFloatAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
5730 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr getter"
)), 0))
) {
5731 return false;
5732 }
5733 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5733); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5733); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5734 args.rval().set(JS_NumberValue(double(result)));
5735 return true;
5736}
5737
5738MOZ_CAN_RUN_SCRIPT static bool
5739set_lenientFloatAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
5740{
5741 BindingCallContext cx(cx_, "TestJSImplInterface.lenientFloatAttr setter");
5742 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5745( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5743 "TestJSImplInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5745( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5744 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5745( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5745 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5745( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5746
5747 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5748 bool foundNonFiniteFloat = false;
5749 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5750 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5751 if (objIsXray) {
5752 unwrappedObj.emplace(cx, obj);
5753 }
5754 float arg0;
5755 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
5756 return false;
5757 } else if (!std::isfinite(arg0)) {
5758 foundNonFiniteFloat = true;
5759 }
5760 if (foundNonFiniteFloat) {
5761 return true;
5762 }
5763 if (objIsXray) {
5764 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5765 // we know Xrays have no dynamic unwrap behavior.
5766 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5767 if (!unwrappedObj.ref()) {
5768 return false;
5769 }
5770 }
5771 FastErrorResult rv;
5772 // NOTE: This assert does NOT call the function.
5773 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");
5774 MOZ_KnownLive(self)(self)->SetLenientFloatAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5775 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr setter"
)), 0))
) {
5776 return false;
5777 }
5778 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5778); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5778); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5779
5780 return true;
5781}
5782
5783static const JSJitInfo lenientFloatAttr_getterinfo = {
5784 { get_lenientFloatAttr },
5785 { prototypes::id::TestJSImplInterface },
5786 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5787 JSJitInfo::Getter,
5788 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5789 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
5790 false, /* isInfallible. False in setters. */
5791 false, /* isMovable. Not relevant for setters. */
5792 false, /* isEliminatable. Not relevant for setters. */
5793 false, /* isAlwaysInSlot. Only relevant for getters. */
5794 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5795 false, /* isTypedMethod. Only relevant for methods. */
5796 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5797};
5798static const JSJitInfo lenientFloatAttr_setterinfo = {
5799 { (JSJitGetterOp)set_lenientFloatAttr },
5800 { prototypes::id::TestJSImplInterface },
5801 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5802 JSJitInfo::Setter,
5803 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5804 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5805 false, /* isInfallible. False in setters. */
5806 false, /* isMovable. Not relevant for setters. */
5807 false, /* isEliminatable. Not relevant for setters. */
5808 false, /* isAlwaysInSlot. Only relevant for getters. */
5809 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5810 false, /* isTypedMethod. Only relevant for methods. */
5811 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5812};
5813
5814MOZ_CAN_RUN_SCRIPT static bool
5815get_lenientDoubleAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
5816{
5817 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5820( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5818 "TestJSImplInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5820( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5819 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5820( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5820 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5820( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5821
5822 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5823 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5824 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5825 if (objIsXray) {
5826 unwrappedObj.emplace(cx, obj);
5827 }
5828 if (objIsXray) {
5829 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5830 // we know Xrays have no dynamic unwrap behavior.
5831 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5832 if (!unwrappedObj.ref()) {
5833 return false;
5834 }
5835 }
5836 FastErrorResult rv;
5837 double result(MOZ_KnownLive(self)(self)->GetLenientDoubleAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
5838 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr getter"
)), 0))
) {
5839 return false;
5840 }
5841 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5841); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5841); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5842 args.rval().set(JS_NumberValue(double(result)));
5843 return true;
5844}
5845
5846MOZ_CAN_RUN_SCRIPT static bool
5847set_lenientDoubleAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
5848{
5849 BindingCallContext cx(cx_, "TestJSImplInterface.lenientDoubleAttr setter");
5850 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5853( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5851 "TestJSImplInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5853( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5852 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5853( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5853 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5853( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5854
5855 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5856 bool foundNonFiniteFloat = false;
5857 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5858 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5859 if (objIsXray) {
5860 unwrappedObj.emplace(cx, obj);
5861 }
5862 double arg0;
5863 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
5864 return false;
5865 } else if (!std::isfinite(arg0)) {
5866 foundNonFiniteFloat = true;
5867 }
5868 if (foundNonFiniteFloat) {
5869 return true;
5870 }
5871 if (objIsXray) {
5872 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5873 // we know Xrays have no dynamic unwrap behavior.
5874 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5875 if (!unwrappedObj.ref()) {
5876 return false;
5877 }
5878 }
5879 FastErrorResult rv;
5880 // NOTE: This assert does NOT call the function.
5881 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");
5882 MOZ_KnownLive(self)(self)->SetLenientDoubleAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5883 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr setter"
)), 0))
) {
5884 return false;
5885 }
5886 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5886); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5886); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5887
5888 return true;
5889}
5890
5891static const JSJitInfo lenientDoubleAttr_getterinfo = {
5892 { get_lenientDoubleAttr },
5893 { prototypes::id::TestJSImplInterface },
5894 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5895 JSJitInfo::Getter,
5896 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5897 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
5898 false, /* isInfallible. False in setters. */
5899 false, /* isMovable. Not relevant for setters. */
5900 false, /* isEliminatable. Not relevant for setters. */
5901 false, /* isAlwaysInSlot. Only relevant for getters. */
5902 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5903 false, /* isTypedMethod. Only relevant for methods. */
5904 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5905};
5906static const JSJitInfo lenientDoubleAttr_setterinfo = {
5907 { (JSJitGetterOp)set_lenientDoubleAttr },
5908 { prototypes::id::TestJSImplInterface },
5909 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5910 JSJitInfo::Setter,
5911 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5912 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5913 false, /* isInfallible. False in setters. */
5914 false, /* isMovable. Not relevant for setters. */
5915 false, /* isEliminatable. Not relevant for setters. */
5916 false, /* isAlwaysInSlot. Only relevant for getters. */
5917 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5918 false, /* isTypedMethod. Only relevant for methods. */
5919 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5920};
5921
5922MOZ_CAN_RUN_SCRIPT static bool
5923receiveSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5924{
5925 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5928( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5926 "TestJSImplInterface", "receiveSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5928( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5927 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5928( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5928 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5928( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5929
5930 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5931 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5932 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5933 if (objIsXray) {
5934 unwrappedObj.emplace(cx, obj);
5935 }
5936 if (objIsXray) {
5937 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5938 // we know Xrays have no dynamic unwrap behavior.
5939 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5940 if (!unwrappedObj.ref()) {
5941 return false;
5942 }
5943 }
5944 FastErrorResult rv;
5945 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
5946 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSelf"
)), 0))
) {
5947 return false;
5948 }
5949 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5949); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5949); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5950 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5951 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5951); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 5951); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
5952 return false;
5953 }
5954 return true;
5955}
5956
5957static const JSJitInfo receiveSelf_methodinfo = {
5958 { (JSJitGetterOp)receiveSelf },
5959 { prototypes::id::TestJSImplInterface },
5960 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5961 JSJitInfo::Method,
5962 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5963 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
5964 false, /* isInfallible. False in setters. */
5965 false, /* isMovable. Not relevant for setters. */
5966 false, /* isEliminatable. Not relevant for setters. */
5967 false, /* isAlwaysInSlot. Only relevant for getters. */
5968 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5969 false, /* isTypedMethod. Only relevant for methods. */
5970 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5971};
5972
5973MOZ_CAN_RUN_SCRIPT static bool
5974receiveNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5975{
5976 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5979( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5977 "TestJSImplInterface", "receiveNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5979( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5978 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5979( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5979 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5979( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5980
5981 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5982 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5983 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5984 if (objIsXray) {
5985 unwrappedObj.emplace(cx, obj);
5986 }
5987 if (objIsXray) {
5988 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5989 // we know Xrays have no dynamic unwrap behavior.
5990 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5991 if (!unwrappedObj.ref()) {
5992 return false;
5993 }
5994 }
5995 FastErrorResult rv;
5996 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
5997 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSelf"
)), 0))
) {
5998 return false;
5999 }
6000 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6000); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6000); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6001 if (!result) {
6002 args.rval().setNull();
6003 return true;
6004 }
6005 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6006 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6006); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6006); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6007 return false;
6008 }
6009 return true;
6010}
6011
6012static const JSJitInfo receiveNullableSelf_methodinfo = {
6013 { (JSJitGetterOp)receiveNullableSelf },
6014 { prototypes::id::TestJSImplInterface },
6015 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6016 JSJitInfo::Method,
6017 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6018 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6019 false, /* isInfallible. False in setters. */
6020 false, /* isMovable. Not relevant for setters. */
6021 false, /* isEliminatable. Not relevant for setters. */
6022 false, /* isAlwaysInSlot. Only relevant for getters. */
6023 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6024 false, /* isTypedMethod. Only relevant for methods. */
6025 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6026};
6027
6028MOZ_CAN_RUN_SCRIPT static bool
6029receiveWeakSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6030{
6031 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6034( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6032 "TestJSImplInterface", "receiveWeakSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6034( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6033 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6034( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6034 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6034( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6035
6036 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6037 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6038 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6039 if (objIsXray) {
6040 unwrappedObj.emplace(cx, obj);
6041 }
6042 if (objIsXray) {
6043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6044 // we know Xrays have no dynamic unwrap behavior.
6045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6046 if (!unwrappedObj.ref()) {
6047 return false;
6048 }
6049 }
6050 FastErrorResult rv;
6051 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6052 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakSelf"
)), 0))
) {
6053 return false;
6054 }
6055 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6055); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6055); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6056 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6057 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6057); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6058 return false;
6059 }
6060 return true;
6061}
6062
6063static const JSJitInfo receiveWeakSelf_methodinfo = {
6064 { (JSJitGetterOp)receiveWeakSelf },
6065 { prototypes::id::TestJSImplInterface },
6066 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6067 JSJitInfo::Method,
6068 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6069 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6070 false, /* isInfallible. False in setters. */
6071 false, /* isMovable. Not relevant for setters. */
6072 false, /* isEliminatable. Not relevant for setters. */
6073 false, /* isAlwaysInSlot. Only relevant for getters. */
6074 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6075 false, /* isTypedMethod. Only relevant for methods. */
6076 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6077};
6078
6079MOZ_CAN_RUN_SCRIPT static bool
6080receiveWeakNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6081{
6082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6085( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6083 "TestJSImplInterface", "receiveWeakNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6085( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6085( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6085( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6086
6087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6088 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6089 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6090 if (objIsXray) {
6091 unwrappedObj.emplace(cx, obj);
6092 }
6093 if (objIsXray) {
6094 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6095 // we know Xrays have no dynamic unwrap behavior.
6096 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6097 if (!unwrappedObj.ref()) {
6098 return false;
6099 }
6100 }
6101 FastErrorResult rv;
6102 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6103 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableSelf"
)), 0))
) {
6104 return false;
6105 }
6106 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6106); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6106); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6107 if (!result) {
6108 args.rval().setNull();
6109 return true;
6110 }
6111 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6112 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6112); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6112); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6113 return false;
6114 }
6115 return true;
6116}
6117
6118static const JSJitInfo receiveWeakNullableSelf_methodinfo = {
6119 { (JSJitGetterOp)receiveWeakNullableSelf },
6120 { prototypes::id::TestJSImplInterface },
6121 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6122 JSJitInfo::Method,
6123 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6124 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6125 false, /* isInfallible. False in setters. */
6126 false, /* isMovable. Not relevant for setters. */
6127 false, /* isEliminatable. Not relevant for setters. */
6128 false, /* isAlwaysInSlot. Only relevant for getters. */
6129 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6130 false, /* isTypedMethod. Only relevant for methods. */
6131 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6132};
6133
6134MOZ_CAN_RUN_SCRIPT static bool
6135passSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6136{
6137 BindingCallContext cx(cx_, "TestJSImplInterface.passSelf");
6138 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6141( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6139 "TestJSImplInterface", "passSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6141( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6140 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6141( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6141 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6141( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
6142
6143 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6144 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSelf", 1)) {
6145 return false;
6146 }
6147 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6148 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6149 if (objIsXray) {
6150 unwrappedObj.emplace(cx, obj);
6151 }
6152 NonNull<mozilla::dom::TestJSImplInterface> arg0;
6153 if (args[0].isObject()) {
6154 {
6155 // Our JSContext should be in the right global to do unwrapping in.
6156 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6157 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6158 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6159 return false;
6160 }
6161 }
6162 } else {
6163 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6164 return false;
6165 }
6166 if (objIsXray) {
6167 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6168 // we know Xrays have no dynamic unwrap behavior.
6169 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6170 if (!unwrappedObj.ref()) {
6171 return false;
6172 }
6173 }
6174 FastErrorResult rv;
6175 // NOTE: This assert does NOT call the function.
6176 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");
6177 MOZ_KnownLive(self)(self)->PassSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6178 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSelf"
)), 0))
) {
6179 return false;
6180 }
6181 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6181); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6181); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6182 args.rval().setUndefined();
6183 return true;
6184}
6185
6186static const JSJitInfo passSelf_methodinfo = {
6187 { (JSJitGetterOp)passSelf },
6188 { prototypes::id::TestJSImplInterface },
6189 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6190 JSJitInfo::Method,
6191 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6192 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6193 false, /* isInfallible. False in setters. */
6194 false, /* isMovable. Not relevant for setters. */
6195 false, /* isEliminatable. Not relevant for setters. */
6196 false, /* isAlwaysInSlot. Only relevant for getters. */
6197 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6198 false, /* isTypedMethod. Only relevant for methods. */
6199 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6200};
6201
6202MOZ_CAN_RUN_SCRIPT static bool
6203passNullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6204{
6205 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSelf");
6206 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6209( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6207 "TestJSImplInterface", "passNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6209( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6208 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6209( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6209 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6209( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6210
6211 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6212 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSelf", 1)) {
6213 return false;
6214 }
6215 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6216 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6217 if (objIsXray) {
6218 unwrappedObj.emplace(cx, obj);
6219 }
6220 mozilla::dom::TestJSImplInterface* arg0;
6221 if (args[0].isObject()) {
6222 {
6223 // Our JSContext should be in the right global to do unwrapping in.
6224 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6225 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6226 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6227 return false;
6228 }
6229 }
6230 } else if (args[0].isNullOrUndefined()) {
6231 arg0 = nullptr;
6232 } else {
6233 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6234 return false;
6235 }
6236 if (objIsXray) {
6237 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6238 // we know Xrays have no dynamic unwrap behavior.
6239 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6240 if (!unwrappedObj.ref()) {
6241 return false;
6242 }
6243 }
6244 FastErrorResult rv;
6245 // NOTE: This assert does NOT call the function.
6246 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");
6247 MOZ_KnownLive(self)(self)->PassNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6248 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSelf"
)), 0))
) {
6249 return false;
6250 }
6251 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6251); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6251); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6252 args.rval().setUndefined();
6253 return true;
6254}
6255
6256static const JSJitInfo passNullableSelf_methodinfo = {
6257 { (JSJitGetterOp)passNullableSelf },
6258 { prototypes::id::TestJSImplInterface },
6259 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6260 JSJitInfo::Method,
6261 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6262 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6263 false, /* isInfallible. False in setters. */
6264 false, /* isMovable. Not relevant for setters. */
6265 false, /* isEliminatable. Not relevant for setters. */
6266 false, /* isAlwaysInSlot. Only relevant for getters. */
6267 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6268 false, /* isTypedMethod. Only relevant for methods. */
6269 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6270};
6271
6272MOZ_CAN_RUN_SCRIPT static bool
6273get_nonNullSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
6274{
6275 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6276 "TestJSImplInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6277 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6278 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6278( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6279
6280 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6281 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6282 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6283 if (objIsXray) {
6284 unwrappedObj.emplace(cx, obj);
6285 }
6286 if (objIsXray) {
6287 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6288 // we know Xrays have no dynamic unwrap behavior.
6289 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6290 if (!unwrappedObj.ref()) {
6291 return false;
6292 }
6293 }
6294 FastErrorResult rv;
6295 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetNonNullSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6296 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf getter"
)), 0))
) {
6297 return false;
6298 }
6299 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6299); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6299); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6300 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6301 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6301); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6301); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6302 return false;
6303 }
6304 return true;
6305}
6306
6307MOZ_CAN_RUN_SCRIPT static bool
6308set_nonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
6309{
6310 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullSelf setter");
6311 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6314( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6312 "TestJSImplInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6314( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6313 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6314( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6314 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6314( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6315
6316 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6317 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6318 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6319 if (objIsXray) {
6320 unwrappedObj.emplace(cx, obj);
6321 }
6322 NonNull<mozilla::dom::TestJSImplInterface> arg0;
6323 if (args[0].isObject()) {
6324 {
6325 // Our JSContext should be in the right global to do unwrapping in.
6326 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6327 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6328 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestJSImplInterface");
6329 return false;
6330 }
6331 }
6332 } else {
6333 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
6334 return false;
6335 }
6336 if (objIsXray) {
6337 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6338 // we know Xrays have no dynamic unwrap behavior.
6339 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6340 if (!unwrappedObj.ref()) {
6341 return false;
6342 }
6343 }
6344 FastErrorResult rv;
6345 // NOTE: This assert does NOT call the function.
6346 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");
6347 MOZ_KnownLive(self)(self)->SetNonNullSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6348 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf setter"
)), 0))
) {
6349 return false;
6350 }
6351 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6351); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6351); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6352
6353 return true;
6354}
6355
6356static const JSJitInfo nonNullSelf_getterinfo = {
6357 { get_nonNullSelf },
6358 { prototypes::id::TestJSImplInterface },
6359 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6360 JSJitInfo::Getter,
6361 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6362 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6363 false, /* isInfallible. False in setters. */
6364 false, /* isMovable. Not relevant for setters. */
6365 false, /* isEliminatable. Not relevant for setters. */
6366 false, /* isAlwaysInSlot. Only relevant for getters. */
6367 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6368 false, /* isTypedMethod. Only relevant for methods. */
6369 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6370};
6371static const JSJitInfo nonNullSelf_setterinfo = {
6372 { (JSJitGetterOp)set_nonNullSelf },
6373 { prototypes::id::TestJSImplInterface },
6374 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6375 JSJitInfo::Setter,
6376 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6377 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6378 false, /* isInfallible. False in setters. */
6379 false, /* isMovable. Not relevant for setters. */
6380 false, /* isEliminatable. Not relevant for setters. */
6381 false, /* isAlwaysInSlot. Only relevant for getters. */
6382 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6383 false, /* isTypedMethod. Only relevant for methods. */
6384 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6385};
6386
6387MOZ_CAN_RUN_SCRIPT static bool
6388get_nullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
6389{
6390 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6393( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6391 "TestJSImplInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6393( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6392 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6393( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6393 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6393( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6394
6395 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6396 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6397 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6398 if (objIsXray) {
6399 unwrappedObj.emplace(cx, obj);
6400 }
6401 if (objIsXray) {
6402 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6403 // we know Xrays have no dynamic unwrap behavior.
6404 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6405 if (!unwrappedObj.ref()) {
6406 return false;
6407 }
6408 }
6409 FastErrorResult rv;
6410 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6411 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf getter"
)), 0))
) {
6412 return false;
6413 }
6414 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6414); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6414); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6415 if (!result) {
6416 args.rval().setNull();
6417 return true;
6418 }
6419 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6420 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6420); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6420); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6421 return false;
6422 }
6423 return true;
6424}
6425
6426MOZ_CAN_RUN_SCRIPT static bool
6427set_nullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
6428{
6429 BindingCallContext cx(cx_, "TestJSImplInterface.nullableSelf setter");
6430 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6433( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6431 "TestJSImplInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6433( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6432 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6433( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6433 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6433( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6434
6435 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6436 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6437 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6438 if (objIsXray) {
6439 unwrappedObj.emplace(cx, obj);
6440 }
6441 mozilla::dom::TestJSImplInterface* arg0;
6442 if (args[0].isObject()) {
6443 {
6444 // Our JSContext should be in the right global to do unwrapping in.
6445 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6446 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6447 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestJSImplInterface");
6448 return false;
6449 }
6450 }
6451 } else if (args[0].isNullOrUndefined()) {
6452 arg0 = nullptr;
6453 } else {
6454 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
6455 return false;
6456 }
6457 if (objIsXray) {
6458 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6459 // we know Xrays have no dynamic unwrap behavior.
6460 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6461 if (!unwrappedObj.ref()) {
6462 return false;
6463 }
6464 }
6465 FastErrorResult rv;
6466 // NOTE: This assert does NOT call the function.
6467 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");
6468 MOZ_KnownLive(self)(self)->SetNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6469 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf setter"
)), 0))
) {
6470 return false;
6471 }
6472 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6472); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6472); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6473
6474 return true;
6475}
6476
6477static const JSJitInfo nullableSelf_getterinfo = {
6478 { get_nullableSelf },
6479 { prototypes::id::TestJSImplInterface },
6480 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6481 JSJitInfo::Getter,
6482 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6483 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6484 false, /* isInfallible. False in setters. */
6485 false, /* isMovable. Not relevant for setters. */
6486 false, /* isEliminatable. Not relevant for setters. */
6487 false, /* isAlwaysInSlot. Only relevant for getters. */
6488 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6489 false, /* isTypedMethod. Only relevant for methods. */
6490 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6491};
6492static const JSJitInfo nullableSelf_setterinfo = {
6493 { (JSJitGetterOp)set_nullableSelf },
6494 { prototypes::id::TestJSImplInterface },
6495 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6496 JSJitInfo::Setter,
6497 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6498 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6499 false, /* isInfallible. False in setters. */
6500 false, /* isMovable. Not relevant for setters. */
6501 false, /* isEliminatable. Not relevant for setters. */
6502 false, /* isAlwaysInSlot. Only relevant for getters. */
6503 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6504 false, /* isTypedMethod. Only relevant for methods. */
6505 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6506};
6507
6508MOZ_CAN_RUN_SCRIPT static bool
6509passOptionalSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6510{
6511 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSelf");
6512 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6515( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6513 "TestJSImplInterface", "passOptionalSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6515( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6514 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6515( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6515 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6515( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6516
6517 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6518 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6519 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6520 if (objIsXray) {
6521 unwrappedObj.emplace(cx, obj);
6522 }
6523 Optional<mozilla::dom::TestJSImplInterface*> arg0;
6524 if (args.hasDefined(0)) {
6525 arg0.Construct();
6526 if (args[0].isObject()) {
6527 {
6528 // Our JSContext should be in the right global to do unwrapping in.
6529 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0.Value(), cx);
6530 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6531 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6532 return false;
6533 }
6534 }
6535 } else if (args[0].isNullOrUndefined()) {
6536 arg0.Value() = nullptr;
6537 } else {
6538 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6539 return false;
6540 }
6541 }
6542 if (objIsXray) {
6543 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6544 // we know Xrays have no dynamic unwrap behavior.
6545 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6546 if (!unwrappedObj.ref()) {
6547 return false;
6548 }
6549 }
6550 FastErrorResult rv;
6551 // NOTE: This assert does NOT call the function.
6552 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");
6553 MOZ_KnownLive(self)(self)->PassOptionalSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6554 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelf"
)), 0))
) {
6555 return false;
6556 }
6557 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6557); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6557); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6558 args.rval().setUndefined();
6559 return true;
6560}
6561
6562static const JSJitInfo passOptionalSelf_methodinfo = {
6563 { (JSJitGetterOp)passOptionalSelf },
6564 { prototypes::id::TestJSImplInterface },
6565 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6566 JSJitInfo::Method,
6567 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6568 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6569 false, /* isInfallible. False in setters. */
6570 false, /* isMovable. Not relevant for setters. */
6571 false, /* isEliminatable. Not relevant for setters. */
6572 false, /* isAlwaysInSlot. Only relevant for getters. */
6573 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6574 false, /* isTypedMethod. Only relevant for methods. */
6575 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6576};
6577
6578MOZ_CAN_RUN_SCRIPT static bool
6579passOptionalNonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6580{
6581 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullSelf");
6582 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6585( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6583 "TestJSImplInterface", "passOptionalNonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6585( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6584 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6585( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6585 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6585( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6586
6587 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6588 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6589 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6590 if (objIsXray) {
6591 unwrappedObj.emplace(cx, obj);
6592 }
6593 Optional<NonNull<mozilla::dom::TestJSImplInterface>> arg0;
6594 if (args.hasDefined(0)) {
6595 arg0.Construct();
6596 if (args[0].isObject()) {
6597 {
6598 // Our JSContext should be in the right global to do unwrapping in.
6599 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0.Value(), cx);
6600 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6601 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6602 return false;
6603 }
6604 }
6605 } else {
6606 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6607 return false;
6608 }
6609 }
6610 if (objIsXray) {
6611 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6612 // we know Xrays have no dynamic unwrap behavior.
6613 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6614 if (!unwrappedObj.ref()) {
6615 return false;
6616 }
6617 }
6618 FastErrorResult rv;
6619 // NOTE: This assert does NOT call the function.
6620 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");
6621 MOZ_KnownLive(self)(self)->PassOptionalNonNullSelf(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6622 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullSelf"
)), 0))
) {
6623 return false;
6624 }
6625 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6625); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6625); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6626 args.rval().setUndefined();
6627 return true;
6628}
6629
6630static const JSJitInfo passOptionalNonNullSelf_methodinfo = {
6631 { (JSJitGetterOp)passOptionalNonNullSelf },
6632 { prototypes::id::TestJSImplInterface },
6633 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6634 JSJitInfo::Method,
6635 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6636 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6637 false, /* isInfallible. False in setters. */
6638 false, /* isMovable. Not relevant for setters. */
6639 false, /* isEliminatable. Not relevant for setters. */
6640 false, /* isAlwaysInSlot. Only relevant for getters. */
6641 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6642 false, /* isTypedMethod. Only relevant for methods. */
6643 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6644};
6645
6646MOZ_CAN_RUN_SCRIPT static bool
6647passOptionalSelfWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6648{
6649 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSelfWithDefault");
6650 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6653( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6651 "TestJSImplInterface", "passOptionalSelfWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6653( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6652 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6653( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6653 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6653( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6654
6655 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6656 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6657 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6658 if (objIsXray) {
6659 unwrappedObj.emplace(cx, obj);
6660 }
6661 mozilla::dom::TestJSImplInterface* arg0;
6662 if (args.hasDefined(0)) {
6663 if (args[0].isObject()) {
6664 {
6665 // Our JSContext should be in the right global to do unwrapping in.
6666 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6667 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6668 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6669 return false;
6670 }
6671 }
6672 } else if (args[0].isNullOrUndefined()) {
6673 arg0 = nullptr;
6674 } else {
6675 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6676 return false;
6677 }
6678 } else {
6679 arg0 = nullptr;
6680 }
6681 if (objIsXray) {
6682 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6683 // we know Xrays have no dynamic unwrap behavior.
6684 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6685 if (!unwrappedObj.ref()) {
6686 return false;
6687 }
6688 }
6689 FastErrorResult rv;
6690 // NOTE: This assert does NOT call the function.
6691 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");
6692 MOZ_KnownLive(self)(self)->PassOptionalSelfWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6693 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelfWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelfWithDefault"
)), 0))
) {
6694 return false;
6695 }
6696 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6696); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6696); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6697 args.rval().setUndefined();
6698 return true;
6699}
6700
6701static const JSJitInfo passOptionalSelfWithDefault_methodinfo = {
6702 { (JSJitGetterOp)passOptionalSelfWithDefault },
6703 { prototypes::id::TestJSImplInterface },
6704 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6705 JSJitInfo::Method,
6706 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6707 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6708 false, /* isInfallible. False in setters. */
6709 false, /* isMovable. Not relevant for setters. */
6710 false, /* isEliminatable. Not relevant for setters. */
6711 false, /* isAlwaysInSlot. Only relevant for getters. */
6712 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6713 false, /* isTypedMethod. Only relevant for methods. */
6714 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6715};
6716
6717MOZ_CAN_RUN_SCRIPT static bool
6718receiveNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6719{
6720 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6723( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6721 "TestJSImplInterface", "receiveNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6723( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6722 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6723( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6723 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6723( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6724
6725 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6726 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6727 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6728 if (objIsXray) {
6729 unwrappedObj.emplace(cx, obj);
6730 }
6731 if (objIsXray) {
6732 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6733 // we know Xrays have no dynamic unwrap behavior.
6734 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6735 if (!unwrappedObj.ref()) {
6736 return false;
6737 }
6738 }
6739 FastErrorResult rv;
6740 auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6741 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterface"
)), 0))
) {
6742 return false;
6743 }
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 { MOZ_CrashSequence
(__null, 6744); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6745 static_assert(!std::is_pointer_v<decltype(result)>,
6746 "NewObject implies that we need to keep the object alive with a strong reference.");
6747 if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
6748 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6748); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6748); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6749 return false;
6750 }
6751 return true;
6752}
6753
6754static const JSJitInfo receiveNonWrapperCacheInterface_methodinfo = {
6755 { (JSJitGetterOp)receiveNonWrapperCacheInterface },
6756 { prototypes::id::TestJSImplInterface },
6757 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6758 JSJitInfo::Method,
6759 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6760 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6761 false, /* isInfallible. False in setters. */
6762 false, /* isMovable. Not relevant for setters. */
6763 false, /* isEliminatable. Not relevant for setters. */
6764 false, /* isAlwaysInSlot. Only relevant for getters. */
6765 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6766 false, /* isTypedMethod. Only relevant for methods. */
6767 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6768};
6769
6770MOZ_CAN_RUN_SCRIPT static bool
6771receiveNullableNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6772{
6773 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6776( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6774 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6776( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6775 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6776( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6776 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6776( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6777
6778 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6779 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6780 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6781 if (objIsXray) {
6782 unwrappedObj.emplace(cx, obj);
6783 }
6784 if (objIsXray) {
6785 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6786 // we know Xrays have no dynamic unwrap behavior.
6787 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6788 if (!unwrappedObj.ref()) {
6789 return false;
6790 }
6791 }
6792 FastErrorResult rv;
6793 auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6794 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface"
)), 0))
) {
6795 return false;
6796 }
6797 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6797); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6797); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6798 static_assert(!std::is_pointer_v<decltype(result)>,
6799 "NewObject implies that we need to keep the object alive with a strong reference.");
6800 if (!result) {
6801 args.rval().setNull();
6802 return true;
6803 }
6804 if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
6805 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6805); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6805); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6806 return false;
6807 }
6808 return true;
6809}
6810
6811static const JSJitInfo receiveNullableNonWrapperCacheInterface_methodinfo = {
6812 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterface },
6813 { prototypes::id::TestJSImplInterface },
6814 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6815 JSJitInfo::Method,
6816 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6817 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6818 false, /* isInfallible. False in setters. */
6819 false, /* isMovable. Not relevant for setters. */
6820 false, /* isEliminatable. Not relevant for setters. */
6821 false, /* isAlwaysInSlot. Only relevant for getters. */
6822 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6823 false, /* isTypedMethod. Only relevant for methods. */
6824 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6825};
6826
6827MOZ_CAN_RUN_SCRIPT static bool
6828receiveNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6829{
6830 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6833( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6831 "TestJSImplInterface", "receiveNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6833( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6832 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6833( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6833 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6833( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6834
6835 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6836 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6837 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6838 if (objIsXray) {
6839 unwrappedObj.emplace(cx, obj);
6840 }
6841 if (objIsXray) {
6842 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6843 // we know Xrays have no dynamic unwrap behavior.
6844 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6845 if (!unwrappedObj.ref()) {
6846 return false;
6847 }
6848 }
6849 FastErrorResult rv;
6850 nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result;
6851 // NOTE: This assert does NOT call the function.
6852 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");
6853 MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6854 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence"
)), 0))
) {
6855 return false;
6856 }
6857 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6857); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6857); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6858
6859 uint32_t length = result.Length();
6860 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
6861 if (!returnArray) {
6862 return false;
6863 }
6864 // Scope for 'tmp'
6865 {
6866 JS::Rooted<JS::Value> tmp(cx);
6867 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6868 // Control block to let us common up the JS_DefineElement calls when there
6869 // are different ways to succeed at wrapping the object.
6870 do {
6871 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) {
6872 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6872); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6872); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6873 return false;
6874 }
6875 break;
6876 } while (false);
6877 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6878 JSPROP_ENUMERATE)) {
6879 return false;
6880 }
6881 }
6882 }
6883 args.rval().setObject(*returnArray);
6884 return true;
6885}
6886
6887static const JSJitInfo receiveNonWrapperCacheInterfaceSequence_methodinfo = {
6888 { (JSJitGetterOp)receiveNonWrapperCacheInterfaceSequence },
6889 { prototypes::id::TestJSImplInterface },
6890 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6891 JSJitInfo::Method,
6892 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6893 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6894 false, /* isInfallible. False in setters. */
6895 false, /* isMovable. Not relevant for setters. */
6896 false, /* isEliminatable. Not relevant for setters. */
6897 false, /* isAlwaysInSlot. Only relevant for getters. */
6898 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6899 false, /* isTypedMethod. Only relevant for methods. */
6900 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6901};
6902
6903MOZ_CAN_RUN_SCRIPT static bool
6904receiveNullableNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6905{
6906 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6909( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6907 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6909( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6908 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6909( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6909 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6909( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6910
6911 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6912 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6913 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6914 if (objIsXray) {
6915 unwrappedObj.emplace(cx, obj);
6916 }
6917 if (objIsXray) {
6918 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6919 // we know Xrays have no dynamic unwrap behavior.
6920 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6921 if (!unwrappedObj.ref()) {
6922 return false;
6923 }
6924 }
6925 FastErrorResult rv;
6926 nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result;
6927 // NOTE: This assert does NOT call the function.
6928 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");
6929 MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6930 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence"
)), 0))
) {
6931 return false;
6932 }
6933 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6933); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6933); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6934
6935 uint32_t length = result.Length();
6936 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
6937 if (!returnArray) {
6938 return false;
6939 }
6940 // Scope for 'tmp'
6941 {
6942 JS::Rooted<JS::Value> tmp(cx);
6943 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6944 // Control block to let us common up the JS_DefineElement calls when there
6945 // are different ways to succeed at wrapping the object.
6946 do {
6947 if (!result[sequenceIdx0]) {
6948 tmp.setNull();
6949 break;
6950 }
6951 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) {
6952 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6952); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 6952); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
6953 return false;
6954 }
6955 break;
6956 } while (false);
6957 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6958 JSPROP_ENUMERATE)) {
6959 return false;
6960 }
6961 }
6962 }
6963 args.rval().setObject(*returnArray);
6964 return true;
6965}
6966
6967static const JSJitInfo receiveNullableNonWrapperCacheInterfaceSequence_methodinfo = {
6968 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceSequence },
6969 { prototypes::id::TestJSImplInterface },
6970 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6971 JSJitInfo::Method,
6972 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6973 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6974 false, /* isInfallible. False in setters. */
6975 false, /* isMovable. Not relevant for setters. */
6976 false, /* isEliminatable. Not relevant for setters. */
6977 false, /* isAlwaysInSlot. Only relevant for getters. */
6978 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6979 false, /* isTypedMethod. Only relevant for methods. */
6980 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6981};
6982
6983MOZ_CAN_RUN_SCRIPT static bool
6984receiveNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6985{
6986 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6989( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6987 "TestJSImplInterface", "receiveNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6989( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6988 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6989( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6989 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6989( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6990
6991 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6992 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6993 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6994 if (objIsXray) {
6995 unwrappedObj.emplace(cx, obj);
6996 }
6997 if (objIsXray) {
6998 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6999 // we know Xrays have no dynamic unwrap behavior.
7000 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7001 if (!unwrappedObj.ref()) {
7002 return false;
7003 }
7004 }
7005 FastErrorResult rv;
7006 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result;
7007 // NOTE: This assert does NOT call the function.
7008 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");
7009 MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7010 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence"
)), 0))
) {
7011 return false;
7012 }
7013 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7013); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7013); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7014
7015 if (result.IsNull()) {
7016 args.rval().setNull();
7017 return true;
7018 }
7019
7020 uint32_t length = result.Value().Length();
7021 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
7022 if (!returnArray) {
7023 return false;
7024 }
7025 // Scope for 'tmp'
7026 {
7027 JS::Rooted<JS::Value> tmp(cx);
7028 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
7029 // Control block to let us common up the JS_DefineElement calls when there
7030 // are different ways to succeed at wrapping the object.
7031 do {
7032 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) {
7033 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7033); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7033); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7034 return false;
7035 }
7036 break;
7037 } while (false);
7038 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
7039 JSPROP_ENUMERATE)) {
7040 return false;
7041 }
7042 }
7043 }
7044 args.rval().setObject(*returnArray);
7045 return true;
7046}
7047
7048static const JSJitInfo receiveNonWrapperCacheInterfaceNullableSequence_methodinfo = {
7049 { (JSJitGetterOp)receiveNonWrapperCacheInterfaceNullableSequence },
7050 { prototypes::id::TestJSImplInterface },
7051 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7052 JSJitInfo::Method,
7053 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7054 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7055 false, /* isInfallible. False in setters. */
7056 false, /* isMovable. Not relevant for setters. */
7057 false, /* isEliminatable. Not relevant for setters. */
7058 false, /* isAlwaysInSlot. Only relevant for getters. */
7059 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7060 false, /* isTypedMethod. Only relevant for methods. */
7061 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7062};
7063
7064MOZ_CAN_RUN_SCRIPT static bool
7065receiveNullableNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7066{
7067 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7070( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7068 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7070( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7069 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7070( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7070 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7070( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
7071
7072 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7073 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7074 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7075 if (objIsXray) {
7076 unwrappedObj.emplace(cx, obj);
7077 }
7078 if (objIsXray) {
7079 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7080 // we know Xrays have no dynamic unwrap behavior.
7081 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7082 if (!unwrappedObj.ref()) {
7083 return false;
7084 }
7085 }
7086 FastErrorResult rv;
7087 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result;
7088 // NOTE: This assert does NOT call the function.
7089 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");
7090 MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7091 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence"
)), 0))
) {
7092 return false;
7093 }
7094 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7094); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7094); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7095
7096 if (result.IsNull()) {
7097 args.rval().setNull();
7098 return true;
7099 }
7100
7101 uint32_t length = result.Value().Length();
7102 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
7103 if (!returnArray) {
7104 return false;
7105 }
7106 // Scope for 'tmp'
7107 {
7108 JS::Rooted<JS::Value> tmp(cx);
7109 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
7110 // Control block to let us common up the JS_DefineElement calls when there
7111 // are different ways to succeed at wrapping the object.
7112 do {
7113 if (!result.Value()[sequenceIdx0]) {
7114 tmp.setNull();
7115 break;
7116 }
7117 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) {
7118 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7118); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7118); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7119 return false;
7120 }
7121 break;
7122 } while (false);
7123 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
7124 JSPROP_ENUMERATE)) {
7125 return false;
7126 }
7127 }
7128 }
7129 args.rval().setObject(*returnArray);
7130 return true;
7131}
7132
7133static const JSJitInfo receiveNullableNonWrapperCacheInterfaceNullableSequence_methodinfo = {
7134 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceNullableSequence },
7135 { prototypes::id::TestJSImplInterface },
7136 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7137 JSJitInfo::Method,
7138 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7139 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7140 false, /* isInfallible. False in setters. */
7141 false, /* isMovable. Not relevant for setters. */
7142 false, /* isEliminatable. Not relevant for setters. */
7143 false, /* isAlwaysInSlot. Only relevant for getters. */
7144 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7145 false, /* isTypedMethod. Only relevant for methods. */
7146 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7147};
7148
7149MOZ_CAN_RUN_SCRIPT static bool
7150receiveExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7151{
7152 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7155( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7153 "TestJSImplInterface", "receiveExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7155( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7154 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7155( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7155 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7155( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7156
7157 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7158 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7159 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7160 if (objIsXray) {
7161 unwrappedObj.emplace(cx, obj);
7162 }
7163 if (objIsXray) {
7164 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7165 // we know Xrays have no dynamic unwrap behavior.
7166 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7167 if (!unwrappedObj.ref()) {
7168 return false;
7169 }
7170 }
7171 FastErrorResult rv;
7172 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7173 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveExternal"
)), 0))
) {
7174 return false;
7175 }
7176 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7176); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7177 if (!WrapObject(cx, result, args.rval())) {
7178 return false;
7179 }
7180 return true;
7181}
7182
7183static const JSJitInfo receiveExternal_methodinfo = {
7184 { (JSJitGetterOp)receiveExternal },
7185 { prototypes::id::TestJSImplInterface },
7186 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7187 JSJitInfo::Method,
7188 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7189 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7190 false, /* isInfallible. False in setters. */
7191 false, /* isMovable. Not relevant for setters. */
7192 false, /* isEliminatable. Not relevant for setters. */
7193 false, /* isAlwaysInSlot. Only relevant for getters. */
7194 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7195 false, /* isTypedMethod. Only relevant for methods. */
7196 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7197};
7198
7199MOZ_CAN_RUN_SCRIPT static bool
7200receiveNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7201{
7202 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7205( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7203 "TestJSImplInterface", "receiveNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7205( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7204 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7205( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7205 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7205( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7206
7207 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7208 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7209 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7210 if (objIsXray) {
7211 unwrappedObj.emplace(cx, obj);
7212 }
7213 if (objIsXray) {
7214 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7215 // we know Xrays have no dynamic unwrap behavior.
7216 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7217 if (!unwrappedObj.ref()) {
7218 return false;
7219 }
7220 }
7221 FastErrorResult rv;
7222 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7223 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableExternal"
)), 0))
) {
7224 return false;
7225 }
7226 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7226); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7226); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7227 if (!result) {
7228 args.rval().setNull();
7229 return true;
7230 }
7231 if (!WrapObject(cx, result, args.rval())) {
7232 return false;
7233 }
7234 return true;
7235}
7236
7237static const JSJitInfo receiveNullableExternal_methodinfo = {
7238 { (JSJitGetterOp)receiveNullableExternal },
7239 { prototypes::id::TestJSImplInterface },
7240 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7241 JSJitInfo::Method,
7242 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7243 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7244 false, /* isInfallible. False in setters. */
7245 false, /* isMovable. Not relevant for setters. */
7246 false, /* isEliminatable. Not relevant for setters. */
7247 false, /* isAlwaysInSlot. Only relevant for getters. */
7248 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7249 false, /* isTypedMethod. Only relevant for methods. */
7250 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7251};
7252
7253MOZ_CAN_RUN_SCRIPT static bool
7254receiveWeakExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7255{
7256 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7259( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7257 "TestJSImplInterface", "receiveWeakExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7259( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7258 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7259( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7259 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7259( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7260
7261 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7262 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7263 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7264 if (objIsXray) {
7265 unwrappedObj.emplace(cx, obj);
7266 }
7267 if (objIsXray) {
7268 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7269 // we know Xrays have no dynamic unwrap behavior.
7270 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7271 if (!unwrappedObj.ref()) {
7272 return false;
7273 }
7274 }
7275 FastErrorResult rv;
7276 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7277 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakExternal"
)), 0))
) {
7278 return false;
7279 }
7280 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7280); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7280); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7281 if (!WrapObject(cx, result, args.rval())) {
7282 return false;
7283 }
7284 return true;
7285}
7286
7287static const JSJitInfo receiveWeakExternal_methodinfo = {
7288 { (JSJitGetterOp)receiveWeakExternal },
7289 { prototypes::id::TestJSImplInterface },
7290 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7291 JSJitInfo::Method,
7292 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7293 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7294 false, /* isInfallible. False in setters. */
7295 false, /* isMovable. Not relevant for setters. */
7296 false, /* isEliminatable. Not relevant for setters. */
7297 false, /* isAlwaysInSlot. Only relevant for getters. */
7298 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7299 false, /* isTypedMethod. Only relevant for methods. */
7300 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7301};
7302
7303MOZ_CAN_RUN_SCRIPT static bool
7304receiveWeakNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7305{
7306 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7309( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7307 "TestJSImplInterface", "receiveWeakNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7309( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7308 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7309( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7309 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7309( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7310
7311 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7312 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7313 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7314 if (objIsXray) {
7315 unwrappedObj.emplace(cx, obj);
7316 }
7317 if (objIsXray) {
7318 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7319 // we know Xrays have no dynamic unwrap behavior.
7320 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7321 if (!unwrappedObj.ref()) {
7322 return false;
7323 }
7324 }
7325 FastErrorResult rv;
7326 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7327 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableExternal"
)), 0))
) {
7328 return false;
7329 }
7330 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7330); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7330); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7331 if (!result) {
7332 args.rval().setNull();
7333 return true;
7334 }
7335 if (!WrapObject(cx, result, args.rval())) {
7336 return false;
7337 }
7338 return true;
7339}
7340
7341static const JSJitInfo receiveWeakNullableExternal_methodinfo = {
7342 { (JSJitGetterOp)receiveWeakNullableExternal },
7343 { prototypes::id::TestJSImplInterface },
7344 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7345 JSJitInfo::Method,
7346 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7347 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7348 false, /* isInfallible. False in setters. */
7349 false, /* isMovable. Not relevant for setters. */
7350 false, /* isEliminatable. Not relevant for setters. */
7351 false, /* isAlwaysInSlot. Only relevant for getters. */
7352 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7353 false, /* isTypedMethod. Only relevant for methods. */
7354 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7355};
7356
7357MOZ_CAN_RUN_SCRIPT static bool
7358passExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7359{
7360 BindingCallContext cx(cx_, "TestJSImplInterface.passExternal");
7361 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7364( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7362 "TestJSImplInterface", "passExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7364( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7363 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7364( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7364 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7364( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7365
7366 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7367 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternal", 1)) {
7368 return false;
7369 }
7370 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7371 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7372 if (objIsXray) {
7373 unwrappedObj.emplace(cx, obj);
7374 }
7375 mozilla::dom::TestExternalInterface* arg0;
7376 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7377 if (args[0].isObject()) {
7378 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7379 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)))
) {
7380 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7381 return false;
7382 }
7383 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"
, 7383); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { MOZ_CrashSequence(__null, 7383); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7384 arg0 = arg0_holder;
7385 } else {
7386 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7387 return false;
7388 }
7389 if (objIsXray) {
7390 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7391 // we know Xrays have no dynamic unwrap behavior.
7392 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7393 if (!unwrappedObj.ref()) {
7394 return false;
7395 }
7396 }
7397 FastErrorResult rv;
7398 // NOTE: This assert does NOT call the function.
7399 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");
7400 MOZ_KnownLive(self)(self)->PassExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7401 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternal"
)), 0))
) {
7402 return false;
7403 }
7404 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7404); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7404); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7405 args.rval().setUndefined();
7406 return true;
7407}
7408
7409static const JSJitInfo passExternal_methodinfo = {
7410 { (JSJitGetterOp)passExternal },
7411 { prototypes::id::TestJSImplInterface },
7412 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7413 JSJitInfo::Method,
7414 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7415 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7416 false, /* isInfallible. False in setters. */
7417 false, /* isMovable. Not relevant for setters. */
7418 false, /* isEliminatable. Not relevant for setters. */
7419 false, /* isAlwaysInSlot. Only relevant for getters. */
7420 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7421 false, /* isTypedMethod. Only relevant for methods. */
7422 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7423};
7424
7425MOZ_CAN_RUN_SCRIPT static bool
7426passNullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7427{
7428 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternal");
7429 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7432( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7430 "TestJSImplInterface", "passNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7432( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7431 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7432( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7432 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7432( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7433
7434 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7435 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternal", 1)) {
7436 return false;
7437 }
7438 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7439 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7440 if (objIsXray) {
7441 unwrappedObj.emplace(cx, obj);
7442 }
7443 mozilla::dom::TestExternalInterface* arg0;
7444 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7445 if (args[0].isObject()) {
7446 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7447 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)))
) {
7448 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7449 return false;
7450 }
7451 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"
, 7451); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { MOZ_CrashSequence(__null, 7451); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7452 arg0 = arg0_holder;
7453 } else if (args[0].isNullOrUndefined()) {
7454 arg0 = nullptr;
7455 } else {
7456 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7457 return false;
7458 }
7459 if (objIsXray) {
7460 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7461 // we know Xrays have no dynamic unwrap behavior.
7462 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7463 if (!unwrappedObj.ref()) {
7464 return false;
7465 }
7466 }
7467 FastErrorResult rv;
7468 // NOTE: This assert does NOT call the function.
7469 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");
7470 MOZ_KnownLive(self)(self)->PassNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7471 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternal"
)), 0))
) {
7472 return false;
7473 }
7474 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7474); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7474); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7475 args.rval().setUndefined();
7476 return true;
7477}
7478
7479static const JSJitInfo passNullableExternal_methodinfo = {
7480 { (JSJitGetterOp)passNullableExternal },
7481 { prototypes::id::TestJSImplInterface },
7482 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7483 JSJitInfo::Method,
7484 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7485 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7486 false, /* isInfallible. False in setters. */
7487 false, /* isMovable. Not relevant for setters. */
7488 false, /* isEliminatable. Not relevant for setters. */
7489 false, /* isAlwaysInSlot. Only relevant for getters. */
7490 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7491 false, /* isTypedMethod. Only relevant for methods. */
7492 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7493};
7494
7495MOZ_CAN_RUN_SCRIPT static bool
7496get_nonNullExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
7497{
7498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7501( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7499 "TestJSImplInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7501( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7501( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7501( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7502
7503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7504 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7505 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7506 if (objIsXray) {
7507 unwrappedObj.emplace(cx, obj);
7508 }
7509 if (objIsXray) {
7510 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7511 // we know Xrays have no dynamic unwrap behavior.
7512 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7513 if (!unwrappedObj.ref()) {
7514 return false;
7515 }
7516 }
7517 FastErrorResult rv;
7518 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->GetNonNullExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7519 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal getter"
)), 0))
) {
7520 return false;
7521 }
7522 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7522); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7522); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7523 if (!WrapObject(cx, result, args.rval())) {
7524 return false;
7525 }
7526 return true;
7527}
7528
7529MOZ_CAN_RUN_SCRIPT static bool
7530set_nonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
7531{
7532 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullExternal setter");
7533 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7536( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7534 "TestJSImplInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7536( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7535 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7536( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7536 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7536( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7537
7538 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7539 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7540 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7541 if (objIsXray) {
7542 unwrappedObj.emplace(cx, obj);
7543 }
7544 mozilla::dom::TestExternalInterface* arg0;
7545 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7546 if (args[0].isObject()) {
7547 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7548 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)))
) {
7549 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface");
7550 return false;
7551 }
7552 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"
, 7552); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { MOZ_CrashSequence(__null, 7552); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7553 arg0 = arg0_holder;
7554 } else {
7555 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
7556 return false;
7557 }
7558 if (objIsXray) {
7559 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7560 // we know Xrays have no dynamic unwrap behavior.
7561 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7562 if (!unwrappedObj.ref()) {
7563 return false;
7564 }
7565 }
7566 FastErrorResult rv;
7567 // NOTE: This assert does NOT call the function.
7568 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");
7569 MOZ_KnownLive(self)(self)->SetNonNullExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7570 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal setter"
)), 0))
) {
7571 return false;
7572 }
7573 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7573); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7573); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7574
7575 return true;
7576}
7577
7578static const JSJitInfo nonNullExternal_getterinfo = {
7579 { get_nonNullExternal },
7580 { prototypes::id::TestJSImplInterface },
7581 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7582 JSJitInfo::Getter,
7583 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7584 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7585 false, /* isInfallible. False in setters. */
7586 false, /* isMovable. Not relevant for setters. */
7587 false, /* isEliminatable. Not relevant for setters. */
7588 false, /* isAlwaysInSlot. Only relevant for getters. */
7589 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7590 false, /* isTypedMethod. Only relevant for methods. */
7591 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7592};
7593static const JSJitInfo nonNullExternal_setterinfo = {
7594 { (JSJitGetterOp)set_nonNullExternal },
7595 { prototypes::id::TestJSImplInterface },
7596 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7597 JSJitInfo::Setter,
7598 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7599 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7600 false, /* isInfallible. False in setters. */
7601 false, /* isMovable. Not relevant for setters. */
7602 false, /* isEliminatable. Not relevant for setters. */
7603 false, /* isAlwaysInSlot. Only relevant for getters. */
7604 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7605 false, /* isTypedMethod. Only relevant for methods. */
7606 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7607};
7608
7609MOZ_CAN_RUN_SCRIPT static bool
7610get_nullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
7611{
7612 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7615( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7613 "TestJSImplInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7615( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7614 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7615( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7615 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7615( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7616
7617 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7618 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7619 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7620 if (objIsXray) {
7621 unwrappedObj.emplace(cx, obj);
7622 }
7623 if (objIsXray) {
7624 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7625 // we know Xrays have no dynamic unwrap behavior.
7626 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7627 if (!unwrappedObj.ref()) {
7628 return false;
7629 }
7630 }
7631 FastErrorResult rv;
7632 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->GetNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7633 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal getter"
)), 0))
) {
7634 return false;
7635 }
7636 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7636); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7636); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7637 if (!result) {
7638 args.rval().setNull();
7639 return true;
7640 }
7641 if (!WrapObject(cx, result, args.rval())) {
7642 return false;
7643 }
7644 return true;
7645}
7646
7647MOZ_CAN_RUN_SCRIPT static bool
7648set_nullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
7649{
7650 BindingCallContext cx(cx_, "TestJSImplInterface.nullableExternal setter");
7651 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7654( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7652 "TestJSImplInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7654( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7653 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7654( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7654 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7654( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7655
7656 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7657 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7658 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7659 if (objIsXray) {
7660 unwrappedObj.emplace(cx, obj);
7661 }
7662 mozilla::dom::TestExternalInterface* arg0;
7663 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7664 if (args[0].isObject()) {
7665 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7666 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)))
) {
7667 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface");
7668 return false;
7669 }
7670 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"
, 7670); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { MOZ_CrashSequence(__null, 7670); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7671 arg0 = arg0_holder;
7672 } else if (args[0].isNullOrUndefined()) {
7673 arg0 = nullptr;
7674 } else {
7675 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
7676 return false;
7677 }
7678 if (objIsXray) {
7679 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7680 // we know Xrays have no dynamic unwrap behavior.
7681 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7682 if (!unwrappedObj.ref()) {
7683 return false;
7684 }
7685 }
7686 FastErrorResult rv;
7687 // NOTE: This assert does NOT call the function.
7688 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");
7689 MOZ_KnownLive(self)(self)->SetNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7690 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal setter"
)), 0))
) {
7691 return false;
7692 }
7693 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7693); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7693); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7694
7695 return true;
7696}
7697
7698static const JSJitInfo nullableExternal_getterinfo = {
7699 { get_nullableExternal },
7700 { prototypes::id::TestJSImplInterface },
7701 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7702 JSJitInfo::Getter,
7703 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7704 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7705 false, /* isInfallible. False in setters. */
7706 false, /* isMovable. Not relevant for setters. */
7707 false, /* isEliminatable. Not relevant for setters. */
7708 false, /* isAlwaysInSlot. Only relevant for getters. */
7709 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7710 false, /* isTypedMethod. Only relevant for methods. */
7711 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7712};
7713static const JSJitInfo nullableExternal_setterinfo = {
7714 { (JSJitGetterOp)set_nullableExternal },
7715 { prototypes::id::TestJSImplInterface },
7716 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7717 JSJitInfo::Setter,
7718 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7719 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7720 false, /* isInfallible. False in setters. */
7721 false, /* isMovable. Not relevant for setters. */
7722 false, /* isEliminatable. Not relevant for setters. */
7723 false, /* isAlwaysInSlot. Only relevant for getters. */
7724 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7725 false, /* isTypedMethod. Only relevant for methods. */
7726 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7727};
7728
7729MOZ_CAN_RUN_SCRIPT static bool
7730passOptionalExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7731{
7732 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalExternal");
7733 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7736( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7734 "TestJSImplInterface", "passOptionalExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7736( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7735 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7736( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7736 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7736( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7737
7738 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7739 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7740 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7741 if (objIsXray) {
7742 unwrappedObj.emplace(cx, obj);
7743 }
7744 Optional<mozilla::dom::TestExternalInterface*> arg0;
7745 Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder;
7746 if (args.hasDefined(0)) {
7747 arg0.Construct();
7748 arg0_holder.emplace();
7749 if (args[0].isObject()) {
7750 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7751 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)))
) {
7752 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7753 return false;
7754 }
7755 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", 7755); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { MOZ_CrashSequence
(__null, 7755); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7756 arg0.Value() = arg0_holder.ref();
7757 } else if (args[0].isNullOrUndefined()) {
7758 arg0.Value() = nullptr;
7759 } else {
7760 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7761 return false;
7762 }
7763 }
7764 if (objIsXray) {
7765 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7766 // we know Xrays have no dynamic unwrap behavior.
7767 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7768 if (!unwrappedObj.ref()) {
7769 return false;
7770 }
7771 }
7772 FastErrorResult rv;
7773 // NOTE: This assert does NOT call the function.
7774 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");
7775 MOZ_KnownLive(self)(self)->PassOptionalExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7776 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternal"
)), 0))
) {
7777 return false;
7778 }
7779 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7779); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7779); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7780 args.rval().setUndefined();
7781 return true;
7782}
7783
7784static const JSJitInfo passOptionalExternal_methodinfo = {
7785 { (JSJitGetterOp)passOptionalExternal },
7786 { prototypes::id::TestJSImplInterface },
7787 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7788 JSJitInfo::Method,
7789 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7790 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7791 false, /* isInfallible. False in setters. */
7792 false, /* isMovable. Not relevant for setters. */
7793 false, /* isEliminatable. Not relevant for setters. */
7794 false, /* isAlwaysInSlot. Only relevant for getters. */
7795 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7796 false, /* isTypedMethod. Only relevant for methods. */
7797 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7798};
7799
7800MOZ_CAN_RUN_SCRIPT static bool
7801passOptionalNonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7802{
7803 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullExternal");
7804 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7807( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7805 "TestJSImplInterface", "passOptionalNonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7807( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7806 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7807( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7807 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7807( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7808
7809 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7810 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7811 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7812 if (objIsXray) {
7813 unwrappedObj.emplace(cx, obj);
7814 }
7815 Optional<mozilla::dom::TestExternalInterface*> arg0;
7816 Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder;
7817 if (args.hasDefined(0)) {
7818 arg0.Construct();
7819 arg0_holder.emplace();
7820 if (args[0].isObject()) {
7821 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7822 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)))
) {
7823 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7824 return false;
7825 }
7826 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", 7826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { MOZ_CrashSequence
(__null, 7826); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7827 arg0.Value() = arg0_holder.ref();
7828 } else {
7829 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7830 return false;
7831 }
7832 }
7833 if (objIsXray) {
7834 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7835 // we know Xrays have no dynamic unwrap behavior.
7836 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7837 if (!unwrappedObj.ref()) {
7838 return false;
7839 }
7840 }
7841 FastErrorResult rv;
7842 // NOTE: This assert does NOT call the function.
7843 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");
7844 MOZ_KnownLive(self)(self)->PassOptionalNonNullExternal(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7845 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullExternal"
)), 0))
) {
7846 return false;
7847 }
7848 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7848); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7848); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7849 args.rval().setUndefined();
7850 return true;
7851}
7852
7853static const JSJitInfo passOptionalNonNullExternal_methodinfo = {
7854 { (JSJitGetterOp)passOptionalNonNullExternal },
7855 { prototypes::id::TestJSImplInterface },
7856 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7857 JSJitInfo::Method,
7858 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7859 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7860 false, /* isInfallible. False in setters. */
7861 false, /* isMovable. Not relevant for setters. */
7862 false, /* isEliminatable. Not relevant for setters. */
7863 false, /* isAlwaysInSlot. Only relevant for getters. */
7864 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7865 false, /* isTypedMethod. Only relevant for methods. */
7866 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7867};
7868
7869MOZ_CAN_RUN_SCRIPT static bool
7870passOptionalExternalWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7871{
7872 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalExternalWithDefault");
7873 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7876( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7874 "TestJSImplInterface", "passOptionalExternalWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7876( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7875 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7876( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7876 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7876( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7877
7878 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7879 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7880 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7881 if (objIsXray) {
7882 unwrappedObj.emplace(cx, obj);
7883 }
7884 mozilla::dom::TestExternalInterface* arg0;
7885 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7886 if (args.hasDefined(0)) {
7887 if (args[0].isObject()) {
7888 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7889 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)))
) {
7890 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7891 return false;
7892 }
7893 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"
, 7893); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { MOZ_CrashSequence(__null, 7893); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7894 arg0 = arg0_holder;
7895 } else if (args[0].isNullOrUndefined()) {
7896 arg0 = nullptr;
7897 } else {
7898 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7899 return false;
7900 }
7901 } else {
7902 arg0 = nullptr;
7903 }
7904 if (objIsXray) {
7905 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7906 // we know Xrays have no dynamic unwrap behavior.
7907 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7908 if (!unwrappedObj.ref()) {
7909 return false;
7910 }
7911 }
7912 FastErrorResult rv;
7913 // NOTE: This assert does NOT call the function.
7914 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");
7915 MOZ_KnownLive(self)(self)->PassOptionalExternalWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7916 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternalWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternalWithDefault"
)), 0))
) {
7917 return false;
7918 }
7919 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7919); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7919); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7920 args.rval().setUndefined();
7921 return true;
7922}
7923
7924static const JSJitInfo passOptionalExternalWithDefault_methodinfo = {
7925 { (JSJitGetterOp)passOptionalExternalWithDefault },
7926 { prototypes::id::TestJSImplInterface },
7927 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7928 JSJitInfo::Method,
7929 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7930 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7931 false, /* isInfallible. False in setters. */
7932 false, /* isMovable. Not relevant for setters. */
7933 false, /* isEliminatable. Not relevant for setters. */
7934 false, /* isAlwaysInSlot. Only relevant for getters. */
7935 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7936 false, /* isTypedMethod. Only relevant for methods. */
7937 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7938};
7939
7940MOZ_CAN_RUN_SCRIPT static bool
7941receiveCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7942{
7943 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7946( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7944 "TestJSImplInterface", "receiveCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7946( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7945 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7946( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7946 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7946( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7947
7948 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7949 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7950 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7951 if (objIsXray) {
7952 unwrappedObj.emplace(cx, obj);
7953 }
7954 if (objIsXray) {
7955 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7956 // we know Xrays have no dynamic unwrap behavior.
7957 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7958 if (!unwrappedObj.ref()) {
7959 return false;
7960 }
7961 }
7962 FastErrorResult rv;
7963 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7964 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackInterface"
)), 0))
) {
7965 return false;
7966 }
7967 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 7967); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7968 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7969 if (!MaybeWrapObjectValue(cx, args.rval())) {
7970 return false;
7971 }
7972 return true;
7973}
7974
7975static const JSJitInfo receiveCallbackInterface_methodinfo = {
7976 { (JSJitGetterOp)receiveCallbackInterface },
7977 { prototypes::id::TestJSImplInterface },
7978 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7979 JSJitInfo::Method,
7980 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7981 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7982 false, /* isInfallible. False in setters. */
7983 false, /* isMovable. Not relevant for setters. */
7984 false, /* isEliminatable. Not relevant for setters. */
7985 false, /* isAlwaysInSlot. Only relevant for getters. */
7986 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7987 false, /* isTypedMethod. Only relevant for methods. */
7988 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7989};
7990
7991MOZ_CAN_RUN_SCRIPT static bool
7992receiveNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7993{
7994 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7997( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7995 "TestJSImplInterface", "receiveNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7997( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7996 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7997( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7997 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7997( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7998
7999 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8000 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8001 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8002 if (objIsXray) {
8003 unwrappedObj.emplace(cx, obj);
8004 }
8005 if (objIsXray) {
8006 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8007 // we know Xrays have no dynamic unwrap behavior.
8008 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8009 if (!unwrappedObj.ref()) {
8010 return false;
8011 }
8012 }
8013 FastErrorResult rv;
8014 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8015 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackInterface"
)), 0))
) {
8016 return false;
8017 }
8018 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8018); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8018); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8019 if (result) {
8020 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8021 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8022 return false;
8023 }
8024 return true;
8025 } else {
8026 args.rval().setNull();
8027 return true;
8028 }
8029}
8030
8031static const JSJitInfo receiveNullableCallbackInterface_methodinfo = {
8032 { (JSJitGetterOp)receiveNullableCallbackInterface },
8033 { prototypes::id::TestJSImplInterface },
8034 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8035 JSJitInfo::Method,
8036 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8037 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8038 false, /* isInfallible. False in setters. */
8039 false, /* isMovable. Not relevant for setters. */
8040 false, /* isEliminatable. Not relevant for setters. */
8041 false, /* isAlwaysInSlot. Only relevant for getters. */
8042 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8043 false, /* isTypedMethod. Only relevant for methods. */
8044 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8045};
8046
8047MOZ_CAN_RUN_SCRIPT static bool
8048receiveWeakCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8049{
8050 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8053( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8051 "TestJSImplInterface", "receiveWeakCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8053( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8052 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8053( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8053 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8053( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8054
8055 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8056 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8057 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8058 if (objIsXray) {
8059 unwrappedObj.emplace(cx, obj);
8060 }
8061 if (objIsXray) {
8062 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8063 // we know Xrays have no dynamic unwrap behavior.
8064 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8065 if (!unwrappedObj.ref()) {
8066 return false;
8067 }
8068 }
8069 FastErrorResult rv;
8070 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8071 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCallbackInterface"
)), 0))
) {
8072 return false;
8073 }
8074 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8074); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8074); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8075 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8076 if (!MaybeWrapObjectValue(cx, args.rval())) {
8077 return false;
8078 }
8079 return true;
8080}
8081
8082static const JSJitInfo receiveWeakCallbackInterface_methodinfo = {
8083 { (JSJitGetterOp)receiveWeakCallbackInterface },
8084 { prototypes::id::TestJSImplInterface },
8085 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8086 JSJitInfo::Method,
8087 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8088 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8089 false, /* isInfallible. False in setters. */
8090 false, /* isMovable. Not relevant for setters. */
8091 false, /* isEliminatable. Not relevant for setters. */
8092 false, /* isAlwaysInSlot. Only relevant for getters. */
8093 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8094 false, /* isTypedMethod. Only relevant for methods. */
8095 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8096};
8097
8098MOZ_CAN_RUN_SCRIPT static bool
8099receiveWeakNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8100{
8101 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8104( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8102 "TestJSImplInterface", "receiveWeakNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8104( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8103 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8104( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8104 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8104( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8105
8106 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8109 if (objIsXray) {
8110 unwrappedObj.emplace(cx, obj);
8111 }
8112 if (objIsXray) {
8113 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8114 // we know Xrays have no dynamic unwrap behavior.
8115 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8116 if (!unwrappedObj.ref()) {
8117 return false;
8118 }
8119 }
8120 FastErrorResult rv;
8121 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8122 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCallbackInterface"
)), 0))
) {
8123 return false;
8124 }
8125 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8125); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8125); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8126 if (result) {
8127 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8128 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8129 return false;
8130 }
8131 return true;
8132 } else {
8133 args.rval().setNull();
8134 return true;
8135 }
8136}
8137
8138static const JSJitInfo receiveWeakNullableCallbackInterface_methodinfo = {
8139 { (JSJitGetterOp)receiveWeakNullableCallbackInterface },
8140 { prototypes::id::TestJSImplInterface },
8141 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8142 JSJitInfo::Method,
8143 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8144 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8145 false, /* isInfallible. False in setters. */
8146 false, /* isMovable. Not relevant for setters. */
8147 false, /* isEliminatable. Not relevant for setters. */
8148 false, /* isAlwaysInSlot. Only relevant for getters. */
8149 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8150 false, /* isTypedMethod. Only relevant for methods. */
8151 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8152};
8153
8154MOZ_CAN_RUN_SCRIPT static bool
8155passCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8156{
8157 BindingCallContext cx(cx_, "TestJSImplInterface.passCallbackInterface");
8158 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8161( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8159 "TestJSImplInterface", "passCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8161( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8160 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8161( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8161 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8161( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8162
8163 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8164 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCallbackInterface", 1)) {
8165 return false;
8166 }
8167 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8168 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8169 if (objIsXray) {
8170 unwrappedObj.emplace(cx, obj);
8171 }
8172 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
8173 if (args[0].isObject()) {
8174 { // scope for tempRoot and tempGlobalRoot if needed
8175 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8176 }
8177 } else {
8178 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8179 return false;
8180 }
8181 if (objIsXray) {
8182 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8183 // we know Xrays have no dynamic unwrap behavior.
8184 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8185 if (!unwrappedObj.ref()) {
8186 return false;
8187 }
8188 }
8189 FastErrorResult rv;
8190 // NOTE: This assert does NOT call the function.
8191 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");
8192 MOZ_KnownLive(self)(self)->PassCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8193 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallbackInterface"
)), 0))
) {
8194 return false;
8195 }
8196 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8196); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8196); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8197 args.rval().setUndefined();
8198 return true;
8199}
8200
8201static const JSJitInfo passCallbackInterface_methodinfo = {
8202 { (JSJitGetterOp)passCallbackInterface },
8203 { prototypes::id::TestJSImplInterface },
8204 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8205 JSJitInfo::Method,
8206 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8207 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8208 false, /* isInfallible. False in setters. */
8209 false, /* isMovable. Not relevant for setters. */
8210 false, /* isEliminatable. Not relevant for setters. */
8211 false, /* isAlwaysInSlot. Only relevant for getters. */
8212 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8213 false, /* isTypedMethod. Only relevant for methods. */
8214 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8215};
8216
8217MOZ_CAN_RUN_SCRIPT static bool
8218passNullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8219{
8220 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCallbackInterface");
8221 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8224( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8222 "TestJSImplInterface", "passNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8224( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8223 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8224( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8224 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8224( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8225
8226 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8227 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCallbackInterface", 1)) {
8228 return false;
8229 }
8230 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8231 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8232 if (objIsXray) {
8233 unwrappedObj.emplace(cx, obj);
8234 }
8235 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8236 if (args[0].isObject()) {
8237 { // scope for tempRoot and tempGlobalRoot if needed
8238 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8239 }
8240 } else if (args[0].isNullOrUndefined()) {
8241 arg0 = nullptr;
8242 } else {
8243 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8244 return false;
8245 }
8246 if (objIsXray) {
8247 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8248 // we know Xrays have no dynamic unwrap behavior.
8249 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8250 if (!unwrappedObj.ref()) {
8251 return false;
8252 }
8253 }
8254 FastErrorResult rv;
8255 // NOTE: This assert does NOT call the function.
8256 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");
8257 MOZ_KnownLive(self)(self)->PassNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8258 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallbackInterface"
)), 0))
) {
8259 return false;
8260 }
8261 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8261); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8261); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8262 args.rval().setUndefined();
8263 return true;
8264}
8265
8266static const JSJitInfo passNullableCallbackInterface_methodinfo = {
8267 { (JSJitGetterOp)passNullableCallbackInterface },
8268 { prototypes::id::TestJSImplInterface },
8269 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8270 JSJitInfo::Method,
8271 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8272 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8273 false, /* isInfallible. False in setters. */
8274 false, /* isMovable. Not relevant for setters. */
8275 false, /* isEliminatable. Not relevant for setters. */
8276 false, /* isAlwaysInSlot. Only relevant for getters. */
8277 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8278 false, /* isTypedMethod. Only relevant for methods. */
8279 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8280};
8281
8282MOZ_CAN_RUN_SCRIPT static bool
8283get_nonNullCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
8284{
8285 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8288( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8286 "TestJSImplInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8288( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8287 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8288( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8288 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8288( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8289
8290 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8291 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8292 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8293 if (objIsXray) {
8294 unwrappedObj.emplace(cx, obj);
8295 }
8296 if (objIsXray) {
8297 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8298 // we know Xrays have no dynamic unwrap behavior.
8299 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8300 if (!unwrappedObj.ref()) {
8301 return false;
8302 }
8303 }
8304 FastErrorResult rv;
8305 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetNonNullCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8306 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface getter"
)), 0))
) {
8307 return false;
8308 }
8309 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8309); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8310 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8311 if (!MaybeWrapObjectValue(cx, args.rval())) {
8312 return false;
8313 }
8314 return true;
8315}
8316
8317MOZ_CAN_RUN_SCRIPT static bool
8318set_nonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
8319{
8320 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullCallbackInterface setter");
8321 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8324( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8322 "TestJSImplInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8324( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8323 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject8324( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8324 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8324( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8325
8326 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8327 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8328 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8329 if (objIsXray) {
8330 unwrappedObj.emplace(cx, obj);
8331 }
8332 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
8333 if (args[0].isObject()) {
8334 { // scope for tempRoot and tempGlobalRoot if needed
8335 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8336 }
8337 } else {
8338 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
8339 return false;
8340 }
8341 if (objIsXray) {
8342 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8343 // we know Xrays have no dynamic unwrap behavior.
8344 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8345 if (!unwrappedObj.ref()) {
8346 return false;
8347 }
8348 }
8349 FastErrorResult rv;
8350 // NOTE: This assert does NOT call the function.
8351 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");
8352 MOZ_KnownLive(self)(self)->SetNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8353 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface setter"
)), 0))
) {
8354 return false;
8355 }
8356 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8356); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8356); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8357
8358 return true;
8359}
8360
8361static const JSJitInfo nonNullCallbackInterface_getterinfo = {
8362 { get_nonNullCallbackInterface },
8363 { prototypes::id::TestJSImplInterface },
8364 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8365 JSJitInfo::Getter,
8366 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8367 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8368 false, /* isInfallible. False in setters. */
8369 false, /* isMovable. Not relevant for setters. */
8370 false, /* isEliminatable. Not relevant for setters. */
8371 false, /* isAlwaysInSlot. Only relevant for getters. */
8372 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8373 false, /* isTypedMethod. Only relevant for methods. */
8374 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8375};
8376static const JSJitInfo nonNullCallbackInterface_setterinfo = {
8377 { (JSJitGetterOp)set_nonNullCallbackInterface },
8378 { prototypes::id::TestJSImplInterface },
8379 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8380 JSJitInfo::Setter,
8381 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8382 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8383 false, /* isInfallible. False in setters. */
8384 false, /* isMovable. Not relevant for setters. */
8385 false, /* isEliminatable. Not relevant for setters. */
8386 false, /* isAlwaysInSlot. Only relevant for getters. */
8387 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8388 false, /* isTypedMethod. Only relevant for methods. */
8389 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8390};
8391
8392MOZ_CAN_RUN_SCRIPT static bool
8393get_nullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
8394{
8395 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8398( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8396 "TestJSImplInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8398( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8397 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8398( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8398 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8398( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8399
8400 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8401 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8402 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8403 if (objIsXray) {
8404 unwrappedObj.emplace(cx, obj);
8405 }
8406 if (objIsXray) {
8407 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8408 // we know Xrays have no dynamic unwrap behavior.
8409 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8410 if (!unwrappedObj.ref()) {
8411 return false;
8412 }
8413 }
8414 FastErrorResult rv;
8415 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8416 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface getter"
)), 0))
) {
8417 return false;
8418 }
8419 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8419); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8420 if (result) {
8421 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8422 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8423 return false;
8424 }
8425 return true;
8426 } else {
8427 args.rval().setNull();
8428 return true;
8429 }
8430}
8431
8432MOZ_CAN_RUN_SCRIPT static bool
8433set_nullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
8434{
8435 BindingCallContext cx(cx_, "TestJSImplInterface.nullableCallbackInterface setter");
8436 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8439( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8437 "TestJSImplInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8439( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8438 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject8439( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8439 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8439( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8440
8441 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8442 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8443 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8444 if (objIsXray) {
8445 unwrappedObj.emplace(cx, obj);
8446 }
8447 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8448 if (args[0].isObject()) {
8449 { // scope for tempRoot and tempGlobalRoot if needed
8450 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8451 }
8452 } else if (args[0].isNullOrUndefined()) {
8453 arg0 = nullptr;
8454 } else {
8455 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
8456 return false;
8457 }
8458 if (objIsXray) {
8459 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8460 // we know Xrays have no dynamic unwrap behavior.
8461 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8462 if (!unwrappedObj.ref()) {
8463 return false;
8464 }
8465 }
8466 FastErrorResult rv;
8467 // NOTE: This assert does NOT call the function.
8468 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");
8469 MOZ_KnownLive(self)(self)->SetNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface setter"
)), 0))
) {
8471 return false;
8472 }
8473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8473); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8474
8475 return true;
8476}
8477
8478static const JSJitInfo nullableCallbackInterface_getterinfo = {
8479 { get_nullableCallbackInterface },
8480 { prototypes::id::TestJSImplInterface },
8481 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8482 JSJitInfo::Getter,
8483 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8484 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8485 false, /* isInfallible. False in setters. */
8486 false, /* isMovable. Not relevant for setters. */
8487 false, /* isEliminatable. Not relevant for setters. */
8488 false, /* isAlwaysInSlot. Only relevant for getters. */
8489 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8490 false, /* isTypedMethod. Only relevant for methods. */
8491 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8492};
8493static const JSJitInfo nullableCallbackInterface_setterinfo = {
8494 { (JSJitGetterOp)set_nullableCallbackInterface },
8495 { prototypes::id::TestJSImplInterface },
8496 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8497 JSJitInfo::Setter,
8498 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8499 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8500 false, /* isInfallible. False in setters. */
8501 false, /* isMovable. Not relevant for setters. */
8502 false, /* isEliminatable. Not relevant for setters. */
8503 false, /* isAlwaysInSlot. Only relevant for getters. */
8504 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8505 false, /* isTypedMethod. Only relevant for methods. */
8506 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8507};
8508
8509MOZ_CAN_RUN_SCRIPT static bool
8510passOptionalCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8511{
8512 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallbackInterface");
8513 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8516( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8514 "TestJSImplInterface", "passOptionalCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8516( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8515 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8516( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8516 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8516( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8517
8518 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8519 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8520 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8521 if (objIsXray) {
8522 unwrappedObj.emplace(cx, obj);
8523 }
8524 Optional<RefPtr<TestCallbackInterface>> arg0;
8525 if (args.hasDefined(0)) {
8526 arg0.Construct();
8527 if (args[0].isObject()) {
8528 { // scope for tempRoot and tempGlobalRoot if needed
8529 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
8530 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
8531 arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
8532 }
8533 } else if (args[0].isNullOrUndefined()) {
8534 arg0.Value() = nullptr;
8535 } else {
8536 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8537 return false;
8538 }
8539 }
8540 if (objIsXray) {
8541 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8542 // we know Xrays have no dynamic unwrap behavior.
8543 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8544 if (!unwrappedObj.ref()) {
8545 return false;
8546 }
8547 }
8548 FastErrorResult rv;
8549 // NOTE: This assert does NOT call the function.
8550 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");
8551 MOZ_KnownLive(self)(self)->PassOptionalCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8552 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterface"
)), 0))
) {
8553 return false;
8554 }
8555 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8555); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8555); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8556 args.rval().setUndefined();
8557 return true;
8558}
8559
8560static const JSJitInfo passOptionalCallbackInterface_methodinfo = {
8561 { (JSJitGetterOp)passOptionalCallbackInterface },
8562 { prototypes::id::TestJSImplInterface },
8563 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8564 JSJitInfo::Method,
8565 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8566 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8567 false, /* isInfallible. False in setters. */
8568 false, /* isMovable. Not relevant for setters. */
8569 false, /* isEliminatable. Not relevant for setters. */
8570 false, /* isAlwaysInSlot. Only relevant for getters. */
8571 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8572 false, /* isTypedMethod. Only relevant for methods. */
8573 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8574};
8575
8576MOZ_CAN_RUN_SCRIPT static bool
8577passOptionalNonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8578{
8579 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullCallbackInterface");
8580 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8583( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8581 "TestJSImplInterface", "passOptionalNonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8583( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8582 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8583( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8583 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8583( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8584
8585 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8586 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8587 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8588 if (objIsXray) {
8589 unwrappedObj.emplace(cx, obj);
8590 }
8591 Optional<OwningNonNull<TestCallbackInterface>> arg0;
8592 if (args.hasDefined(0)) {
8593 arg0.Construct();
8594 if (args[0].isObject()) {
8595 { // scope for tempRoot and tempGlobalRoot if needed
8596 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
8597 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
8598 arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
8599 }
8600 } else {
8601 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8602 return false;
8603 }
8604 }
8605 if (objIsXray) {
8606 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8607 // we know Xrays have no dynamic unwrap behavior.
8608 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8609 if (!unwrappedObj.ref()) {
8610 return false;
8611 }
8612 }
8613 FastErrorResult rv;
8614 // NOTE: This assert does NOT call the function.
8615 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");
8616 MOZ_KnownLive(self)(self)->PassOptionalNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8617 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullCallbackInterface"
)), 0))
) {
8618 return false;
8619 }
8620 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8620); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8620); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8621 args.rval().setUndefined();
8622 return true;
8623}
8624
8625static const JSJitInfo passOptionalNonNullCallbackInterface_methodinfo = {
8626 { (JSJitGetterOp)passOptionalNonNullCallbackInterface },
8627 { prototypes::id::TestJSImplInterface },
8628 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8629 JSJitInfo::Method,
8630 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8631 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8632 false, /* isInfallible. False in setters. */
8633 false, /* isMovable. Not relevant for setters. */
8634 false, /* isEliminatable. Not relevant for setters. */
8635 false, /* isAlwaysInSlot. Only relevant for getters. */
8636 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8637 false, /* isTypedMethod. Only relevant for methods. */
8638 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8639};
8640
8641MOZ_CAN_RUN_SCRIPT static bool
8642passOptionalCallbackInterfaceWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8643{
8644 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault");
8645 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8648( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8646 "TestJSImplInterface", "passOptionalCallbackInterfaceWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8648( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8647 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8648( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8648 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8648( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8649
8650 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8651 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8652 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8653 if (objIsXray) {
8654 unwrappedObj.emplace(cx, obj);
8655 }
8656 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8657 if (args.hasDefined(0)) {
8658 if (args[0].isObject()) {
8659 { // scope for tempRoot and tempGlobalRoot if needed
8660 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8661 }
8662 } else if (args[0].isNullOrUndefined()) {
8663 arg0 = nullptr;
8664 } else {
8665 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8666 return false;
8667 }
8668 } else {
8669 arg0 = nullptr;
8670 }
8671 if (objIsXray) {
8672 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8673 // we know Xrays have no dynamic unwrap behavior.
8674 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8675 if (!unwrappedObj.ref()) {
8676 return false;
8677 }
8678 }
8679 FastErrorResult rv;
8680 // NOTE: This assert does NOT call the function.
8681 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");
8682 MOZ_KnownLive(self)(self)->PassOptionalCallbackInterfaceWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8683 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault"
)), 0))
) {
8684 return false;
8685 }
8686 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8686); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8686); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8687 args.rval().setUndefined();
8688 return true;
8689}
8690
8691static const JSJitInfo passOptionalCallbackInterfaceWithDefault_methodinfo = {
8692 { (JSJitGetterOp)passOptionalCallbackInterfaceWithDefault },
8693 { prototypes::id::TestJSImplInterface },
8694 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8695 JSJitInfo::Method,
8696 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8697 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8698 false, /* isInfallible. False in setters. */
8699 false, /* isMovable. Not relevant for setters. */
8700 false, /* isEliminatable. Not relevant for setters. */
8701 false, /* isAlwaysInSlot. Only relevant for getters. */
8702 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8703 false, /* isTypedMethod. Only relevant for methods. */
8704 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8705};
8706
8707MOZ_CAN_RUN_SCRIPT static bool
8708receiveSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8709{
8710 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8713( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8711 "TestJSImplInterface", "receiveSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8713( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8712 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8713( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8713 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8713( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8714
8715 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8716 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8717 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8718 if (objIsXray) {
8719 unwrappedObj.emplace(cx, obj);
8720 }
8721 if (objIsXray) {
8722 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8723 // we know Xrays have no dynamic unwrap behavior.
8724 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8725 if (!unwrappedObj.ref()) {
8726 return false;
8727 }
8728 }
8729 FastErrorResult rv;
8730 nsTArray<int32_t> result;
8731 // NOTE: This assert does NOT call the function.
8732 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");
8733 MOZ_KnownLive(self)(self)->ReceiveSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8734 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequence"
)), 0))
) {
8735 return false;
8736 }
8737 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8737); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8737); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8738
8739 uint32_t length = result.Length();
8740 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8741 if (!returnArray) {
8742 return false;
8743 }
8744 // Scope for 'tmp'
8745 {
8746 JS::Rooted<JS::Value> tmp(cx);
8747 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8748 // Control block to let us common up the JS_DefineElement calls when there
8749 // are different ways to succeed at wrapping the object.
8750 do {
8751 tmp.setInt32(int32_t(result[sequenceIdx0]));
8752 break;
8753 } while (false);
8754 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8755 JSPROP_ENUMERATE)) {
8756 return false;
8757 }
8758 }
8759 }
8760 args.rval().setObject(*returnArray);
8761 return true;
8762}
8763
8764static const JSJitInfo receiveSequence_methodinfo = {
8765 { (JSJitGetterOp)receiveSequence },
8766 { prototypes::id::TestJSImplInterface },
8767 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8768 JSJitInfo::Method,
8769 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8770 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8771 false, /* isInfallible. False in setters. */
8772 false, /* isMovable. Not relevant for setters. */
8773 false, /* isEliminatable. Not relevant for setters. */
8774 false, /* isAlwaysInSlot. Only relevant for getters. */
8775 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8776 false, /* isTypedMethod. Only relevant for methods. */
8777 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8778};
8779
8780MOZ_CAN_RUN_SCRIPT static bool
8781receiveNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8782{
8783 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8786( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8784 "TestJSImplInterface", "receiveNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8786( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8785 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8786( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8786 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8786( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8787
8788 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8789 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8790 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8791 if (objIsXray) {
8792 unwrappedObj.emplace(cx, obj);
8793 }
8794 if (objIsXray) {
8795 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8796 // we know Xrays have no dynamic unwrap behavior.
8797 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8798 if (!unwrappedObj.ref()) {
8799 return false;
8800 }
8801 }
8802 FastErrorResult rv;
8803 Nullable<nsTArray<int32_t>> result;
8804 // NOTE: This assert does NOT call the function.
8805 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");
8806 MOZ_KnownLive(self)(self)->ReceiveNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8807 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequence"
)), 0))
) {
8808 return false;
8809 }
8810 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8810); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8810); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8811
8812 if (result.IsNull()) {
8813 args.rval().setNull();
8814 return true;
8815 }
8816
8817 uint32_t length = result.Value().Length();
8818 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8819 if (!returnArray) {
8820 return false;
8821 }
8822 // Scope for 'tmp'
8823 {
8824 JS::Rooted<JS::Value> tmp(cx);
8825 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8826 // Control block to let us common up the JS_DefineElement calls when there
8827 // are different ways to succeed at wrapping the object.
8828 do {
8829 tmp.setInt32(int32_t(result.Value()[sequenceIdx0]));
8830 break;
8831 } while (false);
8832 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8833 JSPROP_ENUMERATE)) {
8834 return false;
8835 }
8836 }
8837 }
8838 args.rval().setObject(*returnArray);
8839 return true;
8840}
8841
8842static const JSJitInfo receiveNullableSequence_methodinfo = {
8843 { (JSJitGetterOp)receiveNullableSequence },
8844 { prototypes::id::TestJSImplInterface },
8845 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8846 JSJitInfo::Method,
8847 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8848 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8849 false, /* isInfallible. False in setters. */
8850 false, /* isMovable. Not relevant for setters. */
8851 false, /* isEliminatable. Not relevant for setters. */
8852 false, /* isAlwaysInSlot. Only relevant for getters. */
8853 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8854 false, /* isTypedMethod. Only relevant for methods. */
8855 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8856};
8857
8858MOZ_CAN_RUN_SCRIPT static bool
8859receiveSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8860{
8861 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8864( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8862 "TestJSImplInterface", "receiveSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8864( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8863 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8864( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8864 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8864( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8865
8866 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8867 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8868 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8869 if (objIsXray) {
8870 unwrappedObj.emplace(cx, obj);
8871 }
8872 if (objIsXray) {
8873 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8874 // we know Xrays have no dynamic unwrap behavior.
8875 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8876 if (!unwrappedObj.ref()) {
8877 return false;
8878 }
8879 }
8880 FastErrorResult rv;
8881 nsTArray<Nullable<int32_t>> result;
8882 // NOTE: This assert does NOT call the function.
8883 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");
8884 MOZ_KnownLive(self)(self)->ReceiveSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8885 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequenceOfNullableInts"
)), 0))
) {
8886 return false;
8887 }
8888 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8888); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8888); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8889
8890 uint32_t length = result.Length();
8891 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8892 if (!returnArray) {
8893 return false;
8894 }
8895 // Scope for 'tmp'
8896 {
8897 JS::Rooted<JS::Value> tmp(cx);
8898 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8899 // Control block to let us common up the JS_DefineElement calls when there
8900 // are different ways to succeed at wrapping the object.
8901 do {
8902 if (result[sequenceIdx0].IsNull()) {
8903 tmp.setNull();
8904 break;
8905 }
8906 tmp.setInt32(int32_t(result[sequenceIdx0].Value()));
8907 break;
8908 } while (false);
8909 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8910 JSPROP_ENUMERATE)) {
8911 return false;
8912 }
8913 }
8914 }
8915 args.rval().setObject(*returnArray);
8916 return true;
8917}
8918
8919static const JSJitInfo receiveSequenceOfNullableInts_methodinfo = {
8920 { (JSJitGetterOp)receiveSequenceOfNullableInts },
8921 { prototypes::id::TestJSImplInterface },
8922 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8923 JSJitInfo::Method,
8924 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8925 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8926 false, /* isInfallible. False in setters. */
8927 false, /* isMovable. Not relevant for setters. */
8928 false, /* isEliminatable. Not relevant for setters. */
8929 false, /* isAlwaysInSlot. Only relevant for getters. */
8930 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8931 false, /* isTypedMethod. Only relevant for methods. */
8932 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8933};
8934
8935MOZ_CAN_RUN_SCRIPT static bool
8936receiveNullableSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8937{
8938 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8941( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8939 "TestJSImplInterface", "receiveNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8941( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8940 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8941( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8941 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8941( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8942
8943 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8944 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8945 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8946 if (objIsXray) {
8947 unwrappedObj.emplace(cx, obj);
8948 }
8949 if (objIsXray) {
8950 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8951 // we know Xrays have no dynamic unwrap behavior.
8952 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8953 if (!unwrappedObj.ref()) {
8954 return false;
8955 }
8956 }
8957 FastErrorResult rv;
8958 Nullable<nsTArray<Nullable<int32_t>>> result;
8959 // NOTE: This assert does NOT call the function.
8960 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");
8961 MOZ_KnownLive(self)(self)->ReceiveNullableSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8962 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequenceOfNullableInts"
)), 0))
) {
8963 return false;
8964 }
8965 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8965); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 8965); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
8966
8967 if (result.IsNull()) {
8968 args.rval().setNull();
8969 return true;
8970 }
8971
8972 uint32_t length = result.Value().Length();
8973 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8974 if (!returnArray) {
8975 return false;
8976 }
8977 // Scope for 'tmp'
8978 {
8979 JS::Rooted<JS::Value> tmp(cx);
8980 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8981 // Control block to let us common up the JS_DefineElement calls when there
8982 // are different ways to succeed at wrapping the object.
8983 do {
8984 if (result.Value()[sequenceIdx0].IsNull()) {
8985 tmp.setNull();
8986 break;
8987 }
8988 tmp.setInt32(int32_t(result.Value()[sequenceIdx0].Value()));
8989 break;
8990 } while (false);
8991 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8992 JSPROP_ENUMERATE)) {
8993 return false;
8994 }
8995 }
8996 }
8997 args.rval().setObject(*returnArray);
8998 return true;
8999}
9000
9001static const JSJitInfo receiveNullableSequenceOfNullableInts_methodinfo = {
9002 { (JSJitGetterOp)receiveNullableSequenceOfNullableInts },
9003 { prototypes::id::TestJSImplInterface },
9004 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9005 JSJitInfo::Method,
9006 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9007 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9008 false, /* isInfallible. False in setters. */
9009 false, /* isMovable. Not relevant for setters. */
9010 false, /* isEliminatable. Not relevant for setters. */
9011 false, /* isAlwaysInSlot. Only relevant for getters. */
9012 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9013 false, /* isTypedMethod. Only relevant for methods. */
9014 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9015};
9016
9017MOZ_CAN_RUN_SCRIPT static bool
9018passSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9019{
9020 BindingCallContext cx(cx_, "TestJSImplInterface.passSequence");
9021 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9024( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9022 "TestJSImplInterface", "passSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9024( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9023 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9024( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9024 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9024( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
9025
9026 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9027 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequence", 1)) {
9028 return false;
9029 }
9030 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9031 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9032 if (objIsXray) {
9033 unwrappedObj.emplace(cx, obj);
9034 }
9035 binding_detail::AutoSequence<int32_t> arg0;
9036 if (args[0].isObject()) {
9037 JS::ForOfIterator iter(cx);
9038 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9039 return false;
9040 }
9041 if (!iter.valueIsIterable()) {
9042 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9043 return false;
9044 }
9045 binding_detail::AutoSequence<int32_t> &arr = arg0;
9046 JS::Rooted<JS::Value> temp(cx);
9047 while (true) {
9048 bool done;
9049 if (!iter.next(&temp, &done)) {
9050 return false;
9051 }
9052 if (done) {
9053 break;
9054 }
9055 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
9056 if (!slotPtr) {
9057 JS_ReportOutOfMemory(cx);
9058 return false;
9059 }
9060 int32_t& slot = *slotPtr;
9061 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
9062 return false;
9063 }
9064 }
9065 } else {
9066 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9067 return false;
9068 }
9069 if (objIsXray) {
9070 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9071 // we know Xrays have no dynamic unwrap behavior.
9072 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9073 if (!unwrappedObj.ref()) {
9074 return false;
9075 }
9076 }
9077 FastErrorResult rv;
9078 // NOTE: This assert does NOT call the function.
9079 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");
9080 MOZ_KnownLive(self)(self)->PassSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9081 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequence"
)), 0))
) {
9082 return false;
9083 }
9084 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9084); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9084); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9085 args.rval().setUndefined();
9086 return true;
9087}
9088
9089static const JSJitInfo passSequence_methodinfo = {
9090 { (JSJitGetterOp)passSequence },
9091 { prototypes::id::TestJSImplInterface },
9092 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9093 JSJitInfo::Method,
9094 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9095 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9096 false, /* isInfallible. False in setters. */
9097 false, /* isMovable. Not relevant for setters. */
9098 false, /* isEliminatable. Not relevant for setters. */
9099 false, /* isAlwaysInSlot. Only relevant for getters. */
9100 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9101 false, /* isTypedMethod. Only relevant for methods. */
9102 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9103};
9104
9105MOZ_CAN_RUN_SCRIPT static bool
9106passNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9107{
9108 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequence");
9109 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9112( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9110 "TestJSImplInterface", "passNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9112( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9111 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9112( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9112 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9112( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
9113
9114 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9115 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequence", 1)) {
9116 return false;
9117 }
9118 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9119 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9120 if (objIsXray) {
9121 unwrappedObj.emplace(cx, obj);
9122 }
9123 Nullable<Sequence<int32_t>> arg0;
9124 if (args[0].isObject()) {
9125 JS::ForOfIterator iter(cx);
9126 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9127 return false;
9128 }
9129 if (!iter.valueIsIterable()) {
9130 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9131 return false;
9132 }
9133 Sequence<int32_t> &arr = arg0.SetValue();
9134 JS::Rooted<JS::Value> temp(cx);
9135 while (true) {
9136 bool done;
9137 if (!iter.next(&temp, &done)) {
9138 return false;
9139 }
9140 if (done) {
9141 break;
9142 }
9143 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
9144 if (!slotPtr) {
9145 JS_ReportOutOfMemory(cx);
9146 return false;
9147 }
9148 int32_t& slot = *slotPtr;
9149 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
9150 return false;
9151 }
9152 }
9153 } else if (args[0].isNullOrUndefined()) {
9154 arg0.SetNull();
9155 } else {
9156 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9157 return false;
9158 }
9159 if (objIsXray) {
9160 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9161 // we know Xrays have no dynamic unwrap behavior.
9162 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9163 if (!unwrappedObj.ref()) {
9164 return false;
9165 }
9166 }
9167 FastErrorResult rv;
9168 // NOTE: This assert does NOT call the function.
9169 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");
9170 MOZ_KnownLive(self)(self)->PassNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9171 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequence"
)), 0))
) {
9172 return false;
9173 }
9174 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9174); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9174); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9175 args.rval().setUndefined();
9176 return true;
9177}
9178
9179static const JSJitInfo passNullableSequence_methodinfo = {
9180 { (JSJitGetterOp)passNullableSequence },
9181 { prototypes::id::TestJSImplInterface },
9182 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9183 JSJitInfo::Method,
9184 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9185 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9186 false, /* isInfallible. False in setters. */
9187 false, /* isMovable. Not relevant for setters. */
9188 false, /* isEliminatable. Not relevant for setters. */
9189 false, /* isAlwaysInSlot. Only relevant for getters. */
9190 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9191 false, /* isTypedMethod. Only relevant for methods. */
9192 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9193};
9194
9195MOZ_CAN_RUN_SCRIPT static bool
9196passSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9197{
9198 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableInts");
9199 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9202( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9200 "TestJSImplInterface", "passSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9202( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9201 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9202( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9202 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9202( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9203
9204 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9205 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableInts", 1)) {
9206 return false;
9207 }
9208 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9209 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9210 if (objIsXray) {
9211 unwrappedObj.emplace(cx, obj);
9212 }
9213 binding_detail::AutoSequence<Nullable<int32_t>> arg0;
9214 if (args[0].isObject()) {
9215 JS::ForOfIterator iter(cx);
9216 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9217 return false;
9218 }
9219 if (!iter.valueIsIterable()) {
9220 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9221 return false;
9222 }
9223 binding_detail::AutoSequence<Nullable<int32_t>> &arr = arg0;
9224 JS::Rooted<JS::Value> temp(cx);
9225 while (true) {
9226 bool done;
9227 if (!iter.next(&temp, &done)) {
9228 return false;
9229 }
9230 if (done) {
9231 break;
9232 }
9233 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9234 if (!slotPtr) {
9235 JS_ReportOutOfMemory(cx);
9236 return false;
9237 }
9238 Nullable<int32_t>& slot = *slotPtr;
9239 if (temp.isNullOrUndefined()) {
9240 slot.SetNull();
9241 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9242 return false;
9243 }
9244 }
9245 } else {
9246 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9247 return false;
9248 }
9249 if (objIsXray) {
9250 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9251 // we know Xrays have no dynamic unwrap behavior.
9252 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9253 if (!unwrappedObj.ref()) {
9254 return false;
9255 }
9256 }
9257 FastErrorResult rv;
9258 // NOTE: This assert does NOT call the function.
9259 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");
9260 MOZ_KnownLive(self)(self)->PassSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9261 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableInts"
)), 0))
) {
9262 return false;
9263 }
9264 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9264); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9264); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9265 args.rval().setUndefined();
9266 return true;
9267}
9268
9269static const JSJitInfo passSequenceOfNullableInts_methodinfo = {
9270 { (JSJitGetterOp)passSequenceOfNullableInts },
9271 { prototypes::id::TestJSImplInterface },
9272 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9273 JSJitInfo::Method,
9274 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9275 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9276 false, /* isInfallible. False in setters. */
9277 false, /* isMovable. Not relevant for setters. */
9278 false, /* isEliminatable. Not relevant for setters. */
9279 false, /* isAlwaysInSlot. Only relevant for getters. */
9280 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9281 false, /* isTypedMethod. Only relevant for methods. */
9282 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9283};
9284
9285MOZ_CAN_RUN_SCRIPT static bool
9286passOptionalSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9287{
9288 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfNullableInts");
9289 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9292( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9290 "TestJSImplInterface", "passOptionalSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9292( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9291 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9292( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9292 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9292( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9293
9294 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9295 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9296 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9297 if (objIsXray) {
9298 unwrappedObj.emplace(cx, obj);
9299 }
9300 Optional<Sequence<Nullable<int32_t>>> arg0;
9301 if (args.hasDefined(0)) {
9302 arg0.Construct();
9303 if (args[0].isObject()) {
9304 JS::ForOfIterator iter(cx);
9305 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9306 return false;
9307 }
9308 if (!iter.valueIsIterable()) {
9309 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9310 return false;
9311 }
9312 Sequence<Nullable<int32_t>> &arr = arg0.Value();
9313 JS::Rooted<JS::Value> temp(cx);
9314 while (true) {
9315 bool done;
9316 if (!iter.next(&temp, &done)) {
9317 return false;
9318 }
9319 if (done) {
9320 break;
9321 }
9322 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9323 if (!slotPtr) {
9324 JS_ReportOutOfMemory(cx);
9325 return false;
9326 }
9327 Nullable<int32_t>& slot = *slotPtr;
9328 if (temp.isNullOrUndefined()) {
9329 slot.SetNull();
9330 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9331 return false;
9332 }
9333 }
9334 } else {
9335 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9336 return false;
9337 }
9338 }
9339 if (objIsXray) {
9340 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9341 // we know Xrays have no dynamic unwrap behavior.
9342 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9343 if (!unwrappedObj.ref()) {
9344 return false;
9345 }
9346 }
9347 FastErrorResult rv;
9348 // NOTE: This assert does NOT call the function.
9349 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");
9350 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9351 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfNullableInts"
)), 0))
) {
9352 return false;
9353 }
9354 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9354); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9354); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9355 args.rval().setUndefined();
9356 return true;
9357}
9358
9359static const JSJitInfo passOptionalSequenceOfNullableInts_methodinfo = {
9360 { (JSJitGetterOp)passOptionalSequenceOfNullableInts },
9361 { prototypes::id::TestJSImplInterface },
9362 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9363 JSJitInfo::Method,
9364 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9365 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9366 false, /* isInfallible. False in setters. */
9367 false, /* isMovable. Not relevant for setters. */
9368 false, /* isEliminatable. Not relevant for setters. */
9369 false, /* isAlwaysInSlot. Only relevant for getters. */
9370 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9371 false, /* isTypedMethod. Only relevant for methods. */
9372 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9373};
9374
9375MOZ_CAN_RUN_SCRIPT static bool
9376passOptionalNullableSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9377{
9378 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts");
9379 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9382( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9380 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9382( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9381 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9382( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9382 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9382( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9383
9384 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9385 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9386 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9387 if (objIsXray) {
9388 unwrappedObj.emplace(cx, obj);
9389 }
9390 Optional<Nullable<Sequence<Nullable<int32_t>>>> arg0;
9391 if (args.hasDefined(0)) {
9392 arg0.Construct();
9393 if (args[0].isObject()) {
9394 JS::ForOfIterator iter(cx);
9395 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9396 return false;
9397 }
9398 if (!iter.valueIsIterable()) {
9399 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9400 return false;
9401 }
9402 Sequence<Nullable<int32_t>> &arr = arg0.Value().SetValue();
9403 JS::Rooted<JS::Value> temp(cx);
9404 while (true) {
9405 bool done;
9406 if (!iter.next(&temp, &done)) {
9407 return false;
9408 }
9409 if (done) {
9410 break;
9411 }
9412 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9413 if (!slotPtr) {
9414 JS_ReportOutOfMemory(cx);
9415 return false;
9416 }
9417 Nullable<int32_t>& slot = *slotPtr;
9418 if (temp.isNullOrUndefined()) {
9419 slot.SetNull();
9420 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9421 return false;
9422 }
9423 }
9424 } else if (args[0].isNullOrUndefined()) {
9425 arg0.Value().SetNull();
9426 } else {
9427 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9428 return false;
9429 }
9430 }
9431 if (objIsXray) {
9432 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9433 // we know Xrays have no dynamic unwrap behavior.
9434 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9435 if (!unwrappedObj.ref()) {
9436 return false;
9437 }
9438 }
9439 FastErrorResult rv;
9440 // NOTE: This assert does NOT call the function.
9441 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");
9442 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9443 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts"
)), 0))
) {
9444 return false;
9445 }
9446 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9446); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9447 args.rval().setUndefined();
9448 return true;
9449}
9450
9451static const JSJitInfo passOptionalNullableSequenceOfNullableInts_methodinfo = {
9452 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableInts },
9453 { prototypes::id::TestJSImplInterface },
9454 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9455 JSJitInfo::Method,
9456 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9457 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9458 false, /* isInfallible. False in setters. */
9459 false, /* isMovable. Not relevant for setters. */
9460 false, /* isEliminatable. Not relevant for setters. */
9461 false, /* isAlwaysInSlot. Only relevant for getters. */
9462 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9463 false, /* isTypedMethod. Only relevant for methods. */
9464 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9465};
9466
9467MOZ_CAN_RUN_SCRIPT static bool
9468receiveCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9469{
9470 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9473( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9471 "TestJSImplInterface", "receiveCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9473( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9472 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9473( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9473 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9473( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9474
9475 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9476 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9477 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9478 if (objIsXray) {
9479 unwrappedObj.emplace(cx, obj);
9480 }
9481 if (objIsXray) {
9482 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9483 // we know Xrays have no dynamic unwrap behavior.
9484 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9485 if (!unwrappedObj.ref()) {
9486 return false;
9487 }
9488 }
9489 FastErrorResult rv;
9490 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9491 // NOTE: This assert does NOT call the function.
9492 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");
9493 MOZ_KnownLive(self)(self)->ReceiveCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9494 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectSequence"
)), 0))
) {
9495 return false;
9496 }
9497 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9497); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9497); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9498
9499 uint32_t length = result.Length();
9500 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9501 if (!returnArray) {
9502 return false;
9503 }
9504 // Scope for 'tmp'
9505 {
9506 JS::Rooted<JS::Value> tmp(cx);
9507 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9508 // Control block to let us common up the JS_DefineElement calls when there
9509 // are different ways to succeed at wrapping the object.
9510 do {
9511 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9512 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9512); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9513 return false;
9514 }
9515 break;
9516 } while (false);
9517 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9518 JSPROP_ENUMERATE)) {
9519 return false;
9520 }
9521 }
9522 }
9523 args.rval().setObject(*returnArray);
9524 return true;
9525}
9526
9527static const JSJitInfo receiveCastableObjectSequence_methodinfo = {
9528 { (JSJitGetterOp)receiveCastableObjectSequence },
9529 { prototypes::id::TestJSImplInterface },
9530 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9531 JSJitInfo::Method,
9532 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9533 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9534 false, /* isInfallible. False in setters. */
9535 false, /* isMovable. Not relevant for setters. */
9536 false, /* isEliminatable. Not relevant for setters. */
9537 false, /* isAlwaysInSlot. Only relevant for getters. */
9538 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9539 false, /* isTypedMethod. Only relevant for methods. */
9540 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9541};
9542
9543MOZ_CAN_RUN_SCRIPT static bool
9544receiveCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9545{
9546 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9549( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9547 "TestJSImplInterface", "receiveCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9549( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9548 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9549( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9549 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9549( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9550
9551 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9552 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9553 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9554 if (objIsXray) {
9555 unwrappedObj.emplace(cx, obj);
9556 }
9557 if (objIsXray) {
9558 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9559 // we know Xrays have no dynamic unwrap behavior.
9560 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9561 if (!unwrappedObj.ref()) {
9562 return false;
9563 }
9564 }
9565 FastErrorResult rv;
9566 nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result;
9567 // NOTE: This assert does NOT call the function.
9568 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");
9569 MOZ_KnownLive(self)(self)->ReceiveCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9570 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackObjectSequence"
)), 0))
) {
9571 return false;
9572 }
9573 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9573); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9573); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9574
9575 uint32_t length = result.Length();
9576 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9577 if (!returnArray) {
9578 return false;
9579 }
9580 // Scope for 'tmp'
9581 {
9582 JS::Rooted<JS::Value> tmp(cx);
9583 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9584 // Control block to let us common up the JS_DefineElement calls when there
9585 // are different ways to succeed at wrapping the object.
9586 do {
9587 tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0]));
9588 if (!MaybeWrapObjectValue(cx, &tmp)) {
9589 return false;
9590 }
9591 break;
9592 } while (false);
9593 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9594 JSPROP_ENUMERATE)) {
9595 return false;
9596 }
9597 }
9598 }
9599 args.rval().setObject(*returnArray);
9600 return true;
9601}
9602
9603static const JSJitInfo receiveCallbackObjectSequence_methodinfo = {
9604 { (JSJitGetterOp)receiveCallbackObjectSequence },
9605 { prototypes::id::TestJSImplInterface },
9606 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9607 JSJitInfo::Method,
9608 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9609 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9610 false, /* isInfallible. False in setters. */
9611 false, /* isMovable. Not relevant for setters. */
9612 false, /* isEliminatable. Not relevant for setters. */
9613 false, /* isAlwaysInSlot. Only relevant for getters. */
9614 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9615 false, /* isTypedMethod. Only relevant for methods. */
9616 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9617};
9618
9619MOZ_CAN_RUN_SCRIPT static bool
9620receiveNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9621{
9622 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9625( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9623 "TestJSImplInterface", "receiveNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9625( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9624 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9625( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9625 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9625( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9626
9627 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9628 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9629 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9630 if (objIsXray) {
9631 unwrappedObj.emplace(cx, obj);
9632 }
9633 if (objIsXray) {
9634 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9635 // we know Xrays have no dynamic unwrap behavior.
9636 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9637 if (!unwrappedObj.ref()) {
9638 return false;
9639 }
9640 }
9641 FastErrorResult rv;
9642 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9643 // NOTE: This assert does NOT call the function.
9644 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");
9645 MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9646 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectSequence"
)), 0))
) {
9647 return false;
9648 }
9649 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9649); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9649); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9650
9651 uint32_t length = result.Length();
9652 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9653 if (!returnArray) {
9654 return false;
9655 }
9656 // Scope for 'tmp'
9657 {
9658 JS::Rooted<JS::Value> tmp(cx);
9659 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9660 // Control block to let us common up the JS_DefineElement calls when there
9661 // are different ways to succeed at wrapping the object.
9662 do {
9663 if (!result[sequenceIdx0]) {
9664 tmp.setNull();
9665 break;
9666 }
9667 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9668 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9668); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9668); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9669 return false;
9670 }
9671 break;
9672 } while (false);
9673 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9674 JSPROP_ENUMERATE)) {
9675 return false;
9676 }
9677 }
9678 }
9679 args.rval().setObject(*returnArray);
9680 return true;
9681}
9682
9683static const JSJitInfo receiveNullableCastableObjectSequence_methodinfo = {
9684 { (JSJitGetterOp)receiveNullableCastableObjectSequence },
9685 { prototypes::id::TestJSImplInterface },
9686 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9687 JSJitInfo::Method,
9688 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9689 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9690 false, /* isInfallible. False in setters. */
9691 false, /* isMovable. Not relevant for setters. */
9692 false, /* isEliminatable. Not relevant for setters. */
9693 false, /* isAlwaysInSlot. Only relevant for getters. */
9694 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9695 false, /* isTypedMethod. Only relevant for methods. */
9696 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9697};
9698
9699MOZ_CAN_RUN_SCRIPT static bool
9700receiveNullableCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9701{
9702 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9705( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9703 "TestJSImplInterface", "receiveNullableCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9705( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9704 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9705( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9705 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9705( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9706
9707 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9708 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9709 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9710 if (objIsXray) {
9711 unwrappedObj.emplace(cx, obj);
9712 }
9713 if (objIsXray) {
9714 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9715 // we know Xrays have no dynamic unwrap behavior.
9716 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9717 if (!unwrappedObj.ref()) {
9718 return false;
9719 }
9720 }
9721 FastErrorResult rv;
9722 nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result;
9723 // NOTE: This assert does NOT call the function.
9724 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");
9725 MOZ_KnownLive(self)(self)->ReceiveNullableCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9726 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackObjectSequence"
)), 0))
) {
9727 return false;
9728 }
9729 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9729); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9729); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9730
9731 uint32_t length = result.Length();
9732 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9733 if (!returnArray) {
9734 return false;
9735 }
9736 // Scope for 'tmp'
9737 {
9738 JS::Rooted<JS::Value> tmp(cx);
9739 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9740 // Control block to let us common up the JS_DefineElement calls when there
9741 // are different ways to succeed at wrapping the object.
9742 do {
9743 if (result[sequenceIdx0]) {
9744 tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0]));
9745 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
9746 return false;
9747 }
9748 break;
9749 } else {
9750 tmp.setNull();
9751 break;
9752 }
9753 } while (false);
9754 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9755 JSPROP_ENUMERATE)) {
9756 return false;
9757 }
9758 }
9759 }
9760 args.rval().setObject(*returnArray);
9761 return true;
9762}
9763
9764static const JSJitInfo receiveNullableCallbackObjectSequence_methodinfo = {
9765 { (JSJitGetterOp)receiveNullableCallbackObjectSequence },
9766 { prototypes::id::TestJSImplInterface },
9767 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9768 JSJitInfo::Method,
9769 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9770 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9771 false, /* isInfallible. False in setters. */
9772 false, /* isMovable. Not relevant for setters. */
9773 false, /* isEliminatable. Not relevant for setters. */
9774 false, /* isAlwaysInSlot. Only relevant for getters. */
9775 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9776 false, /* isTypedMethod. Only relevant for methods. */
9777 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9778};
9779
9780MOZ_CAN_RUN_SCRIPT static bool
9781receiveCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9782{
9783 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9786( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9784 "TestJSImplInterface", "receiveCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9786( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9785 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9786( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9786 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9786( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9787
9788 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9789 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9790 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9791 if (objIsXray) {
9792 unwrappedObj.emplace(cx, obj);
9793 }
9794 if (objIsXray) {
9795 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9796 // we know Xrays have no dynamic unwrap behavior.
9797 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9798 if (!unwrappedObj.ref()) {
9799 return false;
9800 }
9801 }
9802 FastErrorResult rv;
9803 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
9804 // NOTE: This assert does NOT call the function.
9805 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");
9806 MOZ_KnownLive(self)(self)->ReceiveCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9807 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectNullableSequence"
)), 0))
) {
9808 return false;
9809 }
9810 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9810); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9810); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9811
9812 if (result.IsNull()) {
9813 args.rval().setNull();
9814 return true;
9815 }
9816
9817 uint32_t length = result.Value().Length();
9818 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9819 if (!returnArray) {
9820 return false;
9821 }
9822 // Scope for 'tmp'
9823 {
9824 JS::Rooted<JS::Value> tmp(cx);
9825 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9826 // Control block to let us common up the JS_DefineElement calls when there
9827 // are different ways to succeed at wrapping the object.
9828 do {
9829 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
9830 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9830); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9831 return false;
9832 }
9833 break;
9834 } while (false);
9835 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9836 JSPROP_ENUMERATE)) {
9837 return false;
9838 }
9839 }
9840 }
9841 args.rval().setObject(*returnArray);
9842 return true;
9843}
9844
9845static const JSJitInfo receiveCastableObjectNullableSequence_methodinfo = {
9846 { (JSJitGetterOp)receiveCastableObjectNullableSequence },
9847 { prototypes::id::TestJSImplInterface },
9848 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9849 JSJitInfo::Method,
9850 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9851 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9852 false, /* isInfallible. False in setters. */
9853 false, /* isMovable. Not relevant for setters. */
9854 false, /* isEliminatable. Not relevant for setters. */
9855 false, /* isAlwaysInSlot. Only relevant for getters. */
9856 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9857 false, /* isTypedMethod. Only relevant for methods. */
9858 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9859};
9860
9861MOZ_CAN_RUN_SCRIPT static bool
9862receiveNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9863{
9864 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9867( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9865 "TestJSImplInterface", "receiveNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9867( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9866 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9867( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9867 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9867( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9868
9869 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9870 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9871 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9872 if (objIsXray) {
9873 unwrappedObj.emplace(cx, obj);
9874 }
9875 if (objIsXray) {
9876 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9877 // we know Xrays have no dynamic unwrap behavior.
9878 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9879 if (!unwrappedObj.ref()) {
9880 return false;
9881 }
9882 }
9883 FastErrorResult rv;
9884 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
9885 // NOTE: This assert does NOT call the function.
9886 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");
9887 MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9888 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence"
)), 0))
) {
9889 return false;
9890 }
9891 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9891); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9891); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9892
9893 if (result.IsNull()) {
9894 args.rval().setNull();
9895 return true;
9896 }
9897
9898 uint32_t length = result.Value().Length();
9899 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9900 if (!returnArray) {
9901 return false;
9902 }
9903 // Scope for 'tmp'
9904 {
9905 JS::Rooted<JS::Value> tmp(cx);
9906 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9907 // Control block to let us common up the JS_DefineElement calls when there
9908 // are different ways to succeed at wrapping the object.
9909 do {
9910 if (!result.Value()[sequenceIdx0]) {
9911 tmp.setNull();
9912 break;
9913 }
9914 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
9915 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9915); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9915); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9916 return false;
9917 }
9918 break;
9919 } while (false);
9920 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9921 JSPROP_ENUMERATE)) {
9922 return false;
9923 }
9924 }
9925 }
9926 args.rval().setObject(*returnArray);
9927 return true;
9928}
9929
9930static const JSJitInfo receiveNullableCastableObjectNullableSequence_methodinfo = {
9931 { (JSJitGetterOp)receiveNullableCastableObjectNullableSequence },
9932 { prototypes::id::TestJSImplInterface },
9933 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9934 JSJitInfo::Method,
9935 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9936 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9937 false, /* isInfallible. False in setters. */
9938 false, /* isMovable. Not relevant for setters. */
9939 false, /* isEliminatable. Not relevant for setters. */
9940 false, /* isAlwaysInSlot. Only relevant for getters. */
9941 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9942 false, /* isTypedMethod. Only relevant for methods. */
9943 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9944};
9945
9946MOZ_CAN_RUN_SCRIPT static bool
9947receiveWeakCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9948{
9949 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9952( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9950 "TestJSImplInterface", "receiveWeakCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9952( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9951 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9952( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9952 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9952( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9953
9954 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9955 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9956 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9957 if (objIsXray) {
9958 unwrappedObj.emplace(cx, obj);
9959 }
9960 if (objIsXray) {
9961 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9962 // we know Xrays have no dynamic unwrap behavior.
9963 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9964 if (!unwrappedObj.ref()) {
9965 return false;
9966 }
9967 }
9968 FastErrorResult rv;
9969 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9970 // NOTE: This assert does NOT call the function.
9971 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");
9972 MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9973 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectSequence"
)), 0))
) {
9974 return false;
9975 }
9976 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9976); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9976); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9977
9978 uint32_t length = result.Length();
9979 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9980 if (!returnArray) {
9981 return false;
9982 }
9983 // Scope for 'tmp'
9984 {
9985 JS::Rooted<JS::Value> tmp(cx);
9986 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9987 // Control block to let us common up the JS_DefineElement calls when there
9988 // are different ways to succeed at wrapping the object.
9989 do {
9990 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9991 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9991); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 9991); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
9992 return false;
9993 }
9994 break;
9995 } while (false);
9996 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9997 JSPROP_ENUMERATE)) {
9998 return false;
9999 }
10000 }
10001 }
10002 args.rval().setObject(*returnArray);
10003 return true;
10004}
10005
10006static const JSJitInfo receiveWeakCastableObjectSequence_methodinfo = {
10007 { (JSJitGetterOp)receiveWeakCastableObjectSequence },
10008 { prototypes::id::TestJSImplInterface },
10009 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10010 JSJitInfo::Method,
10011 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10012 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
10013 false, /* isInfallible. False in setters. */
10014 false, /* isMovable. Not relevant for setters. */
10015 false, /* isEliminatable. Not relevant for setters. */
10016 false, /* isAlwaysInSlot. Only relevant for getters. */
10017 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10018 false, /* isTypedMethod. Only relevant for methods. */
10019 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10020};
10021
10022MOZ_CAN_RUN_SCRIPT static bool
10023receiveWeakNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10024{
10025 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10028( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10026 "TestJSImplInterface", "receiveWeakNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10028( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10027 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10028( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10028 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10028( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10029
10030 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10031 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10032 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10033 if (objIsXray) {
10034 unwrappedObj.emplace(cx, obj);
10035 }
10036 if (objIsXray) {
10037 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10038 // we know Xrays have no dynamic unwrap behavior.
10039 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10040 if (!unwrappedObj.ref()) {
10041 return false;
10042 }
10043 }
10044 FastErrorResult rv;
10045 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
10046 // NOTE: This assert does NOT call the function.
10047 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");
10048 MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10049 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence"
)), 0))
) {
10050 return false;
10051 }
10052 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10052); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10052); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10053
10054 uint32_t length = result.Length();
10055 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10056 if (!returnArray) {
10057 return false;
10058 }
10059 // Scope for 'tmp'
10060 {
10061 JS::Rooted<JS::Value> tmp(cx);
10062 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10063 // Control block to let us common up the JS_DefineElement calls when there
10064 // are different ways to succeed at wrapping the object.
10065 do {
10066 if (!result[sequenceIdx0]) {
10067 tmp.setNull();
10068 break;
10069 }
10070 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
10071 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10071); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10071); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10072 return false;
10073 }
10074 break;
10075 } while (false);
10076 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10077 JSPROP_ENUMERATE)) {
10078 return false;
10079 }
10080 }
10081 }
10082 args.rval().setObject(*returnArray);
10083 return true;
10084}
10085
10086static const JSJitInfo receiveWeakNullableCastableObjectSequence_methodinfo = {
10087 { (JSJitGetterOp)receiveWeakNullableCastableObjectSequence },
10088 { prototypes::id::TestJSImplInterface },
10089 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10090 JSJitInfo::Method,
10091 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10092 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
10093 false, /* isInfallible. False in setters. */
10094 false, /* isMovable. Not relevant for setters. */
10095 false, /* isEliminatable. Not relevant for setters. */
10096 false, /* isAlwaysInSlot. Only relevant for getters. */
10097 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10098 false, /* isTypedMethod. Only relevant for methods. */
10099 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10100};
10101
10102MOZ_CAN_RUN_SCRIPT static bool
10103receiveWeakCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10104{
10105 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10108( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10106 "TestJSImplInterface", "receiveWeakCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10108( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10107 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10108( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10108 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10108( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10109
10110 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10111 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10112 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10113 if (objIsXray) {
10114 unwrappedObj.emplace(cx, obj);
10115 }
10116 if (objIsXray) {
10117 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10118 // we know Xrays have no dynamic unwrap behavior.
10119 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10120 if (!unwrappedObj.ref()) {
10121 return false;
10122 }
10123 }
10124 FastErrorResult rv;
10125 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
10126 // NOTE: This assert does NOT call the function.
10127 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");
10128 MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10129 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence"
)), 0))
) {
10130 return false;
10131 }
10132 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10132); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10132); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10133
10134 if (result.IsNull()) {
10135 args.rval().setNull();
10136 return true;
10137 }
10138
10139 uint32_t length = result.Value().Length();
10140 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10141 if (!returnArray) {
10142 return false;
10143 }
10144 // Scope for 'tmp'
10145 {
10146 JS::Rooted<JS::Value> tmp(cx);
10147 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10148 // Control block to let us common up the JS_DefineElement calls when there
10149 // are different ways to succeed at wrapping the object.
10150 do {
10151 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
10152 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10152); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10152); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10153 return false;
10154 }
10155 break;
10156 } while (false);
10157 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10158 JSPROP_ENUMERATE)) {
10159 return false;
10160 }
10161 }
10162 }
10163 args.rval().setObject(*returnArray);
10164 return true;
10165}
10166
10167static const JSJitInfo receiveWeakCastableObjectNullableSequence_methodinfo = {
10168 { (JSJitGetterOp)receiveWeakCastableObjectNullableSequence },
10169 { prototypes::id::TestJSImplInterface },
10170 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10171 JSJitInfo::Method,
10172 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10173 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
10174 false, /* isInfallible. False in setters. */
10175 false, /* isMovable. Not relevant for setters. */
10176 false, /* isEliminatable. Not relevant for setters. */
10177 false, /* isAlwaysInSlot. Only relevant for getters. */
10178 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10179 false, /* isTypedMethod. Only relevant for methods. */
10180 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10181};
10182
10183MOZ_CAN_RUN_SCRIPT static bool
10184receiveWeakNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10185{
10186 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10189( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10187 "TestJSImplInterface", "receiveWeakNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10189( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10188 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10189( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10189 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10189( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10190
10191 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10192 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10193 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10194 if (objIsXray) {
10195 unwrappedObj.emplace(cx, obj);
10196 }
10197 if (objIsXray) {
10198 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10199 // we know Xrays have no dynamic unwrap behavior.
10200 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10201 if (!unwrappedObj.ref()) {
10202 return false;
10203 }
10204 }
10205 FastErrorResult rv;
10206 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
10207 // NOTE: This assert does NOT call the function.
10208 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");
10209 MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10210 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence"
)), 0))
) {
10211 return false;
10212 }
10213 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10213); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10213); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10214
10215 if (result.IsNull()) {
10216 args.rval().setNull();
10217 return true;
10218 }
10219
10220 uint32_t length = result.Value().Length();
10221 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10222 if (!returnArray) {
10223 return false;
10224 }
10225 // Scope for 'tmp'
10226 {
10227 JS::Rooted<JS::Value> tmp(cx);
10228 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10229 // Control block to let us common up the JS_DefineElement calls when there
10230 // are different ways to succeed at wrapping the object.
10231 do {
10232 if (!result.Value()[sequenceIdx0]) {
10233 tmp.setNull();
10234 break;
10235 }
10236 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
10237 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10237); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10237); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10238 return false;
10239 }
10240 break;
10241 } while (false);
10242 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10243 JSPROP_ENUMERATE)) {
10244 return false;
10245 }
10246 }
10247 }
10248 args.rval().setObject(*returnArray);
10249 return true;
10250}
10251
10252static const JSJitInfo receiveWeakNullableCastableObjectNullableSequence_methodinfo = {
10253 { (JSJitGetterOp)receiveWeakNullableCastableObjectNullableSequence },
10254 { prototypes::id::TestJSImplInterface },
10255 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10256 JSJitInfo::Method,
10257 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10258 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
10259 false, /* isInfallible. False in setters. */
10260 false, /* isMovable. Not relevant for setters. */
10261 false, /* isEliminatable. Not relevant for setters. */
10262 false, /* isAlwaysInSlot. Only relevant for getters. */
10263 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10264 false, /* isTypedMethod. Only relevant for methods. */
10265 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10266};
10267
10268MOZ_CAN_RUN_SCRIPT static bool
10269passCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10270{
10271 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectSequence");
10272 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10275( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10273 "TestJSImplInterface", "passCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10275( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10274 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10275( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10275 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10275( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10276
10277 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10278 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectSequence", 1)) {
10279 return false;
10280 }
10281 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10282 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10283 if (objIsXray) {
10284 unwrappedObj.emplace(cx, obj);
10285 }
10286 binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> arg0;
10287 if (args[0].isObject()) {
10288 JS::ForOfIterator iter(cx);
10289 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10290 return false;
10291 }
10292 if (!iter.valueIsIterable()) {
10293 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10294 return false;
10295 }
10296 binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0;
10297 JS::Rooted<JS::Value> temp(cx);
10298 while (true) {
10299 bool done;
10300 if (!iter.next(&temp, &done)) {
10301 return false;
10302 }
10303 if (done) {
10304 break;
10305 }
10306 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10307 if (!slotPtr) {
10308 JS_ReportOutOfMemory(cx);
10309 return false;
10310 }
10311 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10312 if (temp.isObject()) {
10313 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10314 {
10315 // Our JSContext should be in the right global to do unwrapping in.
10316 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10317 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10318 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10319 return false;
10320 }
10321 }
10322 } else {
10323 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10324 return false;
10325 }
10326 }
10327 } else {
10328 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10329 return false;
10330 }
10331 if (objIsXray) {
10332 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10333 // we know Xrays have no dynamic unwrap behavior.
10334 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10335 if (!unwrappedObj.ref()) {
10336 return false;
10337 }
10338 }
10339 FastErrorResult rv;
10340 // NOTE: This assert does NOT call the function.
10341 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");
10342 MOZ_KnownLive(self)(self)->PassCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10343 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectSequence"
)), 0))
) {
10344 return false;
10345 }
10346 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10346); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10346); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10347 args.rval().setUndefined();
10348 return true;
10349}
10350
10351static const JSJitInfo passCastableObjectSequence_methodinfo = {
10352 { (JSJitGetterOp)passCastableObjectSequence },
10353 { prototypes::id::TestJSImplInterface },
10354 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10355 JSJitInfo::Method,
10356 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10357 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10358 false, /* isInfallible. False in setters. */
10359 false, /* isMovable. Not relevant for setters. */
10360 false, /* isEliminatable. Not relevant for setters. */
10361 false, /* isAlwaysInSlot. Only relevant for getters. */
10362 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10363 false, /* isTypedMethod. Only relevant for methods. */
10364 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10365};
10366
10367MOZ_CAN_RUN_SCRIPT static bool
10368passNullableCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10369{
10370 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectSequence");
10371 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10374( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10372 "TestJSImplInterface", "passNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10374( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10373 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10374( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10374 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10374( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10375
10376 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10377 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectSequence", 1)) {
10378 return false;
10379 }
10380 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10381 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10382 if (objIsXray) {
10383 unwrappedObj.emplace(cx, obj);
10384 }
10385 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestJSImplInterface>> arg0;
10386 if (args[0].isObject()) {
10387 JS::ForOfIterator iter(cx);
10388 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10389 return false;
10390 }
10391 if (!iter.valueIsIterable()) {
10392 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10393 return false;
10394 }
10395 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = arg0;
10396 JS::Rooted<JS::Value> temp(cx);
10397 while (true) {
10398 bool done;
10399 if (!iter.next(&temp, &done)) {
10400 return false;
10401 }
10402 if (done) {
10403 break;
10404 }
10405 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10406 if (!slotPtr) {
10407 JS_ReportOutOfMemory(cx);
10408 return false;
10409 }
10410 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10411 if (temp.isObject()) {
10412 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10413 {
10414 // Our JSContext should be in the right global to do unwrapping in.
10415 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10416 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10417 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10418 return false;
10419 }
10420 }
10421 } else if (temp.isNullOrUndefined()) {
10422 slot = nullptr;
10423 } else {
10424 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10425 return false;
10426 }
10427 }
10428 } else {
10429 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10430 return false;
10431 }
10432 if (objIsXray) {
10433 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10434 // we know Xrays have no dynamic unwrap behavior.
10435 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10436 if (!unwrappedObj.ref()) {
10437 return false;
10438 }
10439 }
10440 FastErrorResult rv;
10441 // NOTE: This assert does NOT call the function.
10442 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");
10443 MOZ_KnownLive(self)(self)->PassNullableCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10444 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectSequence"
)), 0))
) {
10445 return false;
10446 }
10447 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10447); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10447); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10448 args.rval().setUndefined();
10449 return true;
10450}
10451
10452static const JSJitInfo passNullableCastableObjectSequence_methodinfo = {
10453 { (JSJitGetterOp)passNullableCastableObjectSequence },
10454 { prototypes::id::TestJSImplInterface },
10455 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10456 JSJitInfo::Method,
10457 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10458 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10459 false, /* isInfallible. False in setters. */
10460 false, /* isMovable. Not relevant for setters. */
10461 false, /* isEliminatable. Not relevant for setters. */
10462 false, /* isAlwaysInSlot. Only relevant for getters. */
10463 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10464 false, /* isTypedMethod. Only relevant for methods. */
10465 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10466};
10467
10468MOZ_CAN_RUN_SCRIPT static bool
10469passCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10470{
10471 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectNullableSequence");
10472 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10475( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10473 "TestJSImplInterface", "passCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10475( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10474 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10475( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10475 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10475( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10476
10477 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10478 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectNullableSequence", 1)) {
10479 return false;
10480 }
10481 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10482 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10483 if (objIsXray) {
10484 unwrappedObj.emplace(cx, obj);
10485 }
10486 Nullable<Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>>> arg0;
10487 if (args[0].isObject()) {
10488 JS::ForOfIterator iter(cx);
10489 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10490 return false;
10491 }
10492 if (!iter.valueIsIterable()) {
10493 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10494 return false;
10495 }
10496 Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0.SetValue();
10497 JS::Rooted<JS::Value> temp(cx);
10498 while (true) {
10499 bool done;
10500 if (!iter.next(&temp, &done)) {
10501 return false;
10502 }
10503 if (done) {
10504 break;
10505 }
10506 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10507 if (!slotPtr) {
10508 JS_ReportOutOfMemory(cx);
10509 return false;
10510 }
10511 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10512 if (temp.isObject()) {
10513 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10514 {
10515 // Our JSContext should be in the right global to do unwrapping in.
10516 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10517 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10518 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10519 return false;
10520 }
10521 }
10522 } else {
10523 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10524 return false;
10525 }
10526 }
10527 } else if (args[0].isNullOrUndefined()) {
10528 arg0.SetNull();
10529 } else {
10530 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10531 return false;
10532 }
10533 if (objIsXray) {
10534 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10535 // we know Xrays have no dynamic unwrap behavior.
10536 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10537 if (!unwrappedObj.ref()) {
10538 return false;
10539 }
10540 }
10541 FastErrorResult rv;
10542 // NOTE: This assert does NOT call the function.
10543 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");
10544 MOZ_KnownLive(self)(self)->PassCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10545 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableSequence"
)), 0))
) {
10546 return false;
10547 }
10548 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10548); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10548); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10549 args.rval().setUndefined();
10550 return true;
10551}
10552
10553static const JSJitInfo passCastableObjectNullableSequence_methodinfo = {
10554 { (JSJitGetterOp)passCastableObjectNullableSequence },
10555 { prototypes::id::TestJSImplInterface },
10556 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10557 JSJitInfo::Method,
10558 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10559 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10560 false, /* isInfallible. False in setters. */
10561 false, /* isMovable. Not relevant for setters. */
10562 false, /* isEliminatable. Not relevant for setters. */
10563 false, /* isAlwaysInSlot. Only relevant for getters. */
10564 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10565 false, /* isTypedMethod. Only relevant for methods. */
10566 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10567};
10568
10569MOZ_CAN_RUN_SCRIPT static bool
10570passNullableCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10571{
10572 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectNullableSequence");
10573 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10576( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10574 "TestJSImplInterface", "passNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10576( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10575 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10576( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10576 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10576( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10577
10578 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10579 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence", 1)) {
10580 return false;
10581 }
10582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10584 if (objIsXray) {
10585 unwrappedObj.emplace(cx, obj);
10586 }
10587 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> arg0;
10588 if (args[0].isObject()) {
10589 JS::ForOfIterator iter(cx);
10590 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10591 return false;
10592 }
10593 if (!iter.valueIsIterable()) {
10594 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10595 return false;
10596 }
10597 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = arg0.SetValue();
10598 JS::Rooted<JS::Value> temp(cx);
10599 while (true) {
10600 bool done;
10601 if (!iter.next(&temp, &done)) {
10602 return false;
10603 }
10604 if (done) {
10605 break;
10606 }
10607 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10608 if (!slotPtr) {
10609 JS_ReportOutOfMemory(cx);
10610 return false;
10611 }
10612 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10613 if (temp.isObject()) {
10614 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10615 {
10616 // Our JSContext should be in the right global to do unwrapping in.
10617 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10618 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10619 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10620 return false;
10621 }
10622 }
10623 } else if (temp.isNullOrUndefined()) {
10624 slot = nullptr;
10625 } else {
10626 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10627 return false;
10628 }
10629 }
10630 } else if (args[0].isNullOrUndefined()) {
10631 arg0.SetNull();
10632 } else {
10633 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10634 return false;
10635 }
10636 if (objIsXray) {
10637 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10638 // we know Xrays have no dynamic unwrap behavior.
10639 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10640 if (!unwrappedObj.ref()) {
10641 return false;
10642 }
10643 }
10644 FastErrorResult rv;
10645 // NOTE: This assert does NOT call the function.
10646 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");
10647 MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10648 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence"
)), 0))
) {
10649 return false;
10650 }
10651 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10651); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10652 args.rval().setUndefined();
10653 return true;
10654}
10655
10656static const JSJitInfo passNullableCastableObjectNullableSequence_methodinfo = {
10657 { (JSJitGetterOp)passNullableCastableObjectNullableSequence },
10658 { prototypes::id::TestJSImplInterface },
10659 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10660 JSJitInfo::Method,
10661 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10662 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10663 false, /* isInfallible. False in setters. */
10664 false, /* isMovable. Not relevant for setters. */
10665 false, /* isEliminatable. Not relevant for setters. */
10666 false, /* isAlwaysInSlot. Only relevant for getters. */
10667 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10668 false, /* isTypedMethod. Only relevant for methods. */
10669 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10670};
10671
10672MOZ_CAN_RUN_SCRIPT static bool
10673passOptionalSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10674{
10675 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequence");
10676 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10679( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10677 "TestJSImplInterface", "passOptionalSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10679( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10678 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10679( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10679 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10679( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
10680
10681 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10682 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10683 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10684 if (objIsXray) {
10685 unwrappedObj.emplace(cx, obj);
10686 }
10687 Optional<Sequence<int32_t>> arg0;
10688 if (args.hasDefined(0)) {
10689 arg0.Construct();
10690 if (args[0].isObject()) {
10691 JS::ForOfIterator iter(cx);
10692 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10693 return false;
10694 }
10695 if (!iter.valueIsIterable()) {
10696 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10697 return false;
10698 }
10699 Sequence<int32_t> &arr = arg0.Value();
10700 JS::Rooted<JS::Value> temp(cx);
10701 while (true) {
10702 bool done;
10703 if (!iter.next(&temp, &done)) {
10704 return false;
10705 }
10706 if (done) {
10707 break;
10708 }
10709 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10710 if (!slotPtr) {
10711 JS_ReportOutOfMemory(cx);
10712 return false;
10713 }
10714 int32_t& slot = *slotPtr;
10715 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10716 return false;
10717 }
10718 }
10719 } else {
10720 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10721 return false;
10722 }
10723 }
10724 if (objIsXray) {
10725 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10726 // we know Xrays have no dynamic unwrap behavior.
10727 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10728 if (!unwrappedObj.ref()) {
10729 return false;
10730 }
10731 }
10732 FastErrorResult rv;
10733 // NOTE: This assert does NOT call the function.
10734 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");
10735 MOZ_KnownLive(self)(self)->PassOptionalSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10736 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequence"
)), 0))
) {
10737 return false;
10738 }
10739 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10739); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10739); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10740 args.rval().setUndefined();
10741 return true;
10742}
10743
10744static const JSJitInfo passOptionalSequence_methodinfo = {
10745 { (JSJitGetterOp)passOptionalSequence },
10746 { prototypes::id::TestJSImplInterface },
10747 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10748 JSJitInfo::Method,
10749 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10750 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10751 false, /* isInfallible. False in setters. */
10752 false, /* isMovable. Not relevant for setters. */
10753 false, /* isEliminatable. Not relevant for setters. */
10754 false, /* isAlwaysInSlot. Only relevant for getters. */
10755 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10756 false, /* isTypedMethod. Only relevant for methods. */
10757 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10758};
10759
10760MOZ_CAN_RUN_SCRIPT static bool
10761passOptionalSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10762{
10763 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceWithDefaultValue");
10764 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10767( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10765 "TestJSImplInterface", "passOptionalSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10767( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10766 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10767( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10767 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10767( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10768
10769 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10770 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10771 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10772 if (objIsXray) {
10773 unwrappedObj.emplace(cx, obj);
10774 }
10775 binding_detail::AutoSequence<int32_t> arg0;
10776 if (args.hasDefined(0)) {
10777 if (args[0].isObject()) {
10778 JS::ForOfIterator iter(cx);
10779 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10780 return false;
10781 }
10782 if (!iter.valueIsIterable()) {
10783 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10784 return false;
10785 }
10786 binding_detail::AutoSequence<int32_t> &arr = arg0;
10787 JS::Rooted<JS::Value> temp(cx);
10788 while (true) {
10789 bool done;
10790 if (!iter.next(&temp, &done)) {
10791 return false;
10792 }
10793 if (done) {
10794 break;
10795 }
10796 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10797 if (!slotPtr) {
10798 JS_ReportOutOfMemory(cx);
10799 return false;
10800 }
10801 int32_t& slot = *slotPtr;
10802 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10803 return false;
10804 }
10805 }
10806 } else {
10807 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10808 return false;
10809 }
10810 } else {
10811 /* arg0 array is already empty; nothing to do */
10812 }
10813 if (objIsXray) {
10814 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10815 // we know Xrays have no dynamic unwrap behavior.
10816 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10817 if (!unwrappedObj.ref()) {
10818 return false;
10819 }
10820 }
10821 FastErrorResult rv;
10822 // NOTE: This assert does NOT call the function.
10823 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");
10824 MOZ_KnownLive(self)(self)->PassOptionalSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10825 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceWithDefaultValue"
)), 0))
) {
10826 return false;
10827 }
10828 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10828); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10828); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10829 args.rval().setUndefined();
10830 return true;
10831}
10832
10833static const JSJitInfo passOptionalSequenceWithDefaultValue_methodinfo = {
10834 { (JSJitGetterOp)passOptionalSequenceWithDefaultValue },
10835 { prototypes::id::TestJSImplInterface },
10836 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10837 JSJitInfo::Method,
10838 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10839 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10840 false, /* isInfallible. False in setters. */
10841 false, /* isMovable. Not relevant for setters. */
10842 false, /* isEliminatable. Not relevant for setters. */
10843 false, /* isAlwaysInSlot. Only relevant for getters. */
10844 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10845 false, /* isTypedMethod. Only relevant for methods. */
10846 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10847};
10848
10849MOZ_CAN_RUN_SCRIPT static bool
10850passOptionalNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10851{
10852 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequence");
10853 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10856( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10854 "TestJSImplInterface", "passOptionalNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10856( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10855 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10856( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10856 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10856( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10857
10858 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10859 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10860 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10861 if (objIsXray) {
10862 unwrappedObj.emplace(cx, obj);
10863 }
10864 Optional<Nullable<Sequence<int32_t>>> arg0;
10865 if (args.hasDefined(0)) {
10866 arg0.Construct();
10867 if (args[0].isObject()) {
10868 JS::ForOfIterator iter(cx);
10869 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10870 return false;
10871 }
10872 if (!iter.valueIsIterable()) {
10873 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10874 return false;
10875 }
10876 Sequence<int32_t> &arr = arg0.Value().SetValue();
10877 JS::Rooted<JS::Value> temp(cx);
10878 while (true) {
10879 bool done;
10880 if (!iter.next(&temp, &done)) {
10881 return false;
10882 }
10883 if (done) {
10884 break;
10885 }
10886 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10887 if (!slotPtr) {
10888 JS_ReportOutOfMemory(cx);
10889 return false;
10890 }
10891 int32_t& slot = *slotPtr;
10892 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10893 return false;
10894 }
10895 }
10896 } else if (args[0].isNullOrUndefined()) {
10897 arg0.Value().SetNull();
10898 } else {
10899 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10900 return false;
10901 }
10902 }
10903 if (objIsXray) {
10904 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10905 // we know Xrays have no dynamic unwrap behavior.
10906 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10907 if (!unwrappedObj.ref()) {
10908 return false;
10909 }
10910 }
10911 FastErrorResult rv;
10912 // NOTE: This assert does NOT call the function.
10913 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");
10914 MOZ_KnownLive(self)(self)->PassOptionalNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10915 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequence"
)), 0))
) {
10916 return false;
10917 }
10918 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10918); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 10918); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
10919 args.rval().setUndefined();
10920 return true;
10921}
10922
10923static const JSJitInfo passOptionalNullableSequence_methodinfo = {
10924 { (JSJitGetterOp)passOptionalNullableSequence },
10925 { prototypes::id::TestJSImplInterface },
10926 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10927 JSJitInfo::Method,
10928 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10929 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10930 false, /* isInfallible. False in setters. */
10931 false, /* isMovable. Not relevant for setters. */
10932 false, /* isEliminatable. Not relevant for setters. */
10933 false, /* isAlwaysInSlot. Only relevant for getters. */
10934 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10935 false, /* isTypedMethod. Only relevant for methods. */
10936 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10937};
10938
10939MOZ_CAN_RUN_SCRIPT static bool
10940passOptionalNullableSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10941{
10942 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue");
10943 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10946( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10944 "TestJSImplInterface", "passOptionalNullableSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10946( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10945 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10946( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10946 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10946( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10947
10948 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10949 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10950 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10951 if (objIsXray) {
10952 unwrappedObj.emplace(cx, obj);
10953 }
10954 Nullable<Sequence<int32_t>> arg0;
10955 if (args.hasDefined(0)) {
10956 if (args[0].isObject()) {
10957 JS::ForOfIterator iter(cx);
10958 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10959 return false;
10960 }
10961 if (!iter.valueIsIterable()) {
10962 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10963 return false;
10964 }
10965 Sequence<int32_t> &arr = arg0.SetValue();
10966 JS::Rooted<JS::Value> temp(cx);
10967 while (true) {
10968 bool done;
10969 if (!iter.next(&temp, &done)) {
10970 return false;
10971 }
10972 if (done) {
10973 break;
10974 }
10975 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10976 if (!slotPtr) {
10977 JS_ReportOutOfMemory(cx);
10978 return false;
10979 }
10980 int32_t& slot = *slotPtr;
10981 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10982 return false;
10983 }
10984 }
10985 } else if (args[0].isNullOrUndefined()) {
10986 arg0.SetNull();
10987 } else {
10988 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10989 return false;
10990 }
10991 } else {
10992 arg0.SetNull();
10993 }
10994 if (objIsXray) {
10995 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10996 // we know Xrays have no dynamic unwrap behavior.
10997 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10998 if (!unwrappedObj.ref()) {
10999 return false;
11000 }
11001 }
11002 FastErrorResult rv;
11003 // NOTE: This assert does NOT call the function.
11004 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");
11005 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11006 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue"
)), 0))
) {
11007 return false;
11008 }
11009 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11009); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11010 args.rval().setUndefined();
11011 return true;
11012}
11013
11014static const JSJitInfo passOptionalNullableSequenceWithDefaultValue_methodinfo = {
11015 { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue },
11016 { prototypes::id::TestJSImplInterface },
11017 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11018 JSJitInfo::Method,
11019 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11020 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11021 false, /* isInfallible. False in setters. */
11022 false, /* isMovable. Not relevant for setters. */
11023 false, /* isEliminatable. Not relevant for setters. */
11024 false, /* isAlwaysInSlot. Only relevant for getters. */
11025 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11026 false, /* isTypedMethod. Only relevant for methods. */
11027 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11028};
11029
11030MOZ_CAN_RUN_SCRIPT static bool
11031passOptionalNullableSequenceWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11032{
11033 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2");
11034 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11037( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11035 "TestJSImplInterface", "passOptionalNullableSequenceWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11037( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11036 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11037( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11037 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11037( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11038
11039 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11040 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11041 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11042 if (objIsXray) {
11043 unwrappedObj.emplace(cx, obj);
11044 }
11045 Nullable<Sequence<int32_t>> arg0;
11046 if (args.hasDefined(0)) {
11047 if (args[0].isObject()) {
11048 JS::ForOfIterator iter(cx);
11049 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11050 return false;
11051 }
11052 if (!iter.valueIsIterable()) {
11053 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11054 return false;
11055 }
11056 Sequence<int32_t> &arr = arg0.SetValue();
11057 JS::Rooted<JS::Value> temp(cx);
11058 while (true) {
11059 bool done;
11060 if (!iter.next(&temp, &done)) {
11061 return false;
11062 }
11063 if (done) {
11064 break;
11065 }
11066 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
11067 if (!slotPtr) {
11068 JS_ReportOutOfMemory(cx);
11069 return false;
11070 }
11071 int32_t& slot = *slotPtr;
11072 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
11073 return false;
11074 }
11075 }
11076 } else if (args[0].isNullOrUndefined()) {
11077 arg0.SetNull();
11078 } else {
11079 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11080 return false;
11081 }
11082 } else {
11083 arg0.SetValue();
11084 }
11085 if (objIsXray) {
11086 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11087 // we know Xrays have no dynamic unwrap behavior.
11088 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11089 if (!unwrappedObj.ref()) {
11090 return false;
11091 }
11092 }
11093 FastErrorResult rv;
11094 // NOTE: This assert does NOT call the function.
11095 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");
11096 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11097 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2"
)), 0))
) {
11098 return false;
11099 }
11100 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11100); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11100); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11101 args.rval().setUndefined();
11102 return true;
11103}
11104
11105static const JSJitInfo passOptionalNullableSequenceWithDefaultValue2_methodinfo = {
11106 { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue2 },
11107 { prototypes::id::TestJSImplInterface },
11108 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11109 JSJitInfo::Method,
11110 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11111 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11112 false, /* isInfallible. False in setters. */
11113 false, /* isMovable. Not relevant for setters. */
11114 false, /* isEliminatable. Not relevant for setters. */
11115 false, /* isAlwaysInSlot. Only relevant for getters. */
11116 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11117 false, /* isTypedMethod. Only relevant for methods. */
11118 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11119};
11120
11121MOZ_CAN_RUN_SCRIPT static bool
11122passOptionalObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11123{
11124 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObjectSequence");
11125 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11128( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11126 "TestJSImplInterface", "passOptionalObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11128( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11127 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11128( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11128 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11128( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11129
11130 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11131 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11132 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11133 if (objIsXray) {
11134 unwrappedObj.emplace(cx, obj);
11135 }
11136 Optional<Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>>> arg0;
11137 if (args.hasDefined(0)) {
11138 arg0.Construct();
11139 if (args[0].isObject()) {
11140 JS::ForOfIterator iter(cx);
11141 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11142 return false;
11143 }
11144 if (!iter.valueIsIterable()) {
11145 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11146 return false;
11147 }
11148 Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0.Value();
11149 JS::Rooted<JS::Value> temp(cx);
11150 while (true) {
11151 bool done;
11152 if (!iter.next(&temp, &done)) {
11153 return false;
11154 }
11155 if (done) {
11156 break;
11157 }
11158 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11159 if (!slotPtr) {
11160 JS_ReportOutOfMemory(cx);
11161 return false;
11162 }
11163 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
11164 if (temp.isObject()) {
11165 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
11166 {
11167 // Our JSContext should be in the right global to do unwrapping in.
11168 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
11169 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
11170 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
11171 return false;
11172 }
11173 }
11174 } else {
11175 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11176 return false;
11177 }
11178 }
11179 } else {
11180 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11181 return false;
11182 }
11183 }
11184 if (objIsXray) {
11185 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11186 // we know Xrays have no dynamic unwrap behavior.
11187 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11188 if (!unwrappedObj.ref()) {
11189 return false;
11190 }
11191 }
11192 FastErrorResult rv;
11193 // NOTE: This assert does NOT call the function.
11194 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");
11195 MOZ_KnownLive(self)(self)->PassOptionalObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11196 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectSequence"
)), 0))
) {
11197 return false;
11198 }
11199 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11199); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11199); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11200 args.rval().setUndefined();
11201 return true;
11202}
11203
11204static const JSJitInfo passOptionalObjectSequence_methodinfo = {
11205 { (JSJitGetterOp)passOptionalObjectSequence },
11206 { prototypes::id::TestJSImplInterface },
11207 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11208 JSJitInfo::Method,
11209 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11210 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11211 false, /* isInfallible. False in setters. */
11212 false, /* isMovable. Not relevant for setters. */
11213 false, /* isEliminatable. Not relevant for setters. */
11214 false, /* isAlwaysInSlot. Only relevant for getters. */
11215 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11216 false, /* isTypedMethod. Only relevant for methods. */
11217 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11218};
11219
11220MOZ_CAN_RUN_SCRIPT static bool
11221passExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11222{
11223 BindingCallContext cx(cx_, "TestJSImplInterface.passExternalInterfaceSequence");
11224 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11227( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11225 "TestJSImplInterface", "passExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11227( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11226 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11227( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11227 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11227( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11228
11229 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11230 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternalInterfaceSequence", 1)) {
11231 return false;
11232 }
11233 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11234 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11235 if (objIsXray) {
11236 unwrappedObj.emplace(cx, obj);
11237 }
11238 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0;
11239 if (args[0].isObject()) {
11240 JS::ForOfIterator iter(cx);
11241 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11242 return false;
11243 }
11244 if (!iter.valueIsIterable()) {
11245 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11246 return false;
11247 }
11248 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0;
11249 JS::Rooted<JS::Value> temp(cx);
11250 while (true) {
11251 bool done;
11252 if (!iter.next(&temp, &done)) {
11253 return false;
11254 }
11255 if (done) {
11256 break;
11257 }
11258 RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11259 if (!slotPtr) {
11260 JS_ReportOutOfMemory(cx);
11261 return false;
11262 }
11263 RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr;
11264 if (temp.isObject()) {
11265 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
11266 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
11267 JS::Rooted<JSObject*> source(cx, &temp.toObject());
11268 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)))
) {
11269 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface");
11270 return false;
11271 }
11272 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"
, 11272); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { MOZ_CrashSequence(__null, 11272); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
11273 slot = tempHolder;
11274 } else {
11275 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11276 return false;
11277 }
11278 }
11279 } else {
11280 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11281 return false;
11282 }
11283 if (objIsXray) {
11284 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11285 // we know Xrays have no dynamic unwrap behavior.
11286 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11287 if (!unwrappedObj.ref()) {
11288 return false;
11289 }
11290 }
11291 FastErrorResult rv;
11292 // NOTE: This assert does NOT call the function.
11293 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");
11294 MOZ_KnownLive(self)(self)->PassExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11295 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceSequence"
)), 0))
) {
11296 return false;
11297 }
11298 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11298); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11299 args.rval().setUndefined();
11300 return true;
11301}
11302
11303static const JSJitInfo passExternalInterfaceSequence_methodinfo = {
11304 { (JSJitGetterOp)passExternalInterfaceSequence },
11305 { prototypes::id::TestJSImplInterface },
11306 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11307 JSJitInfo::Method,
11308 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11309 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11310 false, /* isInfallible. False in setters. */
11311 false, /* isMovable. Not relevant for setters. */
11312 false, /* isEliminatable. Not relevant for setters. */
11313 false, /* isAlwaysInSlot. Only relevant for getters. */
11314 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11315 false, /* isTypedMethod. Only relevant for methods. */
11316 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11317};
11318
11319MOZ_CAN_RUN_SCRIPT static bool
11320passNullableExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11321{
11322 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternalInterfaceSequence");
11323 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11326( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11324 "TestJSImplInterface", "passNullableExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11326( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11325 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11326( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11326 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11326( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11327
11328 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11329 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence", 1)) {
11330 return false;
11331 }
11332 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11333 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11334 if (objIsXray) {
11335 unwrappedObj.emplace(cx, obj);
11336 }
11337 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0;
11338 if (args[0].isObject()) {
11339 JS::ForOfIterator iter(cx);
11340 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11341 return false;
11342 }
11343 if (!iter.valueIsIterable()) {
11344 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11345 return false;
11346 }
11347 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0;
11348 JS::Rooted<JS::Value> temp(cx);
11349 while (true) {
11350 bool done;
11351 if (!iter.next(&temp, &done)) {
11352 return false;
11353 }
11354 if (done) {
11355 break;
11356 }
11357 RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11358 if (!slotPtr) {
11359 JS_ReportOutOfMemory(cx);
11360 return false;
11361 }
11362 RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr;
11363 if (temp.isObject()) {
11364 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
11365 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
11366 JS::Rooted<JSObject*> source(cx, &temp.toObject());
11367 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)))
) {
11368 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface");
11369 return false;
11370 }
11371 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"
, 11371); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { MOZ_CrashSequence(__null, 11371); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
11372 slot = tempHolder;
11373 } else if (temp.isNullOrUndefined()) {
11374 slot = nullptr;
11375 } else {
11376 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11377 return false;
11378 }
11379 }
11380 } else {
11381 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11382 return false;
11383 }
11384 if (objIsXray) {
11385 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11386 // we know Xrays have no dynamic unwrap behavior.
11387 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11388 if (!unwrappedObj.ref()) {
11389 return false;
11390 }
11391 }
11392 FastErrorResult rv;
11393 // NOTE: This assert does NOT call the function.
11394 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");
11395 MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11396 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence"
)), 0))
) {
11397 return false;
11398 }
11399 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11399); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11399); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11400 args.rval().setUndefined();
11401 return true;
11402}
11403
11404static const JSJitInfo passNullableExternalInterfaceSequence_methodinfo = {
11405 { (JSJitGetterOp)passNullableExternalInterfaceSequence },
11406 { prototypes::id::TestJSImplInterface },
11407 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11408 JSJitInfo::Method,
11409 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11410 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11411 false, /* isInfallible. False in setters. */
11412 false, /* isMovable. Not relevant for setters. */
11413 false, /* isEliminatable. Not relevant for setters. */
11414 false, /* isAlwaysInSlot. Only relevant for getters. */
11415 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11416 false, /* isTypedMethod. Only relevant for methods. */
11417 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11418};
11419
11420MOZ_CAN_RUN_SCRIPT static bool
11421receiveStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11422{
11423 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11426( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11424 "TestJSImplInterface", "receiveStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11426( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11425 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11426( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11426 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11426( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11427
11428 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11429 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11430 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11431 if (objIsXray) {
11432 unwrappedObj.emplace(cx, obj);
11433 }
11434 if (objIsXray) {
11435 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11436 // we know Xrays have no dynamic unwrap behavior.
11437 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11438 if (!unwrappedObj.ref()) {
11439 return false;
11440 }
11441 }
11442 FastErrorResult rv;
11443 nsTArray<nsString> result;
11444 // NOTE: This assert does NOT call the function.
11445 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");
11446 MOZ_KnownLive(self)(self)->ReceiveStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11447 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveStringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveStringSequence"
)), 0))
) {
11448 return false;
11449 }
11450 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11450); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11451
11452 uint32_t length = result.Length();
11453 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11454 if (!returnArray) {
11455 return false;
11456 }
11457 // Scope for 'tmp'
11458 {
11459 JS::Rooted<JS::Value> tmp(cx);
11460 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11461 // Control block to let us common up the JS_DefineElement calls when there
11462 // are different ways to succeed at wrapping the object.
11463 do {
11464 if (!xpc::NonVoidStringToJsval(cx, result[sequenceIdx0], &tmp)) {
11465 return false;
11466 }
11467 break;
11468 } while (false);
11469 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11470 JSPROP_ENUMERATE)) {
11471 return false;
11472 }
11473 }
11474 }
11475 args.rval().setObject(*returnArray);
11476 return true;
11477}
11478
11479static const JSJitInfo receiveStringSequence_methodinfo = {
11480 { (JSJitGetterOp)receiveStringSequence },
11481 { prototypes::id::TestJSImplInterface },
11482 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11483 JSJitInfo::Method,
11484 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11485 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11486 false, /* isInfallible. False in setters. */
11487 false, /* isMovable. Not relevant for setters. */
11488 false, /* isEliminatable. Not relevant for setters. */
11489 false, /* isAlwaysInSlot. Only relevant for getters. */
11490 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11491 false, /* isTypedMethod. Only relevant for methods. */
11492 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11493};
11494
11495MOZ_CAN_RUN_SCRIPT static bool
11496receiveByteStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11497{
11498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11501( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11499 "TestJSImplInterface", "receiveByteStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11501( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11501( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11501( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11502
11503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11504 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11505 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11506 if (objIsXray) {
11507 unwrappedObj.emplace(cx, obj);
11508 }
11509 if (objIsXray) {
11510 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11511 // we know Xrays have no dynamic unwrap behavior.
11512 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11513 if (!unwrappedObj.ref()) {
11514 return false;
11515 }
11516 }
11517 FastErrorResult rv;
11518 nsTArray<nsCString> result;
11519 // NOTE: This assert does NOT call the function.
11520 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");
11521 MOZ_KnownLive(self)(self)->ReceiveByteStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11522 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByteStringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByteStringSequence"
)), 0))
) {
11523 return false;
11524 }
11525 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11525); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11526
11527 uint32_t length = result.Length();
11528 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11529 if (!returnArray) {
11530 return false;
11531 }
11532 // Scope for 'tmp'
11533 {
11534 JS::Rooted<JS::Value> tmp(cx);
11535 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11536 // Control block to let us common up the JS_DefineElement calls when there
11537 // are different ways to succeed at wrapping the object.
11538 do {
11539 if (!NonVoidByteStringToJsval(cx, result[sequenceIdx0], &tmp)) {
11540 return false;
11541 }
11542 break;
11543 } while (false);
11544 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11545 JSPROP_ENUMERATE)) {
11546 return false;
11547 }
11548 }
11549 }
11550 args.rval().setObject(*returnArray);
11551 return true;
11552}
11553
11554static const JSJitInfo receiveByteStringSequence_methodinfo = {
11555 { (JSJitGetterOp)receiveByteStringSequence },
11556 { prototypes::id::TestJSImplInterface },
11557 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11558 JSJitInfo::Method,
11559 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11560 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11561 false, /* isInfallible. False in setters. */
11562 false, /* isMovable. Not relevant for setters. */
11563 false, /* isEliminatable. Not relevant for setters. */
11564 false, /* isAlwaysInSlot. Only relevant for getters. */
11565 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11566 false, /* isTypedMethod. Only relevant for methods. */
11567 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11568};
11569
11570MOZ_CAN_RUN_SCRIPT static bool
11571receiveUTF8StringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11572{
11573 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11576( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11574 "TestJSImplInterface", "receiveUTF8StringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11576( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11575 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11576( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11576 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11576( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11577
11578 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11579 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11580 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11581 if (objIsXray) {
11582 unwrappedObj.emplace(cx, obj);
11583 }
11584 if (objIsXray) {
11585 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11586 // we know Xrays have no dynamic unwrap behavior.
11587 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11588 if (!unwrappedObj.ref()) {
11589 return false;
11590 }
11591 }
11592 FastErrorResult rv;
11593 nsTArray<nsCString> result;
11594 // NOTE: This assert does NOT call the function.
11595 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");
11596 MOZ_KnownLive(self)(self)->ReceiveUTF8StringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11597 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUTF8StringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUTF8StringSequence"
)), 0))
) {
11598 return false;
11599 }
11600 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11600); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11600); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11601
11602 uint32_t length = result.Length();
11603 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11604 if (!returnArray) {
11605 return false;
11606 }
11607 // Scope for 'tmp'
11608 {
11609 JS::Rooted<JS::Value> tmp(cx);
11610 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11611 // Control block to let us common up the JS_DefineElement calls when there
11612 // are different ways to succeed at wrapping the object.
11613 do {
11614 if (!NonVoidUTF8StringToJsval(cx, result[sequenceIdx0], &tmp)) {
11615 return false;
11616 }
11617 break;
11618 } while (false);
11619 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11620 JSPROP_ENUMERATE)) {
11621 return false;
11622 }
11623 }
11624 }
11625 args.rval().setObject(*returnArray);
11626 return true;
11627}
11628
11629static const JSJitInfo receiveUTF8StringSequence_methodinfo = {
11630 { (JSJitGetterOp)receiveUTF8StringSequence },
11631 { prototypes::id::TestJSImplInterface },
11632 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11633 JSJitInfo::Method,
11634 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11635 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11636 false, /* isInfallible. False in setters. */
11637 false, /* isMovable. Not relevant for setters. */
11638 false, /* isEliminatable. Not relevant for setters. */
11639 false, /* isAlwaysInSlot. Only relevant for getters. */
11640 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11641 false, /* isTypedMethod. Only relevant for methods. */
11642 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11643};
11644
11645MOZ_CAN_RUN_SCRIPT static bool
11646receiveAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11647{
11648 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11651( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11649 "TestJSImplInterface", "receiveAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11651( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11650 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11651( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11651 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11651( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11652
11653 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11654 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11655 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11656 if (objIsXray) {
11657 unwrappedObj.emplace(cx, obj);
11658 }
11659 if (objIsXray) {
11660 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11661 // we know Xrays have no dynamic unwrap behavior.
11662 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11663 if (!unwrappedObj.ref()) {
11664 return false;
11665 }
11666 }
11667 FastErrorResult rv;
11668 nsTArray<JS::Value> result;
11669 SequenceRooter<JS::Value > resultRooter(cx, &result);
11670 // NOTE: This assert does NOT call the function.
11671 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");
11672 MOZ_KnownLive(self)(self)->ReceiveAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11673 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnySequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnySequence"
)), 0))
) {
11674 return false;
11675 }
11676 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11676); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11676); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11677
11678 uint32_t length = result.Length();
11679 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11680 if (!returnArray) {
11681 return false;
11682 }
11683 // Scope for 'tmp'
11684 {
11685 JS::Rooted<JS::Value> tmp(cx);
11686 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11687 // Control block to let us common up the JS_DefineElement calls when there
11688 // are different ways to succeed at wrapping the object.
11689 do {
11690 JS::ExposeValueToActiveJS(result[sequenceIdx0]);
11691 tmp.set(result[sequenceIdx0]);
11692 if (!MaybeWrapValue(cx, &tmp)) {
11693 return false;
11694 }
11695 break;
11696 } while (false);
11697 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11698 JSPROP_ENUMERATE)) {
11699 return false;
11700 }
11701 }
11702 }
11703 args.rval().setObject(*returnArray);
11704 return true;
11705}
11706
11707static const JSJitInfo receiveAnySequence_methodinfo = {
11708 { (JSJitGetterOp)receiveAnySequence },
11709 { prototypes::id::TestJSImplInterface },
11710 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11711 JSJitInfo::Method,
11712 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11713 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11714 false, /* isInfallible. False in setters. */
11715 false, /* isMovable. Not relevant for setters. */
11716 false, /* isEliminatable. Not relevant for setters. */
11717 false, /* isAlwaysInSlot. Only relevant for getters. */
11718 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11719 false, /* isTypedMethod. Only relevant for methods. */
11720 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11721};
11722
11723MOZ_CAN_RUN_SCRIPT static bool
11724receiveNullableAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11725{
11726 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11729( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11727 "TestJSImplInterface", "receiveNullableAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11729( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11728 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11729( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11729 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11729( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11730
11731 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11732 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11733 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11734 if (objIsXray) {
11735 unwrappedObj.emplace(cx, obj);
11736 }
11737 if (objIsXray) {
11738 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11739 // we know Xrays have no dynamic unwrap behavior.
11740 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11741 if (!unwrappedObj.ref()) {
11742 return false;
11743 }
11744 }
11745 FastErrorResult rv;
11746 Nullable<nsTArray<JS::Value>> result;
11747 SequenceRooter<JS::Value > resultRooter(cx, &result);
11748 // NOTE: This assert does NOT call the function.
11749 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");
11750 MOZ_KnownLive(self)(self)->ReceiveNullableAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11751 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableAnySequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableAnySequence"
)), 0))
) {
11752 return false;
11753 }
11754 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11754); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11754); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11755
11756 if (result.IsNull()) {
11757 args.rval().setNull();
11758 return true;
11759 }
11760
11761 uint32_t length = result.Value().Length();
11762 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11763 if (!returnArray) {
11764 return false;
11765 }
11766 // Scope for 'tmp'
11767 {
11768 JS::Rooted<JS::Value> tmp(cx);
11769 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11770 // Control block to let us common up the JS_DefineElement calls when there
11771 // are different ways to succeed at wrapping the object.
11772 do {
11773 JS::ExposeValueToActiveJS(result.Value()[sequenceIdx0]);
11774 tmp.set(result.Value()[sequenceIdx0]);
11775 if (!MaybeWrapValue(cx, &tmp)) {
11776 return false;
11777 }
11778 break;
11779 } while (false);
11780 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11781 JSPROP_ENUMERATE)) {
11782 return false;
11783 }
11784 }
11785 }
11786 args.rval().setObject(*returnArray);
11787 return true;
11788}
11789
11790static const JSJitInfo receiveNullableAnySequence_methodinfo = {
11791 { (JSJitGetterOp)receiveNullableAnySequence },
11792 { prototypes::id::TestJSImplInterface },
11793 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11794 JSJitInfo::Method,
11795 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11796 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
11797 false, /* isInfallible. False in setters. */
11798 false, /* isMovable. Not relevant for setters. */
11799 false, /* isEliminatable. Not relevant for setters. */
11800 false, /* isAlwaysInSlot. Only relevant for getters. */
11801 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11802 false, /* isTypedMethod. Only relevant for methods. */
11803 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11804};
11805
11806MOZ_CAN_RUN_SCRIPT static bool
11807receiveObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11808{
11809 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11812( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11810 "TestJSImplInterface", "receiveObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11812( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11811 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11812( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11812 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11812( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11813
11814 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11815 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11816 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11817 if (objIsXray) {
11818 unwrappedObj.emplace(cx, obj);
11819 }
11820 if (objIsXray) {
11821 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11822 // we know Xrays have no dynamic unwrap behavior.
11823 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11824 if (!unwrappedObj.ref()) {
11825 return false;
11826 }
11827 }
11828 FastErrorResult rv;
11829 nsTArray<JSObject*> result;
11830 SequenceRooter<JSObject* > resultRooter(cx, &result);
11831 // NOTE: This assert does NOT call the function.
11832 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");
11833 MOZ_KnownLive(self)(self)->ReceiveObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11834 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObjectSequence"
)), 0))
) {
11835 return false;
11836 }
11837 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11837); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11837); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11838
11839 uint32_t length = result.Length();
11840 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11841 if (!returnArray) {
11842 return false;
11843 }
11844 // Scope for 'tmp'
11845 {
11846 JS::Rooted<JS::Value> tmp(cx);
11847 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11848 // Control block to let us common up the JS_DefineElement calls when there
11849 // are different ways to succeed at wrapping the object.
11850 do {
11851 JS::ExposeObjectToActiveJS(result[sequenceIdx0]);
11852 tmp.setObject(*result[sequenceIdx0]);
11853 if (!MaybeWrapObjectValue(cx, &tmp)) {
11854 return false;
11855 }
11856 break;
11857 } while (false);
11858 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11859 JSPROP_ENUMERATE)) {
11860 return false;
11861 }
11862 }
11863 }
11864 args.rval().setObject(*returnArray);
11865 return true;
11866}
11867
11868static const JSJitInfo receiveObjectSequence_methodinfo = {
11869 { (JSJitGetterOp)receiveObjectSequence },
11870 { prototypes::id::TestJSImplInterface },
11871 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11872 JSJitInfo::Method,
11873 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11874 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11875 false, /* isInfallible. False in setters. */
11876 false, /* isMovable. Not relevant for setters. */
11877 false, /* isEliminatable. Not relevant for setters. */
11878 false, /* isAlwaysInSlot. Only relevant for getters. */
11879 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11880 false, /* isTypedMethod. Only relevant for methods. */
11881 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11882};
11883
11884MOZ_CAN_RUN_SCRIPT static bool
11885receiveNullableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11886{
11887 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11890( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11888 "TestJSImplInterface", "receiveNullableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11890( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11889 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11890( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11890 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11890( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11891
11892 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11893 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11894 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11895 if (objIsXray) {
11896 unwrappedObj.emplace(cx, obj);
11897 }
11898 if (objIsXray) {
11899 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11900 // we know Xrays have no dynamic unwrap behavior.
11901 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11902 if (!unwrappedObj.ref()) {
11903 return false;
11904 }
11905 }
11906 FastErrorResult rv;
11907 nsTArray<JSObject*> result;
11908 SequenceRooter<JSObject* > resultRooter(cx, &result);
11909 // NOTE: This assert does NOT call the function.
11910 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");
11911 MOZ_KnownLive(self)(self)->ReceiveNullableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11912 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObjectSequence"
)), 0))
) {
11913 return false;
11914 }
11915 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11915); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 11915); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
11916
11917 uint32_t length = result.Length();
11918 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11919 if (!returnArray) {
11920 return false;
11921 }
11922 // Scope for 'tmp'
11923 {
11924 JS::Rooted<JS::Value> tmp(cx);
11925 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11926 // Control block to let us common up the JS_DefineElement calls when there
11927 // are different ways to succeed at wrapping the object.
11928 do {
11929 if (result[sequenceIdx0]) {
11930 JS::ExposeObjectToActiveJS(result[sequenceIdx0]);
11931 }
11932 tmp.setObjectOrNull(result[sequenceIdx0]);
11933 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
11934 return false;
11935 }
11936 break;
11937 } while (false);
11938 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11939 JSPROP_ENUMERATE)) {
11940 return false;
11941 }
11942 }
11943 }
11944 args.rval().setObject(*returnArray);
11945 return true;
11946}
11947
11948static const JSJitInfo receiveNullableObjectSequence_methodinfo = {
11949 { (JSJitGetterOp)receiveNullableObjectSequence },
11950 { prototypes::id::TestJSImplInterface },
11951 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11952 JSJitInfo::Method,
11953 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11954 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11955 false, /* isInfallible. False in setters. */
11956 false, /* isMovable. Not relevant for setters. */
11957 false, /* isEliminatable. Not relevant for setters. */
11958 false, /* isAlwaysInSlot. Only relevant for getters. */
11959 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11960 false, /* isTypedMethod. Only relevant for methods. */
11961 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11962};
11963
11964MOZ_CAN_RUN_SCRIPT static bool
11965passSequenceOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11966{
11967 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequences");
11968 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11971( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11969 "TestJSImplInterface", "passSequenceOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11971( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11970 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11971( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11971 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11971( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11972
11973 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11974 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequences", 1)) {
11975 return false;
11976 }
11977 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11978 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11979 if (objIsXray) {
11980 unwrappedObj.emplace(cx, obj);
11981 }
11982 binding_detail::AutoSequence<Sequence<int32_t>> arg0;
11983 if (args[0].isObject()) {
11984 JS::ForOfIterator iter(cx);
11985 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11986 return false;
11987 }
11988 if (!iter.valueIsIterable()) {
11989 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11990 return false;
11991 }
11992 binding_detail::AutoSequence<Sequence<int32_t>> &arr = arg0;
11993 JS::Rooted<JS::Value> temp(cx);
11994 while (true) {
11995 bool done;
11996 if (!iter.next(&temp, &done)) {
11997 return false;
11998 }
11999 if (done) {
12000 break;
12001 }
12002 Sequence<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
12003 if (!slotPtr) {
12004 JS_ReportOutOfMemory(cx);
12005 return false;
12006 }
12007 Sequence<int32_t>& slot = *slotPtr;
12008 if (temp.isObject()) {
12009 JS::ForOfIterator iter1(cx);
12010 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
12011 return false;
12012 }
12013 if (!iter1.valueIsIterable()) {
12014 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12015 return false;
12016 }
12017 Sequence<int32_t> &arr1 = slot;
12018 JS::Rooted<JS::Value> temp1(cx);
12019 while (true) {
12020 bool done1;
12021 if (!iter1.next(&temp1, &done1)) {
12022 return false;
12023 }
12024 if (done1) {
12025 break;
12026 }
12027 int32_t* slotPtr1 = arr1.AppendElement(mozilla::fallible);
12028 if (!slotPtr1) {
12029 JS_ReportOutOfMemory(cx);
12030 return false;
12031 }
12032 int32_t& slot1 = *slotPtr1;
12033 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp1, "Element of element of argument 1", &slot1)) {
12034 return false;
12035 }
12036 }
12037 } else {
12038 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12039 return false;
12040 }
12041 }
12042 } else {
12043 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12044 return false;
12045 }
12046 if (objIsXray) {
12047 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12048 // we know Xrays have no dynamic unwrap behavior.
12049 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12050 if (!unwrappedObj.ref()) {
12051 return false;
12052 }
12053 }
12054 FastErrorResult rv;
12055 // NOTE: This assert does NOT call the function.
12056 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");
12057 MOZ_KnownLive(self)(self)->PassSequenceOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12058 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequences"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequences"
)), 0))
) {
12059 return false;
12060 }
12061 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12061); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12061); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12062 args.rval().setUndefined();
12063 return true;
12064}
12065
12066static const JSJitInfo passSequenceOfSequences_methodinfo = {
12067 { (JSJitGetterOp)passSequenceOfSequences },
12068 { prototypes::id::TestJSImplInterface },
12069 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12070 JSJitInfo::Method,
12071 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12072 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12073 false, /* isInfallible. False in setters. */
12074 false, /* isMovable. Not relevant for setters. */
12075 false, /* isEliminatable. Not relevant for setters. */
12076 false, /* isAlwaysInSlot. Only relevant for getters. */
12077 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12078 false, /* isTypedMethod. Only relevant for methods. */
12079 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12080};
12081
12082MOZ_CAN_RUN_SCRIPT static bool
12083passSequenceOfSequencesOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12084{
12085 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequencesOfSequences");
12086 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12089( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12087 "TestJSImplInterface", "passSequenceOfSequencesOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12089( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12088 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12089( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12089 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12089( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12090
12091 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12092 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences", 1)) {
12093 return false;
12094 }
12095 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12096 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12097 if (objIsXray) {
12098 unwrappedObj.emplace(cx, obj);
12099 }
12100 binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> arg0;
12101 if (args[0].isObject()) {
12102 JS::ForOfIterator iter(cx);
12103 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
12104 return false;
12105 }
12106 if (!iter.valueIsIterable()) {
12107 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12108 return false;
12109 }
12110 binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> &arr = arg0;
12111 JS::Rooted<JS::Value> temp(cx);
12112 while (true) {
12113 bool done;
12114 if (!iter.next(&temp, &done)) {
12115 return false;
12116 }
12117 if (done) {
12118 break;
12119 }
12120 Sequence<Sequence<int32_t>>* slotPtr = arr.AppendElement(mozilla::fallible);
12121 if (!slotPtr) {
12122 JS_ReportOutOfMemory(cx);
12123 return false;
12124 }
12125 Sequence<Sequence<int32_t>>& slot = *slotPtr;
12126 if (temp.isObject()) {
12127 JS::ForOfIterator iter1(cx);
12128 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
12129 return false;
12130 }
12131 if (!iter1.valueIsIterable()) {
12132 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12133 return false;
12134 }
12135 Sequence<Sequence<int32_t>> &arr1 = slot;
12136 JS::Rooted<JS::Value> temp1(cx);
12137 while (true) {
12138 bool done1;
12139 if (!iter1.next(&temp1, &done1)) {
12140 return false;
12141 }
12142 if (done1) {
12143 break;
12144 }
12145 Sequence<int32_t>* slotPtr1 = arr1.AppendElement(mozilla::fallible);
12146 if (!slotPtr1) {
12147 JS_ReportOutOfMemory(cx);
12148 return false;
12149 }
12150 Sequence<int32_t>& slot1 = *slotPtr1;
12151 if (temp1.isObject()) {
12152 JS::ForOfIterator iter2(cx);
12153 if (!iter2.init(temp1, JS::ForOfIterator::AllowNonIterable)) {
12154 return false;
12155 }
12156 if (!iter2.valueIsIterable()) {
12157 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence");
12158 return false;
12159 }
12160 Sequence<int32_t> &arr2 = slot1;
12161 JS::Rooted<JS::Value> temp2(cx);
12162 while (true) {
12163 bool done2;
12164 if (!iter2.next(&temp2, &done2)) {
12165 return false;
12166 }
12167 if (done2) {
12168 break;
12169 }
12170 int32_t* slotPtr2 = arr2.AppendElement(mozilla::fallible);
12171 if (!slotPtr2) {
12172 JS_ReportOutOfMemory(cx);
12173 return false;
12174 }
12175 int32_t& slot2 = *slotPtr2;
12176 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp2, "Element of element of element of argument 1", &slot2)) {
12177 return false;
12178 }
12179 }
12180 } else {
12181 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence");
12182 return false;
12183 }
12184 }
12185 } else {
12186 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12187 return false;
12188 }
12189 }
12190 } else {
12191 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12192 return false;
12193 }
12194 if (objIsXray) {
12195 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12196 // we know Xrays have no dynamic unwrap behavior.
12197 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12198 if (!unwrappedObj.ref()) {
12199 return false;
12200 }
12201 }
12202 FastErrorResult rv;
12203 // NOTE: This assert does NOT call the function.
12204 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");
12205 MOZ_KnownLive(self)(self)->PassSequenceOfSequencesOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12206 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences"
)), 0))
) {
12207 return false;
12208 }
12209 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12209); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12209); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12210 args.rval().setUndefined();
12211 return true;
12212}
12213
12214static const JSJitInfo passSequenceOfSequencesOfSequences_methodinfo = {
12215 { (JSJitGetterOp)passSequenceOfSequencesOfSequences },
12216 { prototypes::id::TestJSImplInterface },
12217 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12218 JSJitInfo::Method,
12219 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12220 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12221 false, /* isInfallible. False in setters. */
12222 false, /* isMovable. Not relevant for setters. */
12223 false, /* isEliminatable. Not relevant for setters. */
12224 false, /* isAlwaysInSlot. Only relevant for getters. */
12225 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12226 false, /* isTypedMethod. Only relevant for methods. */
12227 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12228};
12229
12230MOZ_CAN_RUN_SCRIPT static bool
12231passRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12232{
12233 BindingCallContext cx(cx_, "TestJSImplInterface.passRecord");
12234 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12237( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12235 "TestJSImplInterface", "passRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12237( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12236 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12237( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12237 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12237( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
12238
12239 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12240 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecord", 1)) {
12241 return false;
12242 }
12243 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12244 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12245 if (objIsXray) {
12246 unwrappedObj.emplace(cx, obj);
12247 }
12248 Record<nsString, int32_t> arg0;
12249 if (args[0].isObject()) {
12250 auto& recordEntries = arg0.Entries();
12251
12252 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12253 JS::RootedVector<jsid> ids(cx);
12254 if (!js::GetPropertyKeys(cx, recordObj,
12255 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12256 return false;
12257 }
12258 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12259 JS_ReportOutOfMemory(cx);
12260 return false;
12261 }
12262 JS::Rooted<JS::Value> propNameValue(cx);
12263 JS::Rooted<JS::Value> temp(cx);
12264 JS::Rooted<jsid> curId(cx);
12265 JS::Rooted<JS::Value> idVal(cx);
12266 // Use a hashset to keep track of ids seen, to avoid
12267 // introducing nasty O(N^2) behavior scanning for them all the
12268 // time. Ideally we'd use a data structure with O(1) lookup
12269 // _and_ ordering for the MozMap, but we don't have one lying
12270 // around.
12271 nsTHashtable<nsStringHashKey> idsSeen;
12272 for (size_t i = 0; i < ids.length(); ++i) {
12273 curId = ids[i];
12274
12275 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12276 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12277 &desc)) {
12278 return false;
12279 }
12280
12281 if (desc.isNothing() || !desc->enumerable()) {
12282 continue;
12283 }
12284
12285 idVal = js::IdToValue(curId);
12286 nsString propName;
12287 // This will just throw if idVal is a Symbol, like the spec says
12288 // to do.
12289 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12290 return false;
12291 }
12292
12293 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12294 return false;
12295 }
12296
12297 Record<nsString, int32_t>::EntryType* entry;
12298 if (!idsSeen.EnsureInserted(propName)) {
12299 // Find the existing entry.
12300 auto idx = recordEntries.IndexOf(propName);
12301 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", 12302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12302); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12302 "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", 12302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12302); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12303 // Now blow it away to make it look like it was just added
12304 // to the array, because it's not obvious that it's
12305 // safe to write to its already-initialized mValue via our
12306 // normal codegen conversions. For example, the value
12307 // could be a union and this would change its type, but
12308 // codegen assumes we won't do that.
12309 entry = recordEntries.ReconstructElementAt(idx);
12310 } else {
12311 // Safe to do an infallible append here, because we did a
12312 // SetCapacity above to the right capacity.
12313 entry = recordEntries.AppendElement();
12314 }
12315 entry->mKey = propName;
12316 int32_t& slot = entry->mValue;
12317 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
12318 return false;
12319 }
12320 }
12321 } else {
12322 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12323 return false;
12324 }
12325 if (objIsXray) {
12326 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12327 // we know Xrays have no dynamic unwrap behavior.
12328 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12329 if (!unwrappedObj.ref()) {
12330 return false;
12331 }
12332 }
12333 FastErrorResult rv;
12334 // NOTE: This assert does NOT call the function.
12335 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");
12336 MOZ_KnownLive(self)(self)->PassRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12337 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecord"
)), 0))
) {
12338 return false;
12339 }
12340 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12340); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12340); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12341 args.rval().setUndefined();
12342 return true;
12343}
12344
12345static const JSJitInfo passRecord_methodinfo = {
12346 { (JSJitGetterOp)passRecord },
12347 { prototypes::id::TestJSImplInterface },
12348 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12349 JSJitInfo::Method,
12350 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12351 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12352 false, /* isInfallible. False in setters. */
12353 false, /* isMovable. Not relevant for setters. */
12354 false, /* isEliminatable. Not relevant for setters. */
12355 false, /* isAlwaysInSlot. Only relevant for getters. */
12356 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12357 false, /* isTypedMethod. Only relevant for methods. */
12358 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12359};
12360
12361MOZ_CAN_RUN_SCRIPT static bool
12362passNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12363{
12364 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecord");
12365 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12368( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12366 "TestJSImplInterface", "passNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12368( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12367 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12368( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12368 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12368( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
12369
12370 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12371 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecord", 1)) {
12372 return false;
12373 }
12374 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12375 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12376 if (objIsXray) {
12377 unwrappedObj.emplace(cx, obj);
12378 }
12379 Nullable<Record<nsString, int32_t>> arg0;
12380 if (args[0].isObject()) {
12381 auto& recordEntries = arg0.SetValue().Entries();
12382
12383 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12384 JS::RootedVector<jsid> ids(cx);
12385 if (!js::GetPropertyKeys(cx, recordObj,
12386 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12387 return false;
12388 }
12389 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12390 JS_ReportOutOfMemory(cx);
12391 return false;
12392 }
12393 JS::Rooted<JS::Value> propNameValue(cx);
12394 JS::Rooted<JS::Value> temp(cx);
12395 JS::Rooted<jsid> curId(cx);
12396 JS::Rooted<JS::Value> idVal(cx);
12397 // Use a hashset to keep track of ids seen, to avoid
12398 // introducing nasty O(N^2) behavior scanning for them all the
12399 // time. Ideally we'd use a data structure with O(1) lookup
12400 // _and_ ordering for the MozMap, but we don't have one lying
12401 // around.
12402 nsTHashtable<nsStringHashKey> idsSeen;
12403 for (size_t i = 0; i < ids.length(); ++i) {
12404 curId = ids[i];
12405
12406 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12407 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12408 &desc)) {
12409 return false;
12410 }
12411
12412 if (desc.isNothing() || !desc->enumerable()) {
12413 continue;
12414 }
12415
12416 idVal = js::IdToValue(curId);
12417 nsString propName;
12418 // This will just throw if idVal is a Symbol, like the spec says
12419 // to do.
12420 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12421 return false;
12422 }
12423
12424 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12425 return false;
12426 }
12427
12428 Record<nsString, int32_t>::EntryType* entry;
12429 if (!idsSeen.EnsureInserted(propName)) {
12430 // Find the existing entry.
12431 auto idx = recordEntries.IndexOf(propName);
12432 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", 12433); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12433); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12433 "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", 12433); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12433); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12434 // Now blow it away to make it look like it was just added
12435 // to the array, because it's not obvious that it's
12436 // safe to write to its already-initialized mValue via our
12437 // normal codegen conversions. For example, the value
12438 // could be a union and this would change its type, but
12439 // codegen assumes we won't do that.
12440 entry = recordEntries.ReconstructElementAt(idx);
12441 } else {
12442 // Safe to do an infallible append here, because we did a
12443 // SetCapacity above to the right capacity.
12444 entry = recordEntries.AppendElement();
12445 }
12446 entry->mKey = propName;
12447 int32_t& slot = entry->mValue;
12448 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
12449 return false;
12450 }
12451 }
12452 } else if (args[0].isNullOrUndefined()) {
12453 arg0.SetNull();
12454 } else {
12455 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12456 return false;
12457 }
12458 if (objIsXray) {
12459 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12460 // we know Xrays have no dynamic unwrap behavior.
12461 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12462 if (!unwrappedObj.ref()) {
12463 return false;
12464 }
12465 }
12466 FastErrorResult rv;
12467 // NOTE: This assert does NOT call the function.
12468 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");
12469 MOZ_KnownLive(self)(self)->PassNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecord"
)), 0))
) {
12471 return false;
12472 }
12473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12473); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12474 args.rval().setUndefined();
12475 return true;
12476}
12477
12478static const JSJitInfo passNullableRecord_methodinfo = {
12479 { (JSJitGetterOp)passNullableRecord },
12480 { prototypes::id::TestJSImplInterface },
12481 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12482 JSJitInfo::Method,
12483 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12484 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12485 false, /* isInfallible. False in setters. */
12486 false, /* isMovable. Not relevant for setters. */
12487 false, /* isEliminatable. Not relevant for setters. */
12488 false, /* isAlwaysInSlot. Only relevant for getters. */
12489 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12490 false, /* isTypedMethod. Only relevant for methods. */
12491 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12492};
12493
12494MOZ_CAN_RUN_SCRIPT static bool
12495passRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12496{
12497 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableInts");
12498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12501( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12499 "TestJSImplInterface", "passRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12501( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12501( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12501( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12502
12503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12504 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableInts", 1)) {
12505 return false;
12506 }
12507 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12508 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12509 if (objIsXray) {
12510 unwrappedObj.emplace(cx, obj);
12511 }
12512 Record<nsString, Nullable<int32_t>> arg0;
12513 if (args[0].isObject()) {
12514 auto& recordEntries = arg0.Entries();
12515
12516 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12517 JS::RootedVector<jsid> ids(cx);
12518 if (!js::GetPropertyKeys(cx, recordObj,
12519 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12520 return false;
12521 }
12522 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12523 JS_ReportOutOfMemory(cx);
12524 return false;
12525 }
12526 JS::Rooted<JS::Value> propNameValue(cx);
12527 JS::Rooted<JS::Value> temp(cx);
12528 JS::Rooted<jsid> curId(cx);
12529 JS::Rooted<JS::Value> idVal(cx);
12530 // Use a hashset to keep track of ids seen, to avoid
12531 // introducing nasty O(N^2) behavior scanning for them all the
12532 // time. Ideally we'd use a data structure with O(1) lookup
12533 // _and_ ordering for the MozMap, but we don't have one lying
12534 // around.
12535 nsTHashtable<nsStringHashKey> idsSeen;
12536 for (size_t i = 0; i < ids.length(); ++i) {
12537 curId = ids[i];
12538
12539 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12540 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12541 &desc)) {
12542 return false;
12543 }
12544
12545 if (desc.isNothing() || !desc->enumerable()) {
12546 continue;
12547 }
12548
12549 idVal = js::IdToValue(curId);
12550 nsString propName;
12551 // This will just throw if idVal is a Symbol, like the spec says
12552 // to do.
12553 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12554 return false;
12555 }
12556
12557 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12558 return false;
12559 }
12560
12561 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12562 if (!idsSeen.EnsureInserted(propName)) {
12563 // Find the existing entry.
12564 auto idx = recordEntries.IndexOf(propName);
12565 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", 12566); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12566); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12566 "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", 12566); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12566); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12567 // Now blow it away to make it look like it was just added
12568 // to the array, because it's not obvious that it's
12569 // safe to write to its already-initialized mValue via our
12570 // normal codegen conversions. For example, the value
12571 // could be a union and this would change its type, but
12572 // codegen assumes we won't do that.
12573 entry = recordEntries.ReconstructElementAt(idx);
12574 } else {
12575 // Safe to do an infallible append here, because we did a
12576 // SetCapacity above to the right capacity.
12577 entry = recordEntries.AppendElement();
12578 }
12579 entry->mKey = propName;
12580 Nullable<int32_t>& slot = entry->mValue;
12581 if (temp.isNullOrUndefined()) {
12582 slot.SetNull();
12583 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12584 return false;
12585 }
12586 }
12587 } else {
12588 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12589 return false;
12590 }
12591 if (objIsXray) {
12592 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12593 // we know Xrays have no dynamic unwrap behavior.
12594 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12595 if (!unwrappedObj.ref()) {
12596 return false;
12597 }
12598 }
12599 FastErrorResult rv;
12600 // NOTE: This assert does NOT call the function.
12601 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");
12602 MOZ_KnownLive(self)(self)->PassRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12603 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableInts"
)), 0))
) {
12604 return false;
12605 }
12606 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12606); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12606); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12607 args.rval().setUndefined();
12608 return true;
12609}
12610
12611static const JSJitInfo passRecordOfNullableInts_methodinfo = {
12612 { (JSJitGetterOp)passRecordOfNullableInts },
12613 { prototypes::id::TestJSImplInterface },
12614 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12615 JSJitInfo::Method,
12616 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12617 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12618 false, /* isInfallible. False in setters. */
12619 false, /* isMovable. Not relevant for setters. */
12620 false, /* isEliminatable. Not relevant for setters. */
12621 false, /* isAlwaysInSlot. Only relevant for getters. */
12622 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12623 false, /* isTypedMethod. Only relevant for methods. */
12624 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12625};
12626
12627MOZ_CAN_RUN_SCRIPT static bool
12628passOptionalRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12629{
12630 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfNullableInts");
12631 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12634( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12632 "TestJSImplInterface", "passOptionalRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12634( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12633 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12634( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12634 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12634( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12635
12636 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12637 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12638 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12639 if (objIsXray) {
12640 unwrappedObj.emplace(cx, obj);
12641 }
12642 Optional<Record<nsString, Nullable<int32_t>>> arg0;
12643 if (args.hasDefined(0)) {
12644 arg0.Construct();
12645 if (args[0].isObject()) {
12646 auto& recordEntries = arg0.Value().Entries();
12647
12648 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12649 JS::RootedVector<jsid> ids(cx);
12650 if (!js::GetPropertyKeys(cx, recordObj,
12651 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12652 return false;
12653 }
12654 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12655 JS_ReportOutOfMemory(cx);
12656 return false;
12657 }
12658 JS::Rooted<JS::Value> propNameValue(cx);
12659 JS::Rooted<JS::Value> temp(cx);
12660 JS::Rooted<jsid> curId(cx);
12661 JS::Rooted<JS::Value> idVal(cx);
12662 // Use a hashset to keep track of ids seen, to avoid
12663 // introducing nasty O(N^2) behavior scanning for them all the
12664 // time. Ideally we'd use a data structure with O(1) lookup
12665 // _and_ ordering for the MozMap, but we don't have one lying
12666 // around.
12667 nsTHashtable<nsStringHashKey> idsSeen;
12668 for (size_t i = 0; i < ids.length(); ++i) {
12669 curId = ids[i];
12670
12671 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12672 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12673 &desc)) {
12674 return false;
12675 }
12676
12677 if (desc.isNothing() || !desc->enumerable()) {
12678 continue;
12679 }
12680
12681 idVal = js::IdToValue(curId);
12682 nsString propName;
12683 // This will just throw if idVal is a Symbol, like the spec says
12684 // to do.
12685 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12686 return false;
12687 }
12688
12689 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12690 return false;
12691 }
12692
12693 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12694 if (!idsSeen.EnsureInserted(propName)) {
12695 // Find the existing entry.
12696 auto idx = recordEntries.IndexOf(propName);
12697 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", 12698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12698); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12698 "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", 12698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12698); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12699 // Now blow it away to make it look like it was just added
12700 // to the array, because it's not obvious that it's
12701 // safe to write to its already-initialized mValue via our
12702 // normal codegen conversions. For example, the value
12703 // could be a union and this would change its type, but
12704 // codegen assumes we won't do that.
12705 entry = recordEntries.ReconstructElementAt(idx);
12706 } else {
12707 // Safe to do an infallible append here, because we did a
12708 // SetCapacity above to the right capacity.
12709 entry = recordEntries.AppendElement();
12710 }
12711 entry->mKey = propName;
12712 Nullable<int32_t>& slot = entry->mValue;
12713 if (temp.isNullOrUndefined()) {
12714 slot.SetNull();
12715 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12716 return false;
12717 }
12718 }
12719 } else {
12720 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12721 return false;
12722 }
12723 }
12724 if (objIsXray) {
12725 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12726 // we know Xrays have no dynamic unwrap behavior.
12727 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12728 if (!unwrappedObj.ref()) {
12729 return false;
12730 }
12731 }
12732 FastErrorResult rv;
12733 // NOTE: This assert does NOT call the function.
12734 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");
12735 MOZ_KnownLive(self)(self)->PassOptionalRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12736 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfNullableInts"
)), 0))
) {
12737 return false;
12738 }
12739 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12739); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12739); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12740 args.rval().setUndefined();
12741 return true;
12742}
12743
12744static const JSJitInfo passOptionalRecordOfNullableInts_methodinfo = {
12745 { (JSJitGetterOp)passOptionalRecordOfNullableInts },
12746 { prototypes::id::TestJSImplInterface },
12747 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12748 JSJitInfo::Method,
12749 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12750 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12751 false, /* isInfallible. False in setters. */
12752 false, /* isMovable. Not relevant for setters. */
12753 false, /* isEliminatable. Not relevant for setters. */
12754 false, /* isAlwaysInSlot. Only relevant for getters. */
12755 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12756 false, /* isTypedMethod. Only relevant for methods. */
12757 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12758};
12759
12760MOZ_CAN_RUN_SCRIPT static bool
12761passOptionalNullableRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12762{
12763 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts");
12764 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12767( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12765 "TestJSImplInterface", "passOptionalNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12767( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12766 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12767( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12767 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12767( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12768
12769 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12770 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12771 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12772 if (objIsXray) {
12773 unwrappedObj.emplace(cx, obj);
12774 }
12775 Optional<Nullable<Record<nsString, Nullable<int32_t>>>> arg0;
12776 if (args.hasDefined(0)) {
12777 arg0.Construct();
12778 if (args[0].isObject()) {
12779 auto& recordEntries = arg0.Value().SetValue().Entries();
12780
12781 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12782 JS::RootedVector<jsid> ids(cx);
12783 if (!js::GetPropertyKeys(cx, recordObj,
12784 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12785 return false;
12786 }
12787 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12788 JS_ReportOutOfMemory(cx);
12789 return false;
12790 }
12791 JS::Rooted<JS::Value> propNameValue(cx);
12792 JS::Rooted<JS::Value> temp(cx);
12793 JS::Rooted<jsid> curId(cx);
12794 JS::Rooted<JS::Value> idVal(cx);
12795 // Use a hashset to keep track of ids seen, to avoid
12796 // introducing nasty O(N^2) behavior scanning for them all the
12797 // time. Ideally we'd use a data structure with O(1) lookup
12798 // _and_ ordering for the MozMap, but we don't have one lying
12799 // around.
12800 nsTHashtable<nsStringHashKey> idsSeen;
12801 for (size_t i = 0; i < ids.length(); ++i) {
12802 curId = ids[i];
12803
12804 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12805 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12806 &desc)) {
12807 return false;
12808 }
12809
12810 if (desc.isNothing() || !desc->enumerable()) {
12811 continue;
12812 }
12813
12814 idVal = js::IdToValue(curId);
12815 nsString propName;
12816 // This will just throw if idVal is a Symbol, like the spec says
12817 // to do.
12818 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12819 return false;
12820 }
12821
12822 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12823 return false;
12824 }
12825
12826 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12827 if (!idsSeen.EnsureInserted(propName)) {
12828 // Find the existing entry.
12829 auto idx = recordEntries.IndexOf(propName);
12830 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", 12831); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12831); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12831 "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", 12831); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12831); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12832 // Now blow it away to make it look like it was just added
12833 // to the array, because it's not obvious that it's
12834 // safe to write to its already-initialized mValue via our
12835 // normal codegen conversions. For example, the value
12836 // could be a union and this would change its type, but
12837 // codegen assumes we won't do that.
12838 entry = recordEntries.ReconstructElementAt(idx);
12839 } else {
12840 // Safe to do an infallible append here, because we did a
12841 // SetCapacity above to the right capacity.
12842 entry = recordEntries.AppendElement();
12843 }
12844 entry->mKey = propName;
12845 Nullable<int32_t>& slot = entry->mValue;
12846 if (temp.isNullOrUndefined()) {
12847 slot.SetNull();
12848 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12849 return false;
12850 }
12851 }
12852 } else if (args[0].isNullOrUndefined()) {
12853 arg0.Value().SetNull();
12854 } else {
12855 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12856 return false;
12857 }
12858 }
12859 if (objIsXray) {
12860 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12861 // we know Xrays have no dynamic unwrap behavior.
12862 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12863 if (!unwrappedObj.ref()) {
12864 return false;
12865 }
12866 }
12867 FastErrorResult rv;
12868 // NOTE: This assert does NOT call the function.
12869 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");
12870 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12871 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts"
)), 0))
) {
12872 return false;
12873 }
12874 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 12874); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
12875 args.rval().setUndefined();
12876 return true;
12877}
12878
12879static const JSJitInfo passOptionalNullableRecordOfNullableInts_methodinfo = {
12880 { (JSJitGetterOp)passOptionalNullableRecordOfNullableInts },
12881 { prototypes::id::TestJSImplInterface },
12882 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12883 JSJitInfo::Method,
12884 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12885 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12886 false, /* isInfallible. False in setters. */
12887 false, /* isMovable. Not relevant for setters. */
12888 false, /* isEliminatable. Not relevant for setters. */
12889 false, /* isAlwaysInSlot. Only relevant for getters. */
12890 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12891 false, /* isTypedMethod. Only relevant for methods. */
12892 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12893};
12894
12895MOZ_CAN_RUN_SCRIPT static bool
12896passCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12897{
12898 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectRecord");
12899 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12902( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12900 "TestJSImplInterface", "passCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12902( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12901 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12902( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12902 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12902( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12903
12904 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12905 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectRecord", 1)) {
12906 return false;
12907 }
12908 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12909 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12910 if (objIsXray) {
12911 unwrappedObj.emplace(cx, obj);
12912 }
12913 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>> arg0;
12914 if (args[0].isObject()) {
12915 auto& recordEntries = arg0.Entries();
12916
12917 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12918 JS::RootedVector<jsid> ids(cx);
12919 if (!js::GetPropertyKeys(cx, recordObj,
12920 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12921 return false;
12922 }
12923 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12924 JS_ReportOutOfMemory(cx);
12925 return false;
12926 }
12927 JS::Rooted<JS::Value> propNameValue(cx);
12928 JS::Rooted<JS::Value> temp(cx);
12929 JS::Rooted<jsid> curId(cx);
12930 JS::Rooted<JS::Value> idVal(cx);
12931 // Use a hashset to keep track of ids seen, to avoid
12932 // introducing nasty O(N^2) behavior scanning for them all the
12933 // time. Ideally we'd use a data structure with O(1) lookup
12934 // _and_ ordering for the MozMap, but we don't have one lying
12935 // around.
12936 nsTHashtable<nsStringHashKey> idsSeen;
12937 for (size_t i = 0; i < ids.length(); ++i) {
12938 curId = ids[i];
12939
12940 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12941 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12942 &desc)) {
12943 return false;
12944 }
12945
12946 if (desc.isNothing() || !desc->enumerable()) {
12947 continue;
12948 }
12949
12950 idVal = js::IdToValue(curId);
12951 nsString propName;
12952 // This will just throw if idVal is a Symbol, like the spec says
12953 // to do.
12954 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12955 return false;
12956 }
12957
12958 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12959 return false;
12960 }
12961
12962 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
12963 if (!idsSeen.EnsureInserted(propName)) {
12964 // Find the existing entry.
12965 auto idx = recordEntries.IndexOf(propName);
12966 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", 12967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12967); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12967 "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", 12967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 12967); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12968 // Now blow it away to make it look like it was just added
12969 // to the array, because it's not obvious that it's
12970 // safe to write to its already-initialized mValue via our
12971 // normal codegen conversions. For example, the value
12972 // could be a union and this would change its type, but
12973 // codegen assumes we won't do that.
12974 entry = recordEntries.ReconstructElementAt(idx);
12975 } else {
12976 // Safe to do an infallible append here, because we did a
12977 // SetCapacity above to the right capacity.
12978 entry = recordEntries.AppendElement();
12979 }
12980 entry->mKey = propName;
12981 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
12982 if (temp.isObject()) {
12983 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
12984 {
12985 // Our JSContext should be in the right global to do unwrapping in.
12986 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
12987 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
12988 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
12989 return false;
12990 }
12991 }
12992 } else {
12993 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
12994 return false;
12995 }
12996 }
12997 } else {
12998 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12999 return false;
13000 }
13001 if (objIsXray) {
13002 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13003 // we know Xrays have no dynamic unwrap behavior.
13004 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13005 if (!unwrappedObj.ref()) {
13006 return false;
13007 }
13008 }
13009 FastErrorResult rv;
13010 // NOTE: This assert does NOT call the function.
13011 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");
13012 MOZ_KnownLive(self)(self)->PassCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13013 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectRecord"
)), 0))
) {
13014 return false;
13015 }
13016 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13016); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13016); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13017 args.rval().setUndefined();
13018 return true;
13019}
13020
13021static const JSJitInfo passCastableObjectRecord_methodinfo = {
13022 { (JSJitGetterOp)passCastableObjectRecord },
13023 { prototypes::id::TestJSImplInterface },
13024 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13025 JSJitInfo::Method,
13026 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13027 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13028 false, /* isInfallible. False in setters. */
13029 false, /* isMovable. Not relevant for setters. */
13030 false, /* isEliminatable. Not relevant for setters. */
13031 false, /* isAlwaysInSlot. Only relevant for getters. */
13032 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13033 false, /* isTypedMethod. Only relevant for methods. */
13034 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13035};
13036
13037MOZ_CAN_RUN_SCRIPT static bool
13038passNullableCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13039{
13040 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectRecord");
13041 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13044( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13042 "TestJSImplInterface", "passNullableCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13044( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13043 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13044( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13044 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13044( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13045
13046 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13047 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectRecord", 1)) {
13048 return false;
13049 }
13050 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13051 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13052 if (objIsXray) {
13053 unwrappedObj.emplace(cx, obj);
13054 }
13055 Record<nsString, RefPtr<mozilla::dom::TestInterface>> arg0;
13056 if (args[0].isObject()) {
13057 auto& recordEntries = arg0.Entries();
13058
13059 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13060 JS::RootedVector<jsid> ids(cx);
13061 if (!js::GetPropertyKeys(cx, recordObj,
13062 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13063 return false;
13064 }
13065 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13066 JS_ReportOutOfMemory(cx);
13067 return false;
13068 }
13069 JS::Rooted<JS::Value> propNameValue(cx);
13070 JS::Rooted<JS::Value> temp(cx);
13071 JS::Rooted<jsid> curId(cx);
13072 JS::Rooted<JS::Value> idVal(cx);
13073 // Use a hashset to keep track of ids seen, to avoid
13074 // introducing nasty O(N^2) behavior scanning for them all the
13075 // time. Ideally we'd use a data structure with O(1) lookup
13076 // _and_ ordering for the MozMap, but we don't have one lying
13077 // around.
13078 nsTHashtable<nsStringHashKey> idsSeen;
13079 for (size_t i = 0; i < ids.length(); ++i) {
13080 curId = ids[i];
13081
13082 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13083 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13084 &desc)) {
13085 return false;
13086 }
13087
13088 if (desc.isNothing() || !desc->enumerable()) {
13089 continue;
13090 }
13091
13092 idVal = js::IdToValue(curId);
13093 nsString propName;
13094 // This will just throw if idVal is a Symbol, like the spec says
13095 // to do.
13096 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13097 return false;
13098 }
13099
13100 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13101 return false;
13102 }
13103
13104 Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry;
13105 if (!idsSeen.EnsureInserted(propName)) {
13106 // Find the existing entry.
13107 auto idx = recordEntries.IndexOf(propName);
13108 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", 13109); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13109); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13109 "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", 13109); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13109); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13110 // Now blow it away to make it look like it was just added
13111 // to the array, because it's not obvious that it's
13112 // safe to write to its already-initialized mValue via our
13113 // normal codegen conversions. For example, the value
13114 // could be a union and this would change its type, but
13115 // codegen assumes we won't do that.
13116 entry = recordEntries.ReconstructElementAt(idx);
13117 } else {
13118 // Safe to do an infallible append here, because we did a
13119 // SetCapacity above to the right capacity.
13120 entry = recordEntries.AppendElement();
13121 }
13122 entry->mKey = propName;
13123 RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue;
13124 if (temp.isObject()) {
13125 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13126 {
13127 // Our JSContext should be in the right global to do unwrapping in.
13128 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13129 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13130 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13131 return false;
13132 }
13133 }
13134 } else if (temp.isNullOrUndefined()) {
13135 slot = nullptr;
13136 } else {
13137 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13138 return false;
13139 }
13140 }
13141 } else {
13142 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13143 return false;
13144 }
13145 if (objIsXray) {
13146 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13147 // we know Xrays have no dynamic unwrap behavior.
13148 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13149 if (!unwrappedObj.ref()) {
13150 return false;
13151 }
13152 }
13153 FastErrorResult rv;
13154 // NOTE: This assert does NOT call the function.
13155 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");
13156 MOZ_KnownLive(self)(self)->PassNullableCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13157 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectRecord"
)), 0))
) {
13158 return false;
13159 }
13160 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13160); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13161 args.rval().setUndefined();
13162 return true;
13163}
13164
13165static const JSJitInfo passNullableCastableObjectRecord_methodinfo = {
13166 { (JSJitGetterOp)passNullableCastableObjectRecord },
13167 { prototypes::id::TestJSImplInterface },
13168 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13169 JSJitInfo::Method,
13170 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13171 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13172 false, /* isInfallible. False in setters. */
13173 false, /* isMovable. Not relevant for setters. */
13174 false, /* isEliminatable. Not relevant for setters. */
13175 false, /* isAlwaysInSlot. Only relevant for getters. */
13176 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13177 false, /* isTypedMethod. Only relevant for methods. */
13178 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13179};
13180
13181MOZ_CAN_RUN_SCRIPT static bool
13182passCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13183{
13184 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectNullableRecord");
13185 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13188( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13186 "TestJSImplInterface", "passCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13188( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13187 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13188( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13188 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13188( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13189
13190 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13191 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectNullableRecord", 1)) {
13192 return false;
13193 }
13194 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13195 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13196 if (objIsXray) {
13197 unwrappedObj.emplace(cx, obj);
13198 }
13199 Nullable<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0;
13200 if (args[0].isObject()) {
13201 auto& recordEntries = arg0.SetValue().Entries();
13202
13203 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13204 JS::RootedVector<jsid> ids(cx);
13205 if (!js::GetPropertyKeys(cx, recordObj,
13206 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13207 return false;
13208 }
13209 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13210 JS_ReportOutOfMemory(cx);
13211 return false;
13212 }
13213 JS::Rooted<JS::Value> propNameValue(cx);
13214 JS::Rooted<JS::Value> temp(cx);
13215 JS::Rooted<jsid> curId(cx);
13216 JS::Rooted<JS::Value> idVal(cx);
13217 // Use a hashset to keep track of ids seen, to avoid
13218 // introducing nasty O(N^2) behavior scanning for them all the
13219 // time. Ideally we'd use a data structure with O(1) lookup
13220 // _and_ ordering for the MozMap, but we don't have one lying
13221 // around.
13222 nsTHashtable<nsStringHashKey> idsSeen;
13223 for (size_t i = 0; i < ids.length(); ++i) {
13224 curId = ids[i];
13225
13226 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13227 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13228 &desc)) {
13229 return false;
13230 }
13231
13232 if (desc.isNothing() || !desc->enumerable()) {
13233 continue;
13234 }
13235
13236 idVal = js::IdToValue(curId);
13237 nsString propName;
13238 // This will just throw if idVal is a Symbol, like the spec says
13239 // to do.
13240 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13241 return false;
13242 }
13243
13244 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13245 return false;
13246 }
13247
13248 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
13249 if (!idsSeen.EnsureInserted(propName)) {
13250 // Find the existing entry.
13251 auto idx = recordEntries.IndexOf(propName);
13252 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", 13253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13253); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13253 "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", 13253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13253); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13254 // Now blow it away to make it look like it was just added
13255 // to the array, because it's not obvious that it's
13256 // safe to write to its already-initialized mValue via our
13257 // normal codegen conversions. For example, the value
13258 // could be a union and this would change its type, but
13259 // codegen assumes we won't do that.
13260 entry = recordEntries.ReconstructElementAt(idx);
13261 } else {
13262 // Safe to do an infallible append here, because we did a
13263 // SetCapacity above to the right capacity.
13264 entry = recordEntries.AppendElement();
13265 }
13266 entry->mKey = propName;
13267 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
13268 if (temp.isObject()) {
13269 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13270 {
13271 // Our JSContext should be in the right global to do unwrapping in.
13272 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13273 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13274 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13275 return false;
13276 }
13277 }
13278 } else {
13279 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13280 return false;
13281 }
13282 }
13283 } else if (args[0].isNullOrUndefined()) {
13284 arg0.SetNull();
13285 } else {
13286 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13287 return false;
13288 }
13289 if (objIsXray) {
13290 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13291 // we know Xrays have no dynamic unwrap behavior.
13292 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13293 if (!unwrappedObj.ref()) {
13294 return false;
13295 }
13296 }
13297 FastErrorResult rv;
13298 // NOTE: This assert does NOT call the function.
13299 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");
13300 MOZ_KnownLive(self)(self)->PassCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13301 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableRecord"
)), 0))
) {
13302 return false;
13303 }
13304 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13304); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13304); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13305 args.rval().setUndefined();
13306 return true;
13307}
13308
13309static const JSJitInfo passCastableObjectNullableRecord_methodinfo = {
13310 { (JSJitGetterOp)passCastableObjectNullableRecord },
13311 { prototypes::id::TestJSImplInterface },
13312 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13313 JSJitInfo::Method,
13314 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13315 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13316 false, /* isInfallible. False in setters. */
13317 false, /* isMovable. Not relevant for setters. */
13318 false, /* isEliminatable. Not relevant for setters. */
13319 false, /* isAlwaysInSlot. Only relevant for getters. */
13320 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13321 false, /* isTypedMethod. Only relevant for methods. */
13322 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13323};
13324
13325MOZ_CAN_RUN_SCRIPT static bool
13326passNullableCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13327{
13328 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectNullableRecord");
13329 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13330 "TestJSImplInterface", "passNullableCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13331 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13332 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13332( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13333
13334 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13335 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord", 1)) {
13336 return false;
13337 }
13338 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13339 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13340 if (objIsXray) {
13341 unwrappedObj.emplace(cx, obj);
13342 }
13343 Nullable<Record<nsString, RefPtr<mozilla::dom::TestInterface>>> arg0;
13344 if (args[0].isObject()) {
13345 auto& recordEntries = arg0.SetValue().Entries();
13346
13347 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13348 JS::RootedVector<jsid> ids(cx);
13349 if (!js::GetPropertyKeys(cx, recordObj,
13350 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13351 return false;
13352 }
13353 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13354 JS_ReportOutOfMemory(cx);
13355 return false;
13356 }
13357 JS::Rooted<JS::Value> propNameValue(cx);
13358 JS::Rooted<JS::Value> temp(cx);
13359 JS::Rooted<jsid> curId(cx);
13360 JS::Rooted<JS::Value> idVal(cx);
13361 // Use a hashset to keep track of ids seen, to avoid
13362 // introducing nasty O(N^2) behavior scanning for them all the
13363 // time. Ideally we'd use a data structure with O(1) lookup
13364 // _and_ ordering for the MozMap, but we don't have one lying
13365 // around.
13366 nsTHashtable<nsStringHashKey> idsSeen;
13367 for (size_t i = 0; i < ids.length(); ++i) {
13368 curId = ids[i];
13369
13370 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13371 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13372 &desc)) {
13373 return false;
13374 }
13375
13376 if (desc.isNothing() || !desc->enumerable()) {
13377 continue;
13378 }
13379
13380 idVal = js::IdToValue(curId);
13381 nsString propName;
13382 // This will just throw if idVal is a Symbol, like the spec says
13383 // to do.
13384 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13385 return false;
13386 }
13387
13388 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13389 return false;
13390 }
13391
13392 Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry;
13393 if (!idsSeen.EnsureInserted(propName)) {
13394 // Find the existing entry.
13395 auto idx = recordEntries.IndexOf(propName);
13396 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", 13397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13397); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13397 "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", 13397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13397); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13398 // Now blow it away to make it look like it was just added
13399 // to the array, because it's not obvious that it's
13400 // safe to write to its already-initialized mValue via our
13401 // normal codegen conversions. For example, the value
13402 // could be a union and this would change its type, but
13403 // codegen assumes we won't do that.
13404 entry = recordEntries.ReconstructElementAt(idx);
13405 } else {
13406 // Safe to do an infallible append here, because we did a
13407 // SetCapacity above to the right capacity.
13408 entry = recordEntries.AppendElement();
13409 }
13410 entry->mKey = propName;
13411 RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue;
13412 if (temp.isObject()) {
13413 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13414 {
13415 // Our JSContext should be in the right global to do unwrapping in.
13416 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13417 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13418 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13419 return false;
13420 }
13421 }
13422 } else if (temp.isNullOrUndefined()) {
13423 slot = nullptr;
13424 } else {
13425 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13426 return false;
13427 }
13428 }
13429 } else if (args[0].isNullOrUndefined()) {
13430 arg0.SetNull();
13431 } else {
13432 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13433 return false;
13434 }
13435 if (objIsXray) {
13436 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13437 // we know Xrays have no dynamic unwrap behavior.
13438 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13439 if (!unwrappedObj.ref()) {
13440 return false;
13441 }
13442 }
13443 FastErrorResult rv;
13444 // NOTE: This assert does NOT call the function.
13445 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");
13446 MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13447 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord"
)), 0))
) {
13448 return false;
13449 }
13450 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13450); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13451 args.rval().setUndefined();
13452 return true;
13453}
13454
13455static const JSJitInfo passNullableCastableObjectNullableRecord_methodinfo = {
13456 { (JSJitGetterOp)passNullableCastableObjectNullableRecord },
13457 { prototypes::id::TestJSImplInterface },
13458 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13459 JSJitInfo::Method,
13460 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13461 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13462 false, /* isInfallible. False in setters. */
13463 false, /* isMovable. Not relevant for setters. */
13464 false, /* isEliminatable. Not relevant for setters. */
13465 false, /* isAlwaysInSlot. Only relevant for getters. */
13466 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13467 false, /* isTypedMethod. Only relevant for methods. */
13468 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13469};
13470
13471MOZ_CAN_RUN_SCRIPT static bool
13472passOptionalRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13473{
13474 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecord");
13475 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13478( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13476 "TestJSImplInterface", "passOptionalRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13478( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13477 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13478( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13478 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13478( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
13479
13480 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13481 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13482 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13483 if (objIsXray) {
13484 unwrappedObj.emplace(cx, obj);
13485 }
13486 Optional<Record<nsString, int32_t>> arg0;
13487 if (args.hasDefined(0)) {
13488 arg0.Construct();
13489 if (args[0].isObject()) {
13490 auto& recordEntries = arg0.Value().Entries();
13491
13492 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13493 JS::RootedVector<jsid> ids(cx);
13494 if (!js::GetPropertyKeys(cx, recordObj,
13495 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13496 return false;
13497 }
13498 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13499 JS_ReportOutOfMemory(cx);
13500 return false;
13501 }
13502 JS::Rooted<JS::Value> propNameValue(cx);
13503 JS::Rooted<JS::Value> temp(cx);
13504 JS::Rooted<jsid> curId(cx);
13505 JS::Rooted<JS::Value> idVal(cx);
13506 // Use a hashset to keep track of ids seen, to avoid
13507 // introducing nasty O(N^2) behavior scanning for them all the
13508 // time. Ideally we'd use a data structure with O(1) lookup
13509 // _and_ ordering for the MozMap, but we don't have one lying
13510 // around.
13511 nsTHashtable<nsStringHashKey> idsSeen;
13512 for (size_t i = 0; i < ids.length(); ++i) {
13513 curId = ids[i];
13514
13515 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13516 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13517 &desc)) {
13518 return false;
13519 }
13520
13521 if (desc.isNothing() || !desc->enumerable()) {
13522 continue;
13523 }
13524
13525 idVal = js::IdToValue(curId);
13526 nsString propName;
13527 // This will just throw if idVal is a Symbol, like the spec says
13528 // to do.
13529 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13530 return false;
13531 }
13532
13533 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13534 return false;
13535 }
13536
13537 Record<nsString, int32_t>::EntryType* entry;
13538 if (!idsSeen.EnsureInserted(propName)) {
13539 // Find the existing entry.
13540 auto idx = recordEntries.IndexOf(propName);
13541 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", 13542); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13542); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13542 "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", 13542); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13542); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13543 // Now blow it away to make it look like it was just added
13544 // to the array, because it's not obvious that it's
13545 // safe to write to its already-initialized mValue via our
13546 // normal codegen conversions. For example, the value
13547 // could be a union and this would change its type, but
13548 // codegen assumes we won't do that.
13549 entry = recordEntries.ReconstructElementAt(idx);
13550 } else {
13551 // Safe to do an infallible append here, because we did a
13552 // SetCapacity above to the right capacity.
13553 entry = recordEntries.AppendElement();
13554 }
13555 entry->mKey = propName;
13556 int32_t& slot = entry->mValue;
13557 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13558 return false;
13559 }
13560 }
13561 } else {
13562 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13563 return false;
13564 }
13565 }
13566 if (objIsXray) {
13567 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13568 // we know Xrays have no dynamic unwrap behavior.
13569 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13570 if (!unwrappedObj.ref()) {
13571 return false;
13572 }
13573 }
13574 FastErrorResult rv;
13575 // NOTE: This assert does NOT call the function.
13576 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");
13577 MOZ_KnownLive(self)(self)->PassOptionalRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13578 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecord"
)), 0))
) {
13579 return false;
13580 }
13581 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13581); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13581); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13582 args.rval().setUndefined();
13583 return true;
13584}
13585
13586static const JSJitInfo passOptionalRecord_methodinfo = {
13587 { (JSJitGetterOp)passOptionalRecord },
13588 { prototypes::id::TestJSImplInterface },
13589 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13590 JSJitInfo::Method,
13591 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13592 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13593 false, /* isInfallible. False in setters. */
13594 false, /* isMovable. Not relevant for setters. */
13595 false, /* isEliminatable. Not relevant for setters. */
13596 false, /* isAlwaysInSlot. Only relevant for getters. */
13597 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13598 false, /* isTypedMethod. Only relevant for methods. */
13599 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13600};
13601
13602MOZ_CAN_RUN_SCRIPT static bool
13603passOptionalNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13604{
13605 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecord");
13606 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13609( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13607 "TestJSImplInterface", "passOptionalNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13609( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13608 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13609( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13609 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13609( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13610
13611 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13612 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13613 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13614 if (objIsXray) {
13615 unwrappedObj.emplace(cx, obj);
13616 }
13617 Optional<Nullable<Record<nsString, int32_t>>> arg0;
13618 if (args.hasDefined(0)) {
13619 arg0.Construct();
13620 if (args[0].isObject()) {
13621 auto& recordEntries = arg0.Value().SetValue().Entries();
13622
13623 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13624 JS::RootedVector<jsid> ids(cx);
13625 if (!js::GetPropertyKeys(cx, recordObj,
13626 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13627 return false;
13628 }
13629 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13630 JS_ReportOutOfMemory(cx);
13631 return false;
13632 }
13633 JS::Rooted<JS::Value> propNameValue(cx);
13634 JS::Rooted<JS::Value> temp(cx);
13635 JS::Rooted<jsid> curId(cx);
13636 JS::Rooted<JS::Value> idVal(cx);
13637 // Use a hashset to keep track of ids seen, to avoid
13638 // introducing nasty O(N^2) behavior scanning for them all the
13639 // time. Ideally we'd use a data structure with O(1) lookup
13640 // _and_ ordering for the MozMap, but we don't have one lying
13641 // around.
13642 nsTHashtable<nsStringHashKey> idsSeen;
13643 for (size_t i = 0; i < ids.length(); ++i) {
13644 curId = ids[i];
13645
13646 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13647 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13648 &desc)) {
13649 return false;
13650 }
13651
13652 if (desc.isNothing() || !desc->enumerable()) {
13653 continue;
13654 }
13655
13656 idVal = js::IdToValue(curId);
13657 nsString propName;
13658 // This will just throw if idVal is a Symbol, like the spec says
13659 // to do.
13660 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13661 return false;
13662 }
13663
13664 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13665 return false;
13666 }
13667
13668 Record<nsString, int32_t>::EntryType* entry;
13669 if (!idsSeen.EnsureInserted(propName)) {
13670 // Find the existing entry.
13671 auto idx = recordEntries.IndexOf(propName);
13672 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", 13673); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13673); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13673 "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", 13673); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13673); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13674 // Now blow it away to make it look like it was just added
13675 // to the array, because it's not obvious that it's
13676 // safe to write to its already-initialized mValue via our
13677 // normal codegen conversions. For example, the value
13678 // could be a union and this would change its type, but
13679 // codegen assumes we won't do that.
13680 entry = recordEntries.ReconstructElementAt(idx);
13681 } else {
13682 // Safe to do an infallible append here, because we did a
13683 // SetCapacity above to the right capacity.
13684 entry = recordEntries.AppendElement();
13685 }
13686 entry->mKey = propName;
13687 int32_t& slot = entry->mValue;
13688 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13689 return false;
13690 }
13691 }
13692 } else if (args[0].isNullOrUndefined()) {
13693 arg0.Value().SetNull();
13694 } else {
13695 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13696 return false;
13697 }
13698 }
13699 if (objIsXray) {
13700 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13701 // we know Xrays have no dynamic unwrap behavior.
13702 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13703 if (!unwrappedObj.ref()) {
13704 return false;
13705 }
13706 }
13707 FastErrorResult rv;
13708 // NOTE: This assert does NOT call the function.
13709 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");
13710 MOZ_KnownLive(self)(self)->PassOptionalNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13711 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecord"
)), 0))
) {
13712 return false;
13713 }
13714 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13714); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13714); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13715 args.rval().setUndefined();
13716 return true;
13717}
13718
13719static const JSJitInfo passOptionalNullableRecord_methodinfo = {
13720 { (JSJitGetterOp)passOptionalNullableRecord },
13721 { prototypes::id::TestJSImplInterface },
13722 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13723 JSJitInfo::Method,
13724 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13725 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13726 false, /* isInfallible. False in setters. */
13727 false, /* isMovable. Not relevant for setters. */
13728 false, /* isEliminatable. Not relevant for setters. */
13729 false, /* isAlwaysInSlot. Only relevant for getters. */
13730 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13731 false, /* isTypedMethod. Only relevant for methods. */
13732 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13733};
13734
13735MOZ_CAN_RUN_SCRIPT static bool
13736passOptionalNullableRecordWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13737{
13738 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue");
13739 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13742( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13740 "TestJSImplInterface", "passOptionalNullableRecordWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13742( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13741 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13742( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13742 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13742( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13743
13744 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13745 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13746 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13747 if (objIsXray) {
13748 unwrappedObj.emplace(cx, obj);
13749 }
13750 Nullable<Record<nsString, int32_t>> arg0;
13751 if (args.hasDefined(0)) {
13752 if (args[0].isObject()) {
13753 auto& recordEntries = arg0.SetValue().Entries();
13754
13755 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13756 JS::RootedVector<jsid> ids(cx);
13757 if (!js::GetPropertyKeys(cx, recordObj,
13758 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13759 return false;
13760 }
13761 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13762 JS_ReportOutOfMemory(cx);
13763 return false;
13764 }
13765 JS::Rooted<JS::Value> propNameValue(cx);
13766 JS::Rooted<JS::Value> temp(cx);
13767 JS::Rooted<jsid> curId(cx);
13768 JS::Rooted<JS::Value> idVal(cx);
13769 // Use a hashset to keep track of ids seen, to avoid
13770 // introducing nasty O(N^2) behavior scanning for them all the
13771 // time. Ideally we'd use a data structure with O(1) lookup
13772 // _and_ ordering for the MozMap, but we don't have one lying
13773 // around.
13774 nsTHashtable<nsStringHashKey> idsSeen;
13775 for (size_t i = 0; i < ids.length(); ++i) {
13776 curId = ids[i];
13777
13778 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13779 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13780 &desc)) {
13781 return false;
13782 }
13783
13784 if (desc.isNothing() || !desc->enumerable()) {
13785 continue;
13786 }
13787
13788 idVal = js::IdToValue(curId);
13789 nsString propName;
13790 // This will just throw if idVal is a Symbol, like the spec says
13791 // to do.
13792 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13793 return false;
13794 }
13795
13796 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13797 return false;
13798 }
13799
13800 Record<nsString, int32_t>::EntryType* entry;
13801 if (!idsSeen.EnsureInserted(propName)) {
13802 // Find the existing entry.
13803 auto idx = recordEntries.IndexOf(propName);
13804 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", 13805); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13805); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13805 "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", 13805); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13805); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13806 // Now blow it away to make it look like it was just added
13807 // to the array, because it's not obvious that it's
13808 // safe to write to its already-initialized mValue via our
13809 // normal codegen conversions. For example, the value
13810 // could be a union and this would change its type, but
13811 // codegen assumes we won't do that.
13812 entry = recordEntries.ReconstructElementAt(idx);
13813 } else {
13814 // Safe to do an infallible append here, because we did a
13815 // SetCapacity above to the right capacity.
13816 entry = recordEntries.AppendElement();
13817 }
13818 entry->mKey = propName;
13819 int32_t& slot = entry->mValue;
13820 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13821 return false;
13822 }
13823 }
13824 } else if (args[0].isNullOrUndefined()) {
13825 arg0.SetNull();
13826 } else {
13827 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13828 return false;
13829 }
13830 } else {
13831 arg0.SetNull();
13832 }
13833 if (objIsXray) {
13834 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13835 // we know Xrays have no dynamic unwrap behavior.
13836 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13837 if (!unwrappedObj.ref()) {
13838 return false;
13839 }
13840 }
13841 FastErrorResult rv;
13842 // NOTE: This assert does NOT call the function.
13843 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");
13844 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13845 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue"
)), 0))
) {
13846 return false;
13847 }
13848 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13848); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13848); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13849 args.rval().setUndefined();
13850 return true;
13851}
13852
13853static const JSJitInfo passOptionalNullableRecordWithDefaultValue_methodinfo = {
13854 { (JSJitGetterOp)passOptionalNullableRecordWithDefaultValue },
13855 { prototypes::id::TestJSImplInterface },
13856 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13857 JSJitInfo::Method,
13858 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13859 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13860 false, /* isInfallible. False in setters. */
13861 false, /* isMovable. Not relevant for setters. */
13862 false, /* isEliminatable. Not relevant for setters. */
13863 false, /* isAlwaysInSlot. Only relevant for getters. */
13864 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13865 false, /* isTypedMethod. Only relevant for methods. */
13866 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13867};
13868
13869MOZ_CAN_RUN_SCRIPT static bool
13870passOptionalObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13871{
13872 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObjectRecord");
13873 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13876( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13874 "TestJSImplInterface", "passOptionalObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13876( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13875 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13876( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13876 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13876( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13877
13878 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13879 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13880 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13881 if (objIsXray) {
13882 unwrappedObj.emplace(cx, obj);
13883 }
13884 Optional<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0;
13885 if (args.hasDefined(0)) {
13886 arg0.Construct();
13887 if (args[0].isObject()) {
13888 auto& recordEntries = arg0.Value().Entries();
13889
13890 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13891 JS::RootedVector<jsid> ids(cx);
13892 if (!js::GetPropertyKeys(cx, recordObj,
13893 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13894 return false;
13895 }
13896 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13897 JS_ReportOutOfMemory(cx);
13898 return false;
13899 }
13900 JS::Rooted<JS::Value> propNameValue(cx);
13901 JS::Rooted<JS::Value> temp(cx);
13902 JS::Rooted<jsid> curId(cx);
13903 JS::Rooted<JS::Value> idVal(cx);
13904 // Use a hashset to keep track of ids seen, to avoid
13905 // introducing nasty O(N^2) behavior scanning for them all the
13906 // time. Ideally we'd use a data structure with O(1) lookup
13907 // _and_ ordering for the MozMap, but we don't have one lying
13908 // around.
13909 nsTHashtable<nsStringHashKey> idsSeen;
13910 for (size_t i = 0; i < ids.length(); ++i) {
13911 curId = ids[i];
13912
13913 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13914 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13915 &desc)) {
13916 return false;
13917 }
13918
13919 if (desc.isNothing() || !desc->enumerable()) {
13920 continue;
13921 }
13922
13923 idVal = js::IdToValue(curId);
13924 nsString propName;
13925 // This will just throw if idVal is a Symbol, like the spec says
13926 // to do.
13927 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13928 return false;
13929 }
13930
13931 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13932 return false;
13933 }
13934
13935 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
13936 if (!idsSeen.EnsureInserted(propName)) {
13937 // Find the existing entry.
13938 auto idx = recordEntries.IndexOf(propName);
13939 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", 13940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13940); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13940 "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", 13940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 13940); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13941 // Now blow it away to make it look like it was just added
13942 // to the array, because it's not obvious that it's
13943 // safe to write to its already-initialized mValue via our
13944 // normal codegen conversions. For example, the value
13945 // could be a union and this would change its type, but
13946 // codegen assumes we won't do that.
13947 entry = recordEntries.ReconstructElementAt(idx);
13948 } else {
13949 // Safe to do an infallible append here, because we did a
13950 // SetCapacity above to the right capacity.
13951 entry = recordEntries.AppendElement();
13952 }
13953 entry->mKey = propName;
13954 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
13955 if (temp.isObject()) {
13956 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13957 {
13958 // Our JSContext should be in the right global to do unwrapping in.
13959 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13960 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13961 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13962 return false;
13963 }
13964 }
13965 } else {
13966 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13967 return false;
13968 }
13969 }
13970 } else {
13971 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13972 return false;
13973 }
13974 }
13975 if (objIsXray) {
13976 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13977 // we know Xrays have no dynamic unwrap behavior.
13978 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13979 if (!unwrappedObj.ref()) {
13980 return false;
13981 }
13982 }
13983 FastErrorResult rv;
13984 // NOTE: This assert does NOT call the function.
13985 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");
13986 MOZ_KnownLive(self)(self)->PassOptionalObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13987 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectRecord"
)), 0))
) {
13988 return false;
13989 }
13990 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13990); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 13990); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
13991 args.rval().setUndefined();
13992 return true;
13993}
13994
13995static const JSJitInfo passOptionalObjectRecord_methodinfo = {
13996 { (JSJitGetterOp)passOptionalObjectRecord },
13997 { prototypes::id::TestJSImplInterface },
13998 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13999 JSJitInfo::Method,
14000 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14001 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14002 false, /* isInfallible. False in setters. */
14003 false, /* isMovable. Not relevant for setters. */
14004 false, /* isEliminatable. Not relevant for setters. */
14005 false, /* isAlwaysInSlot. Only relevant for getters. */
14006 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14007 false, /* isTypedMethod. Only relevant for methods. */
14008 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14009};
14010
14011MOZ_CAN_RUN_SCRIPT static bool
14012passExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14013{
14014 BindingCallContext cx(cx_, "TestJSImplInterface.passExternalInterfaceRecord");
14015 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14018( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14016 "TestJSImplInterface", "passExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14018( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14017 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14018( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14018 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14018( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
14019
14020 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14021 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternalInterfaceRecord", 1)) {
14022 return false;
14023 }
14024 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14025 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14026 if (objIsXray) {
14027 unwrappedObj.emplace(cx, obj);
14028 }
14029 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0;
14030 if (args[0].isObject()) {
14031 auto& recordEntries = arg0.Entries();
14032
14033 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14034 JS::RootedVector<jsid> ids(cx);
14035 if (!js::GetPropertyKeys(cx, recordObj,
14036 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14037 return false;
14038 }
14039 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14040 JS_ReportOutOfMemory(cx);
14041 return false;
14042 }
14043 JS::Rooted<JS::Value> propNameValue(cx);
14044 JS::Rooted<JS::Value> temp(cx);
14045 JS::Rooted<jsid> curId(cx);
14046 JS::Rooted<JS::Value> idVal(cx);
14047 // Use a hashset to keep track of ids seen, to avoid
14048 // introducing nasty O(N^2) behavior scanning for them all the
14049 // time. Ideally we'd use a data structure with O(1) lookup
14050 // _and_ ordering for the MozMap, but we don't have one lying
14051 // around.
14052 nsTHashtable<nsStringHashKey> idsSeen;
14053 for (size_t i = 0; i < ids.length(); ++i) {
14054 curId = ids[i];
14055
14056 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14057 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14058 &desc)) {
14059 return false;
14060 }
14061
14062 if (desc.isNothing() || !desc->enumerable()) {
14063 continue;
14064 }
14065
14066 idVal = js::IdToValue(curId);
14067 nsString propName;
14068 // This will just throw if idVal is a Symbol, like the spec says
14069 // to do.
14070 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14071 return false;
14072 }
14073
14074 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14075 return false;
14076 }
14077
14078 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry;
14079 if (!idsSeen.EnsureInserted(propName)) {
14080 // Find the existing entry.
14081 auto idx = recordEntries.IndexOf(propName);
14082 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", 14083); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14083); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14083 "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", 14083); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14083); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14084 // Now blow it away to make it look like it was just added
14085 // to the array, because it's not obvious that it's
14086 // safe to write to its already-initialized mValue via our
14087 // normal codegen conversions. For example, the value
14088 // could be a union and this would change its type, but
14089 // codegen assumes we won't do that.
14090 entry = recordEntries.ReconstructElementAt(idx);
14091 } else {
14092 // Safe to do an infallible append here, because we did a
14093 // SetCapacity above to the right capacity.
14094 entry = recordEntries.AppendElement();
14095 }
14096 entry->mKey = propName;
14097 RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue;
14098 if (temp.isObject()) {
14099 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
14100 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
14101 JS::Rooted<JSObject*> source(cx, &temp.toObject());
14102 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)))
) {
14103 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface");
14104 return false;
14105 }
14106 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"
, 14106); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { MOZ_CrashSequence(__null, 14106); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14107 slot = tempHolder;
14108 } else {
14109 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14110 return false;
14111 }
14112 }
14113 } else {
14114 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14115 return false;
14116 }
14117 if (objIsXray) {
14118 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14119 // we know Xrays have no dynamic unwrap behavior.
14120 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14121 if (!unwrappedObj.ref()) {
14122 return false;
14123 }
14124 }
14125 FastErrorResult rv;
14126 // NOTE: This assert does NOT call the function.
14127 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");
14128 MOZ_KnownLive(self)(self)->PassExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14129 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceRecord"
)), 0))
) {
14130 return false;
14131 }
14132 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14132); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14132); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14133 args.rval().setUndefined();
14134 return true;
14135}
14136
14137static const JSJitInfo passExternalInterfaceRecord_methodinfo = {
14138 { (JSJitGetterOp)passExternalInterfaceRecord },
14139 { prototypes::id::TestJSImplInterface },
14140 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14141 JSJitInfo::Method,
14142 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14143 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14144 false, /* isInfallible. False in setters. */
14145 false, /* isMovable. Not relevant for setters. */
14146 false, /* isEliminatable. Not relevant for setters. */
14147 false, /* isAlwaysInSlot. Only relevant for getters. */
14148 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14149 false, /* isTypedMethod. Only relevant for methods. */
14150 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14151};
14152
14153MOZ_CAN_RUN_SCRIPT static bool
14154passNullableExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14155{
14156 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternalInterfaceRecord");
14157 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14160( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14158 "TestJSImplInterface", "passNullableExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14160( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14159 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14160( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14160 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14160( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
14161
14162 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14163 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord", 1)) {
14164 return false;
14165 }
14166 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14167 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14168 if (objIsXray) {
14169 unwrappedObj.emplace(cx, obj);
14170 }
14171 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0;
14172 if (args[0].isObject()) {
14173 auto& recordEntries = arg0.Entries();
14174
14175 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14176 JS::RootedVector<jsid> ids(cx);
14177 if (!js::GetPropertyKeys(cx, recordObj,
14178 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14179 return false;
14180 }
14181 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14182 JS_ReportOutOfMemory(cx);
14183 return false;
14184 }
14185 JS::Rooted<JS::Value> propNameValue(cx);
14186 JS::Rooted<JS::Value> temp(cx);
14187 JS::Rooted<jsid> curId(cx);
14188 JS::Rooted<JS::Value> idVal(cx);
14189 // Use a hashset to keep track of ids seen, to avoid
14190 // introducing nasty O(N^2) behavior scanning for them all the
14191 // time. Ideally we'd use a data structure with O(1) lookup
14192 // _and_ ordering for the MozMap, but we don't have one lying
14193 // around.
14194 nsTHashtable<nsStringHashKey> idsSeen;
14195 for (size_t i = 0; i < ids.length(); ++i) {
14196 curId = ids[i];
14197
14198 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14199 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14200 &desc)) {
14201 return false;
14202 }
14203
14204 if (desc.isNothing() || !desc->enumerable()) {
14205 continue;
14206 }
14207
14208 idVal = js::IdToValue(curId);
14209 nsString propName;
14210 // This will just throw if idVal is a Symbol, like the spec says
14211 // to do.
14212 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14213 return false;
14214 }
14215
14216 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14217 return false;
14218 }
14219
14220 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry;
14221 if (!idsSeen.EnsureInserted(propName)) {
14222 // Find the existing entry.
14223 auto idx = recordEntries.IndexOf(propName);
14224 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", 14225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14225); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14225 "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", 14225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14225); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14226 // Now blow it away to make it look like it was just added
14227 // to the array, because it's not obvious that it's
14228 // safe to write to its already-initialized mValue via our
14229 // normal codegen conversions. For example, the value
14230 // could be a union and this would change its type, but
14231 // codegen assumes we won't do that.
14232 entry = recordEntries.ReconstructElementAt(idx);
14233 } else {
14234 // Safe to do an infallible append here, because we did a
14235 // SetCapacity above to the right capacity.
14236 entry = recordEntries.AppendElement();
14237 }
14238 entry->mKey = propName;
14239 RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue;
14240 if (temp.isObject()) {
14241 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
14242 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
14243 JS::Rooted<JSObject*> source(cx, &temp.toObject());
14244 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)))
) {
14245 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface");
14246 return false;
14247 }
14248 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"
, 14248); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { MOZ_CrashSequence(__null, 14248); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14249 slot = tempHolder;
14250 } else if (temp.isNullOrUndefined()) {
14251 slot = nullptr;
14252 } else {
14253 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14254 return false;
14255 }
14256 }
14257 } else {
14258 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14259 return false;
14260 }
14261 if (objIsXray) {
14262 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14263 // we know Xrays have no dynamic unwrap behavior.
14264 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14265 if (!unwrappedObj.ref()) {
14266 return false;
14267 }
14268 }
14269 FastErrorResult rv;
14270 // NOTE: This assert does NOT call the function.
14271 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");
14272 MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14273 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord"
)), 0))
) {
14274 return false;
14275 }
14276 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14276); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14276); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14277 args.rval().setUndefined();
14278 return true;
14279}
14280
14281static const JSJitInfo passNullableExternalInterfaceRecord_methodinfo = {
14282 { (JSJitGetterOp)passNullableExternalInterfaceRecord },
14283 { prototypes::id::TestJSImplInterface },
14284 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14285 JSJitInfo::Method,
14286 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14287 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14288 false, /* isInfallible. False in setters. */
14289 false, /* isMovable. Not relevant for setters. */
14290 false, /* isEliminatable. Not relevant for setters. */
14291 false, /* isAlwaysInSlot. Only relevant for getters. */
14292 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14293 false, /* isTypedMethod. Only relevant for methods. */
14294 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14295};
14296
14297MOZ_CAN_RUN_SCRIPT static bool
14298passStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14299{
14300 BindingCallContext cx(cx_, "TestJSImplInterface.passStringRecord");
14301 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14302 "TestJSImplInterface", "passStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14303 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14304 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14304( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14305
14306 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14307 if (!args.requireAtLeast(cx, "TestJSImplInterface.passStringRecord", 1)) {
14308 return false;
14309 }
14310 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14311 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14312 if (objIsXray) {
14313 unwrappedObj.emplace(cx, obj);
14314 }
14315 Record<nsString, nsString> arg0;
14316 if (args[0].isObject()) {
14317 auto& recordEntries = arg0.Entries();
14318
14319 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14320 JS::RootedVector<jsid> ids(cx);
14321 if (!js::GetPropertyKeys(cx, recordObj,
14322 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14323 return false;
14324 }
14325 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14326 JS_ReportOutOfMemory(cx);
14327 return false;
14328 }
14329 JS::Rooted<JS::Value> propNameValue(cx);
14330 JS::Rooted<JS::Value> temp(cx);
14331 JS::Rooted<jsid> curId(cx);
14332 JS::Rooted<JS::Value> idVal(cx);
14333 // Use a hashset to keep track of ids seen, to avoid
14334 // introducing nasty O(N^2) behavior scanning for them all the
14335 // time. Ideally we'd use a data structure with O(1) lookup
14336 // _and_ ordering for the MozMap, but we don't have one lying
14337 // around.
14338 nsTHashtable<nsStringHashKey> idsSeen;
14339 for (size_t i = 0; i < ids.length(); ++i) {
14340 curId = ids[i];
14341
14342 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14343 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14344 &desc)) {
14345 return false;
14346 }
14347
14348 if (desc.isNothing() || !desc->enumerable()) {
14349 continue;
14350 }
14351
14352 idVal = js::IdToValue(curId);
14353 nsString propName;
14354 // This will just throw if idVal is a Symbol, like the spec says
14355 // to do.
14356 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14357 return false;
14358 }
14359
14360 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14361 return false;
14362 }
14363
14364 Record<nsString, nsString>::EntryType* entry;
14365 if (!idsSeen.EnsureInserted(propName)) {
14366 // Find the existing entry.
14367 auto idx = recordEntries.IndexOf(propName);
14368 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", 14369); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14369); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14369 "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", 14369); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14369); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14370 // Now blow it away to make it look like it was just added
14371 // to the array, because it's not obvious that it's
14372 // safe to write to its already-initialized mValue via our
14373 // normal codegen conversions. For example, the value
14374 // could be a union and this would change its type, but
14375 // codegen assumes we won't do that.
14376 entry = recordEntries.ReconstructElementAt(idx);
14377 } else {
14378 // Safe to do an infallible append here, because we did a
14379 // SetCapacity above to the right capacity.
14380 entry = recordEntries.AppendElement();
14381 }
14382 entry->mKey = propName;
14383 nsString& slot = entry->mValue;
14384 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
14385 return false;
14386 }
14387 }
14388 } else {
14389 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14390 return false;
14391 }
14392 if (objIsXray) {
14393 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14394 // we know Xrays have no dynamic unwrap behavior.
14395 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14396 if (!unwrappedObj.ref()) {
14397 return false;
14398 }
14399 }
14400 FastErrorResult rv;
14401 // NOTE: This assert does NOT call the function.
14402 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");
14403 MOZ_KnownLive(self)(self)->PassStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14404 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passStringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passStringRecord"
)), 0))
) {
14405 return false;
14406 }
14407 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14407); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14407); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14408 args.rval().setUndefined();
14409 return true;
14410}
14411
14412static const JSJitInfo passStringRecord_methodinfo = {
14413 { (JSJitGetterOp)passStringRecord },
14414 { prototypes::id::TestJSImplInterface },
14415 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14416 JSJitInfo::Method,
14417 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14418 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14419 false, /* isInfallible. False in setters. */
14420 false, /* isMovable. Not relevant for setters. */
14421 false, /* isEliminatable. Not relevant for setters. */
14422 false, /* isAlwaysInSlot. Only relevant for getters. */
14423 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14424 false, /* isTypedMethod. Only relevant for methods. */
14425 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14426};
14427
14428MOZ_CAN_RUN_SCRIPT static bool
14429passByteStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14430{
14431 BindingCallContext cx(cx_, "TestJSImplInterface.passByteStringRecord");
14432 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14435( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14433 "TestJSImplInterface", "passByteStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14435( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14434 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14435( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14435 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14435( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14436
14437 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14438 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByteStringRecord", 1)) {
14439 return false;
14440 }
14441 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14442 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14443 if (objIsXray) {
14444 unwrappedObj.emplace(cx, obj);
14445 }
14446 Record<nsString, nsCString> arg0;
14447 if (args[0].isObject()) {
14448 auto& recordEntries = arg0.Entries();
14449
14450 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14451 JS::RootedVector<jsid> ids(cx);
14452 if (!js::GetPropertyKeys(cx, recordObj,
14453 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14454 return false;
14455 }
14456 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14457 JS_ReportOutOfMemory(cx);
14458 return false;
14459 }
14460 JS::Rooted<JS::Value> propNameValue(cx);
14461 JS::Rooted<JS::Value> temp(cx);
14462 JS::Rooted<jsid> curId(cx);
14463 JS::Rooted<JS::Value> idVal(cx);
14464 // Use a hashset to keep track of ids seen, to avoid
14465 // introducing nasty O(N^2) behavior scanning for them all the
14466 // time. Ideally we'd use a data structure with O(1) lookup
14467 // _and_ ordering for the MozMap, but we don't have one lying
14468 // around.
14469 nsTHashtable<nsStringHashKey> idsSeen;
14470 for (size_t i = 0; i < ids.length(); ++i) {
14471 curId = ids[i];
14472
14473 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14474 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14475 &desc)) {
14476 return false;
14477 }
14478
14479 if (desc.isNothing() || !desc->enumerable()) {
14480 continue;
14481 }
14482
14483 idVal = js::IdToValue(curId);
14484 nsString propName;
14485 // This will just throw if idVal is a Symbol, like the spec says
14486 // to do.
14487 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14488 return false;
14489 }
14490
14491 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14492 return false;
14493 }
14494
14495 Record<nsString, nsCString>::EntryType* entry;
14496 if (!idsSeen.EnsureInserted(propName)) {
14497 // Find the existing entry.
14498 auto idx = recordEntries.IndexOf(propName);
14499 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", 14500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14500); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14500 "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", 14500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14500); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14501 // Now blow it away to make it look like it was just added
14502 // to the array, because it's not obvious that it's
14503 // safe to write to its already-initialized mValue via our
14504 // normal codegen conversions. For example, the value
14505 // could be a union and this would change its type, but
14506 // codegen assumes we won't do that.
14507 entry = recordEntries.ReconstructElementAt(idx);
14508 } else {
14509 // Safe to do an infallible append here, because we did a
14510 // SetCapacity above to the right capacity.
14511 entry = recordEntries.AppendElement();
14512 }
14513 entry->mKey = propName;
14514 nsCString& slot = entry->mValue;
14515 if (!ConvertJSValueToByteString(cx, temp, false, "value in argument 1", slot)) {
14516 return false;
14517 }
14518 }
14519 } else {
14520 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14521 return false;
14522 }
14523 if (objIsXray) {
14524 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14525 // we know Xrays have no dynamic unwrap behavior.
14526 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14527 if (!unwrappedObj.ref()) {
14528 return false;
14529 }
14530 }
14531 FastErrorResult rv;
14532 // NOTE: This assert does NOT call the function.
14533 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");
14534 MOZ_KnownLive(self)(self)->PassByteStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14535 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteStringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteStringRecord"
)), 0))
) {
14536 return false;
14537 }
14538 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14538); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14539 args.rval().setUndefined();
14540 return true;
14541}
14542
14543static const JSJitInfo passByteStringRecord_methodinfo = {
14544 { (JSJitGetterOp)passByteStringRecord },
14545 { prototypes::id::TestJSImplInterface },
14546 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14547 JSJitInfo::Method,
14548 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14549 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14550 false, /* isInfallible. False in setters. */
14551 false, /* isMovable. Not relevant for setters. */
14552 false, /* isEliminatable. Not relevant for setters. */
14553 false, /* isAlwaysInSlot. Only relevant for getters. */
14554 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14555 false, /* isTypedMethod. Only relevant for methods. */
14556 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14557};
14558
14559MOZ_CAN_RUN_SCRIPT static bool
14560passUTF8StringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14561{
14562 BindingCallContext cx(cx_, "TestJSImplInterface.passUTF8StringRecord");
14563 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14566( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14564 "TestJSImplInterface", "passUTF8StringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14566( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14565 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14566( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14566 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14566( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14567
14568 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14569 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUTF8StringRecord", 1)) {
14570 return false;
14571 }
14572 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14573 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14574 if (objIsXray) {
14575 unwrappedObj.emplace(cx, obj);
14576 }
14577 Record<nsString, nsCString> arg0;
14578 if (args[0].isObject()) {
14579 auto& recordEntries = arg0.Entries();
14580
14581 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14582 JS::RootedVector<jsid> ids(cx);
14583 if (!js::GetPropertyKeys(cx, recordObj,
14584 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14585 return false;
14586 }
14587 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14588 JS_ReportOutOfMemory(cx);
14589 return false;
14590 }
14591 JS::Rooted<JS::Value> propNameValue(cx);
14592 JS::Rooted<JS::Value> temp(cx);
14593 JS::Rooted<jsid> curId(cx);
14594 JS::Rooted<JS::Value> idVal(cx);
14595 // Use a hashset to keep track of ids seen, to avoid
14596 // introducing nasty O(N^2) behavior scanning for them all the
14597 // time. Ideally we'd use a data structure with O(1) lookup
14598 // _and_ ordering for the MozMap, but we don't have one lying
14599 // around.
14600 nsTHashtable<nsStringHashKey> idsSeen;
14601 for (size_t i = 0; i < ids.length(); ++i) {
14602 curId = ids[i];
14603
14604 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14605 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14606 &desc)) {
14607 return false;
14608 }
14609
14610 if (desc.isNothing() || !desc->enumerable()) {
14611 continue;
14612 }
14613
14614 idVal = js::IdToValue(curId);
14615 nsString propName;
14616 // This will just throw if idVal is a Symbol, like the spec says
14617 // to do.
14618 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14619 return false;
14620 }
14621
14622 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14623 return false;
14624 }
14625
14626 Record<nsString, nsCString>::EntryType* entry;
14627 if (!idsSeen.EnsureInserted(propName)) {
14628 // Find the existing entry.
14629 auto idx = recordEntries.IndexOf(propName);
14630 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", 14631); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14631); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14631 "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", 14631); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14631); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14632 // Now blow it away to make it look like it was just added
14633 // to the array, because it's not obvious that it's
14634 // safe to write to its already-initialized mValue via our
14635 // normal codegen conversions. For example, the value
14636 // could be a union and this would change its type, but
14637 // codegen assumes we won't do that.
14638 entry = recordEntries.ReconstructElementAt(idx);
14639 } else {
14640 // Safe to do an infallible append here, because we did a
14641 // SetCapacity above to the right capacity.
14642 entry = recordEntries.AppendElement();
14643 }
14644 entry->mKey = propName;
14645 nsCString& slot = entry->mValue;
14646 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
14647 return false;
14648 }
14649 }
14650 } else {
14651 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14652 return false;
14653 }
14654 if (objIsXray) {
14655 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14656 // we know Xrays have no dynamic unwrap behavior.
14657 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14658 if (!unwrappedObj.ref()) {
14659 return false;
14660 }
14661 }
14662 FastErrorResult rv;
14663 // NOTE: This assert does NOT call the function.
14664 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");
14665 MOZ_KnownLive(self)(self)->PassUTF8StringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14666 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8StringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8StringRecord"
)), 0))
) {
14667 return false;
14668 }
14669 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14669); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14669); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14670 args.rval().setUndefined();
14671 return true;
14672}
14673
14674static const JSJitInfo passUTF8StringRecord_methodinfo = {
14675 { (JSJitGetterOp)passUTF8StringRecord },
14676 { prototypes::id::TestJSImplInterface },
14677 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14678 JSJitInfo::Method,
14679 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14680 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14681 false, /* isInfallible. False in setters. */
14682 false, /* isMovable. Not relevant for setters. */
14683 false, /* isEliminatable. Not relevant for setters. */
14684 false, /* isAlwaysInSlot. Only relevant for getters. */
14685 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14686 false, /* isTypedMethod. Only relevant for methods. */
14687 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14688};
14689
14690MOZ_CAN_RUN_SCRIPT static bool
14691passRecordOfRecords(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14692{
14693 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfRecords");
14694 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14697( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14695 "TestJSImplInterface", "passRecordOfRecords", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14697( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14696 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14697( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14697 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14697( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14698
14699 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14700 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfRecords", 1)) {
14701 return false;
14702 }
14703 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14704 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14705 if (objIsXray) {
14706 unwrappedObj.emplace(cx, obj);
14707 }
14708 Record<nsString, Record<nsString, int32_t>> arg0;
14709 if (args[0].isObject()) {
14710 auto& recordEntries = arg0.Entries();
14711
14712 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14713 JS::RootedVector<jsid> ids(cx);
14714 if (!js::GetPropertyKeys(cx, recordObj,
14715 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14716 return false;
14717 }
14718 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14719 JS_ReportOutOfMemory(cx);
14720 return false;
14721 }
14722 JS::Rooted<JS::Value> propNameValue(cx);
14723 JS::Rooted<JS::Value> temp(cx);
14724 JS::Rooted<jsid> curId(cx);
14725 JS::Rooted<JS::Value> idVal(cx);
14726 // Use a hashset to keep track of ids seen, to avoid
14727 // introducing nasty O(N^2) behavior scanning for them all the
14728 // time. Ideally we'd use a data structure with O(1) lookup
14729 // _and_ ordering for the MozMap, but we don't have one lying
14730 // around.
14731 nsTHashtable<nsStringHashKey> idsSeen;
14732 for (size_t i = 0; i < ids.length(); ++i) {
14733 curId = ids[i];
14734
14735 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14736 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14737 &desc)) {
14738 return false;
14739 }
14740
14741 if (desc.isNothing() || !desc->enumerable()) {
14742 continue;
14743 }
14744
14745 idVal = js::IdToValue(curId);
14746 nsString propName;
14747 // This will just throw if idVal is a Symbol, like the spec says
14748 // to do.
14749 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14750 return false;
14751 }
14752
14753 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14754 return false;
14755 }
14756
14757 Record<nsString, Record<nsString, int32_t>>::EntryType* entry;
14758 if (!idsSeen.EnsureInserted(propName)) {
14759 // Find the existing entry.
14760 auto idx = recordEntries.IndexOf(propName);
14761 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", 14762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14762); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14762 "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", 14762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14762); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14763 // Now blow it away to make it look like it was just added
14764 // to the array, because it's not obvious that it's
14765 // safe to write to its already-initialized mValue via our
14766 // normal codegen conversions. For example, the value
14767 // could be a union and this would change its type, but
14768 // codegen assumes we won't do that.
14769 entry = recordEntries.ReconstructElementAt(idx);
14770 } else {
14771 // Safe to do an infallible append here, because we did a
14772 // SetCapacity above to the right capacity.
14773 entry = recordEntries.AppendElement();
14774 }
14775 entry->mKey = propName;
14776 Record<nsString, int32_t>& slot = entry->mValue;
14777 if (temp.isObject()) {
14778 auto& recordEntries = slot.Entries();
14779
14780 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
14781 JS::RootedVector<jsid> ids(cx);
14782 if (!js::GetPropertyKeys(cx, recordObj,
14783 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14784 return false;
14785 }
14786 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14787 JS_ReportOutOfMemory(cx);
14788 return false;
14789 }
14790 JS::Rooted<JS::Value> propNameValue(cx);
14791 JS::Rooted<JS::Value> temp(cx);
14792 JS::Rooted<jsid> curId(cx);
14793 JS::Rooted<JS::Value> idVal(cx);
14794 // Use a hashset to keep track of ids seen, to avoid
14795 // introducing nasty O(N^2) behavior scanning for them all the
14796 // time. Ideally we'd use a data structure with O(1) lookup
14797 // _and_ ordering for the MozMap, but we don't have one lying
14798 // around.
14799 nsTHashtable<nsStringHashKey> idsSeen;
14800 for (size_t i = 0; i < ids.length(); ++i) {
14801 curId = ids[i];
14802
14803 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14804 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14805 &desc)) {
14806 return false;
14807 }
14808
14809 if (desc.isNothing() || !desc->enumerable()) {
14810 continue;
14811 }
14812
14813 idVal = js::IdToValue(curId);
14814 nsString propName;
14815 // This will just throw if idVal is a Symbol, like the spec says
14816 // to do.
14817 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
14818 return false;
14819 }
14820
14821 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14822 return false;
14823 }
14824
14825 Record<nsString, int32_t>::EntryType* entry;
14826 if (!idsSeen.EnsureInserted(propName)) {
14827 // Find the existing entry.
14828 auto idx = recordEntries.IndexOf(propName);
14829 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", 14830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14830); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14830 "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", 14830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 14830); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14831 // Now blow it away to make it look like it was just added
14832 // to the array, because it's not obvious that it's
14833 // safe to write to its already-initialized mValue via our
14834 // normal codegen conversions. For example, the value
14835 // could be a union and this would change its type, but
14836 // codegen assumes we won't do that.
14837 entry = recordEntries.ReconstructElementAt(idx);
14838 } else {
14839 // Safe to do an infallible append here, because we did a
14840 // SetCapacity above to the right capacity.
14841 entry = recordEntries.AppendElement();
14842 }
14843 entry->mKey = propName;
14844 int32_t& slot = entry->mValue;
14845 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in value in argument 1", &slot)) {
14846 return false;
14847 }
14848 }
14849 } else {
14850 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14851 return false;
14852 }
14853 }
14854 } else {
14855 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14856 return false;
14857 }
14858 if (objIsXray) {
14859 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14860 // we know Xrays have no dynamic unwrap behavior.
14861 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14862 if (!unwrappedObj.ref()) {
14863 return false;
14864 }
14865 }
14866 FastErrorResult rv;
14867 // NOTE: This assert does NOT call the function.
14868 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");
14869 MOZ_KnownLive(self)(self)->PassRecordOfRecords(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14870 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecords"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecords"
)), 0))
) {
14871 return false;
14872 }
14873 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14873); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14873); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14874 args.rval().setUndefined();
14875 return true;
14876}
14877
14878static const JSJitInfo passRecordOfRecords_methodinfo = {
14879 { (JSJitGetterOp)passRecordOfRecords },
14880 { prototypes::id::TestJSImplInterface },
14881 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14882 JSJitInfo::Method,
14883 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14884 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14885 false, /* isInfallible. False in setters. */
14886 false, /* isMovable. Not relevant for setters. */
14887 false, /* isEliminatable. Not relevant for setters. */
14888 false, /* isAlwaysInSlot. Only relevant for getters. */
14889 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14890 false, /* isTypedMethod. Only relevant for methods. */
14891 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14892};
14893
14894MOZ_CAN_RUN_SCRIPT static bool
14895receiveRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14896{
14897 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14900( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14898 "TestJSImplInterface", "receiveRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14900( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14899 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14900( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14900 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14900( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14901
14902 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14903 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14904 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14905 if (objIsXray) {
14906 unwrappedObj.emplace(cx, obj);
14907 }
14908 if (objIsXray) {
14909 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14910 // we know Xrays have no dynamic unwrap behavior.
14911 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14912 if (!unwrappedObj.ref()) {
14913 return false;
14914 }
14915 }
14916 FastErrorResult rv;
14917 Record<nsString, int32_t> result;
14918 // NOTE: This assert does NOT call the function.
14919 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");
14920 MOZ_KnownLive(self)(self)->ReceiveRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14921 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecord"
)), 0))
) {
14922 return false;
14923 }
14924 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14924); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14924); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
14925
14926 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
14927 if (!returnObj) {
14928 return false;
14929 }
14930 // Scope for 'tmp'
14931 {
14932 JS::Rooted<JS::Value> tmp(cx);
14933 for (auto& entry : result.Entries()) {
14934 auto& recordValue0 = entry.mValue;
14935 // Control block to let us common up the JS_DefineUCProperty calls when there
14936 // are different ways to succeed at wrapping the value.
14937 do {
14938 tmp.setInt32(int32_t(recordValue0));
14939 break;
14940 } while (false);
14941 if (!JS_DefineUCProperty(cx, returnObj,
14942 entry.mKey.BeginReading(),
14943 entry.mKey.Length(), tmp,
14944 JSPROP_ENUMERATE)) {
14945 return false;
14946 }
14947 }
14948 }
14949 args.rval().setObject(*returnObj);
14950 return true;
14951}
14952
14953static const JSJitInfo receiveRecord_methodinfo = {
14954 { (JSJitGetterOp)receiveRecord },
14955 { prototypes::id::TestJSImplInterface },
14956 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14957 JSJitInfo::Method,
14958 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14959 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
14960 false, /* isInfallible. False in setters. */
14961 false, /* isMovable. Not relevant for setters. */
14962 false, /* isEliminatable. Not relevant for setters. */
14963 false, /* isAlwaysInSlot. Only relevant for getters. */
14964 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14965 false, /* isTypedMethod. Only relevant for methods. */
14966 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14967};
14968
14969MOZ_CAN_RUN_SCRIPT static bool
14970receiveNullableRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14971{
14972 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14975( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14973 "TestJSImplInterface", "receiveNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14975( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14974 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14975( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14975 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14975( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14976
14977 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14978 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14979 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14980 if (objIsXray) {
14981 unwrappedObj.emplace(cx, obj);
14982 }
14983 if (objIsXray) {
14984 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14985 // we know Xrays have no dynamic unwrap behavior.
14986 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14987 if (!unwrappedObj.ref()) {
14988 return false;
14989 }
14990 }
14991 FastErrorResult rv;
14992 Nullable<Record<nsString, int32_t>> result;
14993 // NOTE: This assert does NOT call the function.
14994 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");
14995 MOZ_KnownLive(self)(self)->ReceiveNullableRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14996 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecord"
)), 0))
) {
14997 return false;
14998 }
14999 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14999); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 14999); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15000
15001 if (result.IsNull()) {
15002 args.rval().setNull();
15003 return true;
15004 }
15005
15006 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15007 if (!returnObj) {
15008 return false;
15009 }
15010 // Scope for 'tmp'
15011 {
15012 JS::Rooted<JS::Value> tmp(cx);
15013 for (auto& entry : result.Value().Entries()) {
15014 auto& recordValue0 = entry.mValue;
15015 // Control block to let us common up the JS_DefineUCProperty calls when there
15016 // are different ways to succeed at wrapping the value.
15017 do {
15018 tmp.setInt32(int32_t(recordValue0));
15019 break;
15020 } while (false);
15021 if (!JS_DefineUCProperty(cx, returnObj,
15022 entry.mKey.BeginReading(),
15023 entry.mKey.Length(), tmp,
15024 JSPROP_ENUMERATE)) {
15025 return false;
15026 }
15027 }
15028 }
15029 args.rval().setObject(*returnObj);
15030 return true;
15031}
15032
15033static const JSJitInfo receiveNullableRecord_methodinfo = {
15034 { (JSJitGetterOp)receiveNullableRecord },
15035 { prototypes::id::TestJSImplInterface },
15036 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15037 JSJitInfo::Method,
15038 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15039 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
15040 false, /* isInfallible. False in setters. */
15041 false, /* isMovable. Not relevant for setters. */
15042 false, /* isEliminatable. Not relevant for setters. */
15043 false, /* isAlwaysInSlot. Only relevant for getters. */
15044 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15045 false, /* isTypedMethod. Only relevant for methods. */
15046 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15047};
15048
15049MOZ_CAN_RUN_SCRIPT static bool
15050receiveRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15051{
15052 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15055( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15053 "TestJSImplInterface", "receiveRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15055( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15054 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15055( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15055 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15055( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15056
15057 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15058 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15059 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15060 if (objIsXray) {
15061 unwrappedObj.emplace(cx, obj);
15062 }
15063 if (objIsXray) {
15064 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15065 // we know Xrays have no dynamic unwrap behavior.
15066 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15067 if (!unwrappedObj.ref()) {
15068 return false;
15069 }
15070 }
15071 FastErrorResult rv;
15072 Record<nsString, Nullable<int32_t>> result;
15073 // NOTE: This assert does NOT call the function.
15074 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");
15075 MOZ_KnownLive(self)(self)->ReceiveRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15076 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecordOfNullableInts"
)), 0))
) {
15077 return false;
15078 }
15079 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15079); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15079); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15080
15081 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15082 if (!returnObj) {
15083 return false;
15084 }
15085 // Scope for 'tmp'
15086 {
15087 JS::Rooted<JS::Value> tmp(cx);
15088 for (auto& entry : result.Entries()) {
15089 auto& recordValue0 = entry.mValue;
15090 // Control block to let us common up the JS_DefineUCProperty calls when there
15091 // are different ways to succeed at wrapping the value.
15092 do {
15093 if (recordValue0.IsNull()) {
15094 tmp.setNull();
15095 break;
15096 }
15097 tmp.setInt32(int32_t(recordValue0.Value()));
15098 break;
15099 } while (false);
15100 if (!JS_DefineUCProperty(cx, returnObj,
15101 entry.mKey.BeginReading(),
15102 entry.mKey.Length(), tmp,
15103 JSPROP_ENUMERATE)) {
15104 return false;
15105 }
15106 }
15107 }
15108 args.rval().setObject(*returnObj);
15109 return true;
15110}
15111
15112static const JSJitInfo receiveRecordOfNullableInts_methodinfo = {
15113 { (JSJitGetterOp)receiveRecordOfNullableInts },
15114 { prototypes::id::TestJSImplInterface },
15115 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15116 JSJitInfo::Method,
15117 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15118 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
15119 false, /* isInfallible. False in setters. */
15120 false, /* isMovable. Not relevant for setters. */
15121 false, /* isEliminatable. Not relevant for setters. */
15122 false, /* isAlwaysInSlot. Only relevant for getters. */
15123 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15124 false, /* isTypedMethod. Only relevant for methods. */
15125 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15126};
15127
15128MOZ_CAN_RUN_SCRIPT static bool
15129receiveNullableRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15130{
15131 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15134( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15132 "TestJSImplInterface", "receiveNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15134( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15133 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15134( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15134 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15134( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15135
15136 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15137 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15138 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15139 if (objIsXray) {
15140 unwrappedObj.emplace(cx, obj);
15141 }
15142 if (objIsXray) {
15143 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15144 // we know Xrays have no dynamic unwrap behavior.
15145 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15146 if (!unwrappedObj.ref()) {
15147 return false;
15148 }
15149 }
15150 FastErrorResult rv;
15151 Nullable<Record<nsString, Nullable<int32_t>>> result;
15152 // NOTE: This assert does NOT call the function.
15153 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");
15154 MOZ_KnownLive(self)(self)->ReceiveNullableRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15155 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecordOfNullableInts"
)), 0))
) {
15156 return false;
15157 }
15158 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15158); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15158); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15159
15160 if (result.IsNull()) {
15161 args.rval().setNull();
15162 return true;
15163 }
15164
15165 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15166 if (!returnObj) {
15167 return false;
15168 }
15169 // Scope for 'tmp'
15170 {
15171 JS::Rooted<JS::Value> tmp(cx);
15172 for (auto& entry : result.Value().Entries()) {
15173 auto& recordValue0 = entry.mValue;
15174 // Control block to let us common up the JS_DefineUCProperty calls when there
15175 // are different ways to succeed at wrapping the value.
15176 do {
15177 if (recordValue0.IsNull()) {
15178 tmp.setNull();
15179 break;
15180 }
15181 tmp.setInt32(int32_t(recordValue0.Value()));
15182 break;
15183 } while (false);
15184 if (!JS_DefineUCProperty(cx, returnObj,
15185 entry.mKey.BeginReading(),
15186 entry.mKey.Length(), tmp,
15187 JSPROP_ENUMERATE)) {
15188 return false;
15189 }
15190 }
15191 }
15192 args.rval().setObject(*returnObj);
15193 return true;
15194}
15195
15196static const JSJitInfo receiveNullableRecordOfNullableInts_methodinfo = {
15197 { (JSJitGetterOp)receiveNullableRecordOfNullableInts },
15198 { prototypes::id::TestJSImplInterface },
15199 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15200 JSJitInfo::Method,
15201 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15202 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
15203 false, /* isInfallible. False in setters. */
15204 false, /* isMovable. Not relevant for setters. */
15205 false, /* isEliminatable. Not relevant for setters. */
15206 false, /* isAlwaysInSlot. Only relevant for getters. */
15207 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15208 false, /* isTypedMethod. Only relevant for methods. */
15209 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15210};
15211
15212MOZ_CAN_RUN_SCRIPT static bool
15213receiveAnyRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15214{
15215 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15218( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15216 "TestJSImplInterface", "receiveAnyRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15218( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15217 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15218( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15218 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15218( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15219
15220 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15221 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15222 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15223 if (objIsXray) {
15224 unwrappedObj.emplace(cx, obj);
15225 }
15226 if (objIsXray) {
15227 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15228 // we know Xrays have no dynamic unwrap behavior.
15229 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15230 if (!unwrappedObj.ref()) {
15231 return false;
15232 }
15233 }
15234 FastErrorResult rv;
15235 Record<nsString, JS::Value> result;
15236 RecordRooter<nsString, JS::Value> resultRooter(cx, &result);
15237 // NOTE: This assert does NOT call the function.
15238 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");
15239 MOZ_KnownLive(self)(self)->ReceiveAnyRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15240 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnyRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnyRecord"
)), 0))
) {
15241 return false;
15242 }
15243 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15243); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15244
15245 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15246 if (!returnObj) {
15247 return false;
15248 }
15249 // Scope for 'tmp'
15250 {
15251 JS::Rooted<JS::Value> tmp(cx);
15252 for (auto& entry : result.Entries()) {
15253 auto& recordValue0 = entry.mValue;
15254 // Control block to let us common up the JS_DefineUCProperty calls when there
15255 // are different ways to succeed at wrapping the value.
15256 do {
15257 JS::ExposeValueToActiveJS(recordValue0);
15258 tmp.set(recordValue0);
15259 if (!MaybeWrapValue(cx, &tmp)) {
15260 return false;
15261 }
15262 break;
15263 } while (false);
15264 if (!JS_DefineUCProperty(cx, returnObj,
15265 entry.mKey.BeginReading(),
15266 entry.mKey.Length(), tmp,
15267 JSPROP_ENUMERATE)) {
15268 return false;
15269 }
15270 }
15271 }
15272 args.rval().setObject(*returnObj);
15273 return true;
15274}
15275
15276static const JSJitInfo receiveAnyRecord_methodinfo = {
15277 { (JSJitGetterOp)receiveAnyRecord },
15278 { prototypes::id::TestJSImplInterface },
15279 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15280 JSJitInfo::Method,
15281 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15282 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
15283 false, /* isInfallible. False in setters. */
15284 false, /* isMovable. Not relevant for setters. */
15285 false, /* isEliminatable. Not relevant for setters. */
15286 false, /* isAlwaysInSlot. Only relevant for getters. */
15287 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15288 false, /* isTypedMethod. Only relevant for methods. */
15289 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15290};
15291
15292MOZ_CAN_RUN_SCRIPT static bool
15293passArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15294{
15295 BindingCallContext cx(cx_, "TestJSImplInterface.passArrayBuffer");
15296 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15299( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15297 "TestJSImplInterface", "passArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15299( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15298 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15299( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15299 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15299( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15300
15301 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15302 if (!args.requireAtLeast(cx, "TestJSImplInterface.passArrayBuffer", 1)) {
15303 return false;
15304 }
15305 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15306 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15307 if (objIsXray) {
15308 unwrappedObj.emplace(cx, obj);
15309 }
15310 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
15311 if (args[0].isObject()) {
15312 if (!arg0.Init(&args[0].toObject())) {
15313 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
15314 return false;
15315 }
15316 if (JS::IsSharedArrayBufferObject(arg0.Obj())) {
15317 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15318 return false;
15319 }
15320 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
15321 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15322 return false;
15323 }
15324 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
15325 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15326 return false;
15327 }
15328 if (JS::IsImmutableArrayBufferMaybeShared(arg0.Obj())) {
15329 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15330 return false;
15331 }
15332 } else {
15333 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15334 return false;
15335 }
15336 if (objIsXray) {
15337 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15338 // we know Xrays have no dynamic unwrap behavior.
15339 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15340 if (!unwrappedObj.ref()) {
15341 return false;
15342 }
15343 }
15344 FastErrorResult rv;
15345 // NOTE: This assert does NOT call the function.
15346 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");
15347 MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15348 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer"
)), 0))
) {
15349 return false;
15350 }
15351 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15351); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15351); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15352 args.rval().setUndefined();
15353 return true;
15354}
15355
15356static const JSJitInfo passArrayBuffer_methodinfo = {
15357 { (JSJitGetterOp)passArrayBuffer },
15358 { prototypes::id::TestJSImplInterface },
15359 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15360 JSJitInfo::Method,
15361 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15362 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15363 false, /* isInfallible. False in setters. */
15364 false, /* isMovable. Not relevant for setters. */
15365 false, /* isEliminatable. Not relevant for setters. */
15366 false, /* isAlwaysInSlot. Only relevant for getters. */
15367 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15368 false, /* isTypedMethod. Only relevant for methods. */
15369 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15370};
15371
15372MOZ_CAN_RUN_SCRIPT static bool
15373passNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15374{
15375 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableArrayBuffer");
15376 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15379( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15377 "TestJSImplInterface", "passNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15379( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15378 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15379( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15379 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15379( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15380
15381 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15382 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableArrayBuffer", 1)) {
15383 return false;
15384 }
15385 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15386 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15387 if (objIsXray) {
15388 unwrappedObj.emplace(cx, obj);
15389 }
15390 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
15391 if (args[0].isObject()) {
15392 if (!arg0.SetValue().Init(&args[0].toObject())) {
15393 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15394 return false;
15395 }
15396 if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) {
15397 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15398 return false;
15399 }
15400 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15401 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15402 return false;
15403 }
15404 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15405 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15406 return false;
15407 }
15408 if (JS::IsImmutableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15409 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15410 return false;
15411 }
15412 } else if (args[0].isNullOrUndefined()) {
15413 arg0.SetNull();
15414 } else {
15415 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15416 return false;
15417 }
15418 if (objIsXray) {
15419 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15420 // we know Xrays have no dynamic unwrap behavior.
15421 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15422 if (!unwrappedObj.ref()) {
15423 return false;
15424 }
15425 }
15426 FastErrorResult rv;
15427 // NOTE: This assert does NOT call the function.
15428 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");
15429 MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15430 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer"
)), 0))
) {
15431 return false;
15432 }
15433 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15433); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15433); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15434 args.rval().setUndefined();
15435 return true;
15436}
15437
15438static const JSJitInfo passNullableArrayBuffer_methodinfo = {
15439 { (JSJitGetterOp)passNullableArrayBuffer },
15440 { prototypes::id::TestJSImplInterface },
15441 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15442 JSJitInfo::Method,
15443 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15444 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15445 false, /* isInfallible. False in setters. */
15446 false, /* isMovable. Not relevant for setters. */
15447 false, /* isEliminatable. Not relevant for setters. */
15448 false, /* isAlwaysInSlot. Only relevant for getters. */
15449 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15450 false, /* isTypedMethod. Only relevant for methods. */
15451 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15452};
15453
15454MOZ_CAN_RUN_SCRIPT static bool
15455passOptionalArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15456{
15457 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalArrayBuffer");
15458 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15461( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15459 "TestJSImplInterface", "passOptionalArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15461( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15460 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15461( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15461 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15461( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15462
15463 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15464 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15465 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15466 if (objIsXray) {
15467 unwrappedObj.emplace(cx, obj);
15468 }
15469 Optional<ArrayBuffer> arg0;
15470 Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder;
15471 if (args.hasDefined(0)) {
15472 arg0.Construct();
15473 arg0_holder.emplace(cx, &arg0.Value());
15474 if (args[0].isObject()) {
15475 if (!arg0.Value().Init(&args[0].toObject())) {
15476 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
15477 return false;
15478 }
15479 if (JS::IsSharedArrayBufferObject(arg0.Value().Obj())) {
15480 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15481 return false;
15482 }
15483 if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().Obj())) {
15484 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15485 return false;
15486 }
15487 if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().Obj())) {
15488 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15489 return false;
15490 }
15491 if (JS::IsImmutableArrayBufferMaybeShared(arg0.Value().Obj())) {
15492 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15493 return false;
15494 }
15495 } else {
15496 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15497 return false;
15498 }
15499 }
15500 if (objIsXray) {
15501 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15502 // we know Xrays have no dynamic unwrap behavior.
15503 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15504 if (!unwrappedObj.ref()) {
15505 return false;
15506 }
15507 }
15508 FastErrorResult rv;
15509 // NOTE: This assert does NOT call the function.
15510 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");
15511 MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15512 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer"
)), 0))
) {
15513 return false;
15514 }
15515 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15515); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15515); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15516 args.rval().setUndefined();
15517 return true;
15518}
15519
15520static const JSJitInfo passOptionalArrayBuffer_methodinfo = {
15521 { (JSJitGetterOp)passOptionalArrayBuffer },
15522 { prototypes::id::TestJSImplInterface },
15523 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15524 JSJitInfo::Method,
15525 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15526 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15527 false, /* isInfallible. False in setters. */
15528 false, /* isMovable. Not relevant for setters. */
15529 false, /* isEliminatable. Not relevant for setters. */
15530 false, /* isAlwaysInSlot. Only relevant for getters. */
15531 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15532 false, /* isTypedMethod. Only relevant for methods. */
15533 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15534};
15535
15536MOZ_CAN_RUN_SCRIPT static bool
15537passOptionalNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15538{
15539 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBuffer");
15540 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15543( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15541 "TestJSImplInterface", "passOptionalNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15543( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15542 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15543( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15543 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15543( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15544
15545 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15546 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15547 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15548 if (objIsXray) {
15549 unwrappedObj.emplace(cx, obj);
15550 }
15551 Optional<Nullable<ArrayBuffer>> arg0;
15552 Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder;
15553 if (args.hasDefined(0)) {
15554 arg0.Construct();
15555 arg0_holder.emplace(cx, &arg0.Value().SetValue());
15556 if (args[0].isObject()) {
15557 if (!arg0.Value().SetValue().Init(&args[0].toObject())) {
15558 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15559 return false;
15560 }
15561 if (JS::IsSharedArrayBufferObject(arg0.Value().SetValue().Obj())) {
15562 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15563 return false;
15564 }
15565 if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) {
15566 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15567 return false;
15568 }
15569 if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) {
15570 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15571 return false;
15572 }
15573 if (JS::IsImmutableArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) {
15574 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15575 return false;
15576 }
15577 } else if (args[0].isNullOrUndefined()) {
15578 arg0.Value().SetNull();
15579 } else {
15580 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15581 return false;
15582 }
15583 }
15584 if (objIsXray) {
15585 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15586 // we know Xrays have no dynamic unwrap behavior.
15587 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15588 if (!unwrappedObj.ref()) {
15589 return false;
15590 }
15591 }
15592 FastErrorResult rv;
15593 // NOTE: This assert does NOT call the function.
15594 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");
15595 MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15596 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer"
)), 0))
) {
15597 return false;
15598 }
15599 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15599); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15599); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15600 args.rval().setUndefined();
15601 return true;
15602}
15603
15604static const JSJitInfo passOptionalNullableArrayBuffer_methodinfo = {
15605 { (JSJitGetterOp)passOptionalNullableArrayBuffer },
15606 { prototypes::id::TestJSImplInterface },
15607 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15608 JSJitInfo::Method,
15609 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15610 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15611 false, /* isInfallible. False in setters. */
15612 false, /* isMovable. Not relevant for setters. */
15613 false, /* isEliminatable. Not relevant for setters. */
15614 false, /* isAlwaysInSlot. Only relevant for getters. */
15615 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15616 false, /* isTypedMethod. Only relevant for methods. */
15617 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15618};
15619
15620MOZ_CAN_RUN_SCRIPT static bool
15621passOptionalNullableArrayBufferWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15622{
15623 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue");
15624 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15627( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15625 "TestJSImplInterface", "passOptionalNullableArrayBufferWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15627( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15626 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15627( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15627 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15627( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15628
15629 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15630 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15631 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15632 if (objIsXray) {
15633 unwrappedObj.emplace(cx, obj);
15634 }
15635 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
15636 if (args.hasDefined(0)) {
15637 if (args[0].isObject()) {
15638 if (!arg0.SetValue().Init(&args[0].toObject())) {
15639 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15640 return false;
15641 }
15642 if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) {
15643 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15644 return false;
15645 }
15646 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15647 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15648 return false;
15649 }
15650 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15651 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15652 return false;
15653 }
15654 if (JS::IsImmutableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15655 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15656 return false;
15657 }
15658 } else if (args[0].isNullOrUndefined()) {
15659 arg0.SetNull();
15660 } else {
15661 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15662 return false;
15663 }
15664 } else {
15665 arg0.SetNull();
15666 }
15667 if (objIsXray) {
15668 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15669 // we know Xrays have no dynamic unwrap behavior.
15670 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15671 if (!unwrappedObj.ref()) {
15672 return false;
15673 }
15674 }
15675 FastErrorResult rv;
15676 // NOTE: This assert does NOT call the function.
15677 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");
15678 MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15679 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"
)), 0))
) {
15680 return false;
15681 }
15682 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15682); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15682); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15683 args.rval().setUndefined();
15684 return true;
15685}
15686
15687static const JSJitInfo passOptionalNullableArrayBufferWithDefaultValue_methodinfo = {
15688 { (JSJitGetterOp)passOptionalNullableArrayBufferWithDefaultValue },
15689 { prototypes::id::TestJSImplInterface },
15690 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15691 JSJitInfo::Method,
15692 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15693 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15694 false, /* isInfallible. False in setters. */
15695 false, /* isMovable. Not relevant for setters. */
15696 false, /* isEliminatable. Not relevant for setters. */
15697 false, /* isAlwaysInSlot. Only relevant for getters. */
15698 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15699 false, /* isTypedMethod. Only relevant for methods. */
15700 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15701};
15702
15703MOZ_CAN_RUN_SCRIPT static bool
15704passArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15705{
15706 BindingCallContext cx(cx_, "TestJSImplInterface.passArrayBufferView");
15707 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15710( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15708 "TestJSImplInterface", "passArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15710( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15709 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15710( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15710 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15710( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15711
15712 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15713 if (!args.requireAtLeast(cx, "TestJSImplInterface.passArrayBufferView", 1)) {
15714 return false;
15715 }
15716 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15717 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15718 if (objIsXray) {
15719 unwrappedObj.emplace(cx, obj);
15720 }
15721 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
15722 if (args[0].isObject()) {
15723 if (!arg0.Init(&args[0].toObject())) {
15724 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
15725 return false;
15726 }
15727 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15728 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15729 return false;
15730 }
15731 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15732 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15733 return false;
15734 }
15735 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15736 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15737 return false;
15738 }
15739 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
15740 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15741 return false;
15742 }
15743 } else {
15744 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15745 return false;
15746 }
15747 if (objIsXray) {
15748 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15749 // we know Xrays have no dynamic unwrap behavior.
15750 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15751 if (!unwrappedObj.ref()) {
15752 return false;
15753 }
15754 }
15755 FastErrorResult rv;
15756 // NOTE: This assert does NOT call the function.
15757 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");
15758 MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15759 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView"
)), 0))
) {
15760 return false;
15761 }
15762 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15762); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15763 args.rval().setUndefined();
15764 return true;
15765}
15766
15767static const JSJitInfo passArrayBufferView_methodinfo = {
15768 { (JSJitGetterOp)passArrayBufferView },
15769 { prototypes::id::TestJSImplInterface },
15770 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15771 JSJitInfo::Method,
15772 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15773 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15774 false, /* isInfallible. False in setters. */
15775 false, /* isMovable. Not relevant for setters. */
15776 false, /* isEliminatable. Not relevant for setters. */
15777 false, /* isAlwaysInSlot. Only relevant for getters. */
15778 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15779 false, /* isTypedMethod. Only relevant for methods. */
15780 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15781};
15782
15783MOZ_CAN_RUN_SCRIPT static bool
15784passInt8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15785{
15786 BindingCallContext cx(cx_, "TestJSImplInterface.passInt8Array");
15787 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15790( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15788 "TestJSImplInterface", "passInt8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15790( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15789 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15790( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15790 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15790( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15791
15792 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15793 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt8Array", 1)) {
15794 return false;
15795 }
15796 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15797 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15798 if (objIsXray) {
15799 unwrappedObj.emplace(cx, obj);
15800 }
15801 RootedSpiderMonkeyInterface<Int8Array> arg0(cx);
15802 if (args[0].isObject()) {
15803 if (!arg0.Init(&args[0].toObject())) {
15804 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int8Array");
15805 return false;
15806 }
15807 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15808 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15809 return false;
15810 }
15811 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15812 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15813 return false;
15814 }
15815 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15816 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15817 return false;
15818 }
15819 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
15820 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15821 return false;
15822 }
15823 } else {
15824 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15825 return false;
15826 }
15827 if (objIsXray) {
15828 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15829 // we know Xrays have no dynamic unwrap behavior.
15830 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15831 if (!unwrappedObj.ref()) {
15832 return false;
15833 }
15834 }
15835 FastErrorResult rv;
15836 // NOTE: This assert does NOT call the function.
15837 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");
15838 MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15839 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array"
)), 0))
) {
15840 return false;
15841 }
15842 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15842); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15842); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15843 args.rval().setUndefined();
15844 return true;
15845}
15846
15847static const JSJitInfo passInt8Array_methodinfo = {
15848 { (JSJitGetterOp)passInt8Array },
15849 { prototypes::id::TestJSImplInterface },
15850 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15851 JSJitInfo::Method,
15852 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15853 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15854 false, /* isInfallible. False in setters. */
15855 false, /* isMovable. Not relevant for setters. */
15856 false, /* isEliminatable. Not relevant for setters. */
15857 false, /* isAlwaysInSlot. Only relevant for getters. */
15858 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15859 false, /* isTypedMethod. Only relevant for methods. */
15860 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15861};
15862
15863MOZ_CAN_RUN_SCRIPT static bool
15864passInt16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15865{
15866 BindingCallContext cx(cx_, "TestJSImplInterface.passInt16Array");
15867 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15870( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15868 "TestJSImplInterface", "passInt16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15870( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15869 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15870( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15870 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15870( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15871
15872 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15873 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt16Array", 1)) {
15874 return false;
15875 }
15876 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15877 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15878 if (objIsXray) {
15879 unwrappedObj.emplace(cx, obj);
15880 }
15881 RootedSpiderMonkeyInterface<Int16Array> arg0(cx);
15882 if (args[0].isObject()) {
15883 if (!arg0.Init(&args[0].toObject())) {
15884 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int16Array");
15885 return false;
15886 }
15887 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15888 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15889 return false;
15890 }
15891 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15892 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15893 return false;
15894 }
15895 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15896 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15897 return false;
15898 }
15899 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
15900 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15901 return false;
15902 }
15903 } else {
15904 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15905 return false;
15906 }
15907 if (objIsXray) {
15908 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15909 // we know Xrays have no dynamic unwrap behavior.
15910 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15911 if (!unwrappedObj.ref()) {
15912 return false;
15913 }
15914 }
15915 FastErrorResult rv;
15916 // NOTE: This assert does NOT call the function.
15917 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");
15918 MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15919 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array"
)), 0))
) {
15920 return false;
15921 }
15922 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 15922); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
15923 args.rval().setUndefined();
15924 return true;
15925}
15926
15927static const JSJitInfo passInt16Array_methodinfo = {
15928 { (JSJitGetterOp)passInt16Array },
15929 { prototypes::id::TestJSImplInterface },
15930 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15931 JSJitInfo::Method,
15932 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15933 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15934 false, /* isInfallible. False in setters. */
15935 false, /* isMovable. Not relevant for setters. */
15936 false, /* isEliminatable. Not relevant for setters. */
15937 false, /* isAlwaysInSlot. Only relevant for getters. */
15938 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15939 false, /* isTypedMethod. Only relevant for methods. */
15940 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15941};
15942
15943MOZ_CAN_RUN_SCRIPT static bool
15944passInt32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15945{
15946 BindingCallContext cx(cx_, "TestJSImplInterface.passInt32Array");
15947 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15950( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15948 "TestJSImplInterface", "passInt32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15950( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15949 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15950( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15950 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15950( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15951
15952 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15953 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt32Array", 1)) {
15954 return false;
15955 }
15956 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15957 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15958 if (objIsXray) {
15959 unwrappedObj.emplace(cx, obj);
15960 }
15961 RootedSpiderMonkeyInterface<Int32Array> arg0(cx);
15962 if (args[0].isObject()) {
15963 if (!arg0.Init(&args[0].toObject())) {
15964 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int32Array");
15965 return false;
15966 }
15967 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15968 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15969 return false;
15970 }
15971 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15972 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15973 return false;
15974 }
15975 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15976 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15977 return false;
15978 }
15979 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
15980 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
15981 return false;
15982 }
15983 } else {
15984 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15985 return false;
15986 }
15987 if (objIsXray) {
15988 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15989 // we know Xrays have no dynamic unwrap behavior.
15990 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15991 if (!unwrappedObj.ref()) {
15992 return false;
15993 }
15994 }
15995 FastErrorResult rv;
15996 // NOTE: This assert does NOT call the function.
15997 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");
15998 MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15999 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array"
)), 0))
) {
16000 return false;
16001 }
16002 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16002); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16002); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16003 args.rval().setUndefined();
16004 return true;
16005}
16006
16007static const JSJitInfo passInt32Array_methodinfo = {
16008 { (JSJitGetterOp)passInt32Array },
16009 { prototypes::id::TestJSImplInterface },
16010 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16011 JSJitInfo::Method,
16012 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16013 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16014 false, /* isInfallible. False in setters. */
16015 false, /* isMovable. Not relevant for setters. */
16016 false, /* isEliminatable. Not relevant for setters. */
16017 false, /* isAlwaysInSlot. Only relevant for getters. */
16018 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16019 false, /* isTypedMethod. Only relevant for methods. */
16020 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16021};
16022
16023MOZ_CAN_RUN_SCRIPT static bool
16024passUint8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16025{
16026 BindingCallContext cx(cx_, "TestJSImplInterface.passUint8Array");
16027 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16030( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16028 "TestJSImplInterface", "passUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16030( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16029 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16030( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16030 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16030( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16031
16032 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16033 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8Array", 1)) {
16034 return false;
16035 }
16036 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16037 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16038 if (objIsXray) {
16039 unwrappedObj.emplace(cx, obj);
16040 }
16041 RootedSpiderMonkeyInterface<Uint8Array> arg0(cx);
16042 if (args[0].isObject()) {
16043 if (!arg0.Init(&args[0].toObject())) {
16044 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8Array");
16045 return false;
16046 }
16047 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16048 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16049 return false;
16050 }
16051 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16052 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16053 return false;
16054 }
16055 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16056 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16057 return false;
16058 }
16059 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16060 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16061 return false;
16062 }
16063 } else {
16064 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16065 return false;
16066 }
16067 if (objIsXray) {
16068 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16069 // we know Xrays have no dynamic unwrap behavior.
16070 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16071 if (!unwrappedObj.ref()) {
16072 return false;
16073 }
16074 }
16075 FastErrorResult rv;
16076 // NOTE: This assert does NOT call the function.
16077 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");
16078 MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16079 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array"
)), 0))
) {
16080 return false;
16081 }
16082 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16082); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16083 args.rval().setUndefined();
16084 return true;
16085}
16086
16087static const JSJitInfo passUint8Array_methodinfo = {
16088 { (JSJitGetterOp)passUint8Array },
16089 { prototypes::id::TestJSImplInterface },
16090 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16091 JSJitInfo::Method,
16092 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16093 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16094 false, /* isInfallible. False in setters. */
16095 false, /* isMovable. Not relevant for setters. */
16096 false, /* isEliminatable. Not relevant for setters. */
16097 false, /* isAlwaysInSlot. Only relevant for getters. */
16098 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16099 false, /* isTypedMethod. Only relevant for methods. */
16100 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16101};
16102
16103MOZ_CAN_RUN_SCRIPT static bool
16104passUint16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16105{
16106 BindingCallContext cx(cx_, "TestJSImplInterface.passUint16Array");
16107 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16110( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16108 "TestJSImplInterface", "passUint16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16110( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16109 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16110( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16110 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16110( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16111
16112 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16113 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint16Array", 1)) {
16114 return false;
16115 }
16116 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16117 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16118 if (objIsXray) {
16119 unwrappedObj.emplace(cx, obj);
16120 }
16121 RootedSpiderMonkeyInterface<Uint16Array> arg0(cx);
16122 if (args[0].isObject()) {
16123 if (!arg0.Init(&args[0].toObject())) {
16124 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint16Array");
16125 return false;
16126 }
16127 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16128 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16129 return false;
16130 }
16131 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16132 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16133 return false;
16134 }
16135 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16136 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16137 return false;
16138 }
16139 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16140 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16141 return false;
16142 }
16143 } else {
16144 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16145 return false;
16146 }
16147 if (objIsXray) {
16148 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16149 // we know Xrays have no dynamic unwrap behavior.
16150 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16151 if (!unwrappedObj.ref()) {
16152 return false;
16153 }
16154 }
16155 FastErrorResult rv;
16156 // NOTE: This assert does NOT call the function.
16157 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");
16158 MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16159 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array"
)), 0))
) {
16160 return false;
16161 }
16162 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16162); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16162); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16163 args.rval().setUndefined();
16164 return true;
16165}
16166
16167static const JSJitInfo passUint16Array_methodinfo = {
16168 { (JSJitGetterOp)passUint16Array },
16169 { prototypes::id::TestJSImplInterface },
16170 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16171 JSJitInfo::Method,
16172 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16173 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16174 false, /* isInfallible. False in setters. */
16175 false, /* isMovable. Not relevant for setters. */
16176 false, /* isEliminatable. Not relevant for setters. */
16177 false, /* isAlwaysInSlot. Only relevant for getters. */
16178 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16179 false, /* isTypedMethod. Only relevant for methods. */
16180 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16181};
16182
16183MOZ_CAN_RUN_SCRIPT static bool
16184passUint32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16185{
16186 BindingCallContext cx(cx_, "TestJSImplInterface.passUint32Array");
16187 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16190( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16188 "TestJSImplInterface", "passUint32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16190( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16189 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16190( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16190 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16190( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16191
16192 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16193 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint32Array", 1)) {
16194 return false;
16195 }
16196 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16197 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16198 if (objIsXray) {
16199 unwrappedObj.emplace(cx, obj);
16200 }
16201 RootedSpiderMonkeyInterface<Uint32Array> arg0(cx);
16202 if (args[0].isObject()) {
16203 if (!arg0.Init(&args[0].toObject())) {
16204 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint32Array");
16205 return false;
16206 }
16207 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16208 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16209 return false;
16210 }
16211 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16212 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16213 return false;
16214 }
16215 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16216 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16217 return false;
16218 }
16219 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16220 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16221 return false;
16222 }
16223 } else {
16224 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16225 return false;
16226 }
16227 if (objIsXray) {
16228 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16229 // we know Xrays have no dynamic unwrap behavior.
16230 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16231 if (!unwrappedObj.ref()) {
16232 return false;
16233 }
16234 }
16235 FastErrorResult rv;
16236 // NOTE: This assert does NOT call the function.
16237 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");
16238 MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16239 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array"
)), 0))
) {
16240 return false;
16241 }
16242 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16242); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16242); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16243 args.rval().setUndefined();
16244 return true;
16245}
16246
16247static const JSJitInfo passUint32Array_methodinfo = {
16248 { (JSJitGetterOp)passUint32Array },
16249 { prototypes::id::TestJSImplInterface },
16250 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16251 JSJitInfo::Method,
16252 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16253 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16254 false, /* isInfallible. False in setters. */
16255 false, /* isMovable. Not relevant for setters. */
16256 false, /* isEliminatable. Not relevant for setters. */
16257 false, /* isAlwaysInSlot. Only relevant for getters. */
16258 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16259 false, /* isTypedMethod. Only relevant for methods. */
16260 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16261};
16262
16263MOZ_CAN_RUN_SCRIPT static bool
16264passUint8ClampedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16265{
16266 BindingCallContext cx(cx_, "TestJSImplInterface.passUint8ClampedArray");
16267 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16270( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16268 "TestJSImplInterface", "passUint8ClampedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16270( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16269 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16270( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16270 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16270( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16271
16272 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16273 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8ClampedArray", 1)) {
16274 return false;
16275 }
16276 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16277 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16278 if (objIsXray) {
16279 unwrappedObj.emplace(cx, obj);
16280 }
16281 RootedSpiderMonkeyInterface<Uint8ClampedArray> arg0(cx);
16282 if (args[0].isObject()) {
16283 if (!arg0.Init(&args[0].toObject())) {
16284 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8ClampedArray");
16285 return false;
16286 }
16287 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16288 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16289 return false;
16290 }
16291 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16292 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16293 return false;
16294 }
16295 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16296 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16297 return false;
16298 }
16299 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16300 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16301 return false;
16302 }
16303 } else {
16304 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16305 return false;
16306 }
16307 if (objIsXray) {
16308 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16309 // we know Xrays have no dynamic unwrap behavior.
16310 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16311 if (!unwrappedObj.ref()) {
16312 return false;
16313 }
16314 }
16315 FastErrorResult rv;
16316 // NOTE: This assert does NOT call the function.
16317 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");
16318 MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16319 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray"
)), 0))
) {
16320 return false;
16321 }
16322 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16322); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16322); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16323 args.rval().setUndefined();
16324 return true;
16325}
16326
16327static const JSJitInfo passUint8ClampedArray_methodinfo = {
16328 { (JSJitGetterOp)passUint8ClampedArray },
16329 { prototypes::id::TestJSImplInterface },
16330 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16331 JSJitInfo::Method,
16332 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16333 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16334 false, /* isInfallible. False in setters. */
16335 false, /* isMovable. Not relevant for setters. */
16336 false, /* isEliminatable. Not relevant for setters. */
16337 false, /* isAlwaysInSlot. Only relevant for getters. */
16338 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16339 false, /* isTypedMethod. Only relevant for methods. */
16340 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16341};
16342
16343MOZ_CAN_RUN_SCRIPT static bool
16344passFloat32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16345{
16346 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat32Array");
16347 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16350( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16348 "TestJSImplInterface", "passFloat32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16350( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16349 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16350( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16350 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16350( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16351
16352 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16353 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat32Array", 1)) {
16354 return false;
16355 }
16356 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16357 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16358 if (objIsXray) {
16359 unwrappedObj.emplace(cx, obj);
16360 }
16361 RootedSpiderMonkeyInterface<Float32Array> arg0(cx);
16362 if (args[0].isObject()) {
16363 if (!arg0.Init(&args[0].toObject())) {
16364 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array");
16365 return false;
16366 }
16367 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16368 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16369 return false;
16370 }
16371 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16372 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16373 return false;
16374 }
16375 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16376 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16377 return false;
16378 }
16379 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16380 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16381 return false;
16382 }
16383 } else {
16384 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16385 return false;
16386 }
16387 if (objIsXray) {
16388 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16389 // we know Xrays have no dynamic unwrap behavior.
16390 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16391 if (!unwrappedObj.ref()) {
16392 return false;
16393 }
16394 }
16395 FastErrorResult rv;
16396 // NOTE: This assert does NOT call the function.
16397 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");
16398 MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16399 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array"
)), 0))
) {
16400 return false;
16401 }
16402 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16402); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16402); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16403 args.rval().setUndefined();
16404 return true;
16405}
16406
16407static const JSJitInfo passFloat32Array_methodinfo = {
16408 { (JSJitGetterOp)passFloat32Array },
16409 { prototypes::id::TestJSImplInterface },
16410 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16411 JSJitInfo::Method,
16412 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16413 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16414 false, /* isInfallible. False in setters. */
16415 false, /* isMovable. Not relevant for setters. */
16416 false, /* isEliminatable. Not relevant for setters. */
16417 false, /* isAlwaysInSlot. Only relevant for getters. */
16418 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16419 false, /* isTypedMethod. Only relevant for methods. */
16420 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16421};
16422
16423MOZ_CAN_RUN_SCRIPT static bool
16424passFloat64Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16425{
16426 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat64Array");
16427 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16430( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16428 "TestJSImplInterface", "passFloat64Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16430( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16429 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16430( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16430 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16430( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16431
16432 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16433 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat64Array", 1)) {
16434 return false;
16435 }
16436 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16437 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16438 if (objIsXray) {
16439 unwrappedObj.emplace(cx, obj);
16440 }
16441 RootedSpiderMonkeyInterface<Float64Array> arg0(cx);
16442 if (args[0].isObject()) {
16443 if (!arg0.Init(&args[0].toObject())) {
16444 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float64Array");
16445 return false;
16446 }
16447 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16448 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16449 return false;
16450 }
16451 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16452 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16453 return false;
16454 }
16455 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16456 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16457 return false;
16458 }
16459 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
16460 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
16461 return false;
16462 }
16463 } else {
16464 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16465 return false;
16466 }
16467 if (objIsXray) {
16468 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16469 // we know Xrays have no dynamic unwrap behavior.
16470 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16471 if (!unwrappedObj.ref()) {
16472 return false;
16473 }
16474 }
16475 FastErrorResult rv;
16476 // NOTE: This assert does NOT call the function.
16477 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");
16478 MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16479 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array"
)), 0))
) {
16480 return false;
16481 }
16482 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16482); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16482); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16483 args.rval().setUndefined();
16484 return true;
16485}
16486
16487static const JSJitInfo passFloat64Array_methodinfo = {
16488 { (JSJitGetterOp)passFloat64Array },
16489 { prototypes::id::TestJSImplInterface },
16490 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16491 JSJitInfo::Method,
16492 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16493 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16494 false, /* isInfallible. False in setters. */
16495 false, /* isMovable. Not relevant for setters. */
16496 false, /* isEliminatable. Not relevant for setters. */
16497 false, /* isAlwaysInSlot. Only relevant for getters. */
16498 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16499 false, /* isTypedMethod. Only relevant for methods. */
16500 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16501};
16502
16503MOZ_CAN_RUN_SCRIPT static bool
16504passSequenceOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16505{
16506 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfArrayBuffers");
16507 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16510( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16508 "TestJSImplInterface", "passSequenceOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16510( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16509 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16510( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16510 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16510( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16511
16512 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16513 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfArrayBuffers", 1)) {
16514 return false;
16515 }
16516 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16517 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16518 if (objIsXray) {
16519 unwrappedObj.emplace(cx, obj);
16520 }
16521 binding_detail::AutoSequence<ArrayBuffer> arg0;
16522 SequenceRooter<ArrayBuffer> arg0_holder(cx, &arg0);
16523 if (args[0].isObject()) {
16524 JS::ForOfIterator iter(cx);
16525 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
16526 return false;
16527 }
16528 if (!iter.valueIsIterable()) {
16529 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16530 return false;
16531 }
16532 binding_detail::AutoSequence<ArrayBuffer> &arr = arg0;
16533 JS::Rooted<JS::Value> temp(cx);
16534 while (true) {
16535 bool done;
16536 if (!iter.next(&temp, &done)) {
16537 return false;
16538 }
16539 if (done) {
16540 break;
16541 }
16542 ArrayBuffer* slotPtr = arr.AppendElement(mozilla::fallible);
16543 if (!slotPtr) {
16544 JS_ReportOutOfMemory(cx);
16545 return false;
16546 }
16547 ArrayBuffer& slot = *slotPtr;
16548 if (temp.isObject()) {
16549 if (!slot.Init(&temp.toObject())) {
16550 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBuffer");
16551 return false;
16552 }
16553 if (JS::IsSharedArrayBufferObject(slot.Obj())) {
16554 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1");
16555 return false;
16556 }
16557 if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) {
16558 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1");
16559 return false;
16560 }
16561 if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) {
16562 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1");
16563 return false;
16564 }
16565 if (JS::IsImmutableArrayBufferMaybeShared(slot.Obj())) {
16566 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Element of argument 1");
16567 return false;
16568 }
16569 } else {
16570 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
16571 return false;
16572 }
16573 }
16574 } else {
16575 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16576 return false;
16577 }
16578 if (objIsXray) {
16579 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16580 // we know Xrays have no dynamic unwrap behavior.
16581 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16582 if (!unwrappedObj.ref()) {
16583 return false;
16584 }
16585 }
16586 FastErrorResult rv;
16587 // NOTE: This assert does NOT call the function.
16588 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");
16589 MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16590 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers"
)), 0))
) {
16591 return false;
16592 }
16593 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16593); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16593); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16594 args.rval().setUndefined();
16595 return true;
16596}
16597
16598static const JSJitInfo passSequenceOfArrayBuffers_methodinfo = {
16599 { (JSJitGetterOp)passSequenceOfArrayBuffers },
16600 { prototypes::id::TestJSImplInterface },
16601 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16602 JSJitInfo::Method,
16603 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16604 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16605 false, /* isInfallible. False in setters. */
16606 false, /* isMovable. Not relevant for setters. */
16607 false, /* isEliminatable. Not relevant for setters. */
16608 false, /* isAlwaysInSlot. Only relevant for getters. */
16609 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16610 false, /* isTypedMethod. Only relevant for methods. */
16611 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16612};
16613
16614MOZ_CAN_RUN_SCRIPT static bool
16615passSequenceOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16616{
16617 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableArrayBuffers");
16618 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16621( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16619 "TestJSImplInterface", "passSequenceOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16621( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16620 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16621( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16621 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16621( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16622
16623 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16624 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", 1)) {
16625 return false;
16626 }
16627 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16628 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16629 if (objIsXray) {
16630 unwrappedObj.emplace(cx, obj);
16631 }
16632 binding_detail::AutoSequence<Nullable<ArrayBuffer>> arg0;
16633 SequenceRooter<Nullable<ArrayBuffer>> arg0_holder(cx, &arg0);
16634 if (args[0].isObject()) {
16635 JS::ForOfIterator iter(cx);
16636 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
16637 return false;
16638 }
16639 if (!iter.valueIsIterable()) {
16640 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16641 return false;
16642 }
16643 binding_detail::AutoSequence<Nullable<ArrayBuffer>> &arr = arg0;
16644 JS::Rooted<JS::Value> temp(cx);
16645 while (true) {
16646 bool done;
16647 if (!iter.next(&temp, &done)) {
16648 return false;
16649 }
16650 if (done) {
16651 break;
16652 }
16653 Nullable<ArrayBuffer>* slotPtr = arr.AppendElement(mozilla::fallible);
16654 if (!slotPtr) {
16655 JS_ReportOutOfMemory(cx);
16656 return false;
16657 }
16658 Nullable<ArrayBuffer>& slot = *slotPtr;
16659 if (temp.isObject()) {
16660 if (!slot.SetValue().Init(&temp.toObject())) {
16661 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBufferOrNull");
16662 return false;
16663 }
16664 if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) {
16665 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1");
16666 return false;
16667 }
16668 if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) {
16669 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1");
16670 return false;
16671 }
16672 if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16673 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1");
16674 return false;
16675 }
16676 if (JS::IsImmutableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16677 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Element of argument 1");
16678 return false;
16679 }
16680 } else if (temp.isNullOrUndefined()) {
16681 slot.SetNull();
16682 } else {
16683 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
16684 return false;
16685 }
16686 }
16687 } else {
16688 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16689 return false;
16690 }
16691 if (objIsXray) {
16692 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16693 // we know Xrays have no dynamic unwrap behavior.
16694 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16695 if (!unwrappedObj.ref()) {
16696 return false;
16697 }
16698 }
16699 FastErrorResult rv;
16700 // NOTE: This assert does NOT call the function.
16701 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");
16702 MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16703 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"
)), 0))
) {
16704 return false;
16705 }
16706 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16706); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16706); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16707 args.rval().setUndefined();
16708 return true;
16709}
16710
16711static const JSJitInfo passSequenceOfNullableArrayBuffers_methodinfo = {
16712 { (JSJitGetterOp)passSequenceOfNullableArrayBuffers },
16713 { prototypes::id::TestJSImplInterface },
16714 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16715 JSJitInfo::Method,
16716 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16717 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16718 false, /* isInfallible. False in setters. */
16719 false, /* isMovable. Not relevant for setters. */
16720 false, /* isEliminatable. Not relevant for setters. */
16721 false, /* isAlwaysInSlot. Only relevant for getters. */
16722 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16723 false, /* isTypedMethod. Only relevant for methods. */
16724 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16725};
16726
16727MOZ_CAN_RUN_SCRIPT static bool
16728passRecordOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16729{
16730 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfArrayBuffers");
16731 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16734( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16732 "TestJSImplInterface", "passRecordOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16734( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16733 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16734( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16734 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16734( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16735
16736 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16737 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfArrayBuffers", 1)) {
16738 return false;
16739 }
16740 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16741 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16742 if (objIsXray) {
16743 unwrappedObj.emplace(cx, obj);
16744 }
16745 Record<nsString, ArrayBuffer> arg0;
16746 RecordRooter<nsString, ArrayBuffer> arg0_holder(cx, &arg0);
16747 if (args[0].isObject()) {
16748 auto& recordEntries = arg0.Entries();
16749
16750 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
16751 JS::RootedVector<jsid> ids(cx);
16752 if (!js::GetPropertyKeys(cx, recordObj,
16753 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
16754 return false;
16755 }
16756 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
16757 JS_ReportOutOfMemory(cx);
16758 return false;
16759 }
16760 JS::Rooted<JS::Value> propNameValue(cx);
16761 JS::Rooted<JS::Value> temp(cx);
16762 JS::Rooted<jsid> curId(cx);
16763 JS::Rooted<JS::Value> idVal(cx);
16764 // Use a hashset to keep track of ids seen, to avoid
16765 // introducing nasty O(N^2) behavior scanning for them all the
16766 // time. Ideally we'd use a data structure with O(1) lookup
16767 // _and_ ordering for the MozMap, but we don't have one lying
16768 // around.
16769 nsTHashtable<nsStringHashKey> idsSeen;
16770 for (size_t i = 0; i < ids.length(); ++i) {
16771 curId = ids[i];
16772
16773 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
16774 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
16775 &desc)) {
16776 return false;
16777 }
16778
16779 if (desc.isNothing() || !desc->enumerable()) {
16780 continue;
16781 }
16782
16783 idVal = js::IdToValue(curId);
16784 nsString propName;
16785 // This will just throw if idVal is a Symbol, like the spec says
16786 // to do.
16787 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
16788 return false;
16789 }
16790
16791 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
16792 return false;
16793 }
16794
16795 Record<nsString, ArrayBuffer>::EntryType* entry;
16796 if (!idsSeen.EnsureInserted(propName)) {
16797 // Find the existing entry.
16798 auto idx = recordEntries.IndexOf(propName);
16799 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", 16800); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 16800); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
16800 "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", 16800); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 16800); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
16801 // Now blow it away to make it look like it was just added
16802 // to the array, because it's not obvious that it's
16803 // safe to write to its already-initialized mValue via our
16804 // normal codegen conversions. For example, the value
16805 // could be a union and this would change its type, but
16806 // codegen assumes we won't do that.
16807 entry = recordEntries.ReconstructElementAt(idx);
16808 } else {
16809 // Safe to do an infallible append here, because we did a
16810 // SetCapacity above to the right capacity.
16811 entry = recordEntries.AppendElement();
16812 }
16813 entry->mKey = propName;
16814 ArrayBuffer& slot = entry->mValue;
16815 if (temp.isObject()) {
16816 if (!slot.Init(&temp.toObject())) {
16817 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBuffer");
16818 return false;
16819 }
16820 if (JS::IsSharedArrayBufferObject(slot.Obj())) {
16821 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1");
16822 return false;
16823 }
16824 if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) {
16825 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1");
16826 return false;
16827 }
16828 if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) {
16829 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1");
16830 return false;
16831 }
16832 if (JS::IsImmutableArrayBufferMaybeShared(slot.Obj())) {
16833 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value in argument 1");
16834 return false;
16835 }
16836 } else {
16837 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
16838 return false;
16839 }
16840 }
16841 } else {
16842 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16843 return false;
16844 }
16845 if (objIsXray) {
16846 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16847 // we know Xrays have no dynamic unwrap behavior.
16848 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16849 if (!unwrappedObj.ref()) {
16850 return false;
16851 }
16852 }
16853 FastErrorResult rv;
16854 // NOTE: This assert does NOT call the function.
16855 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");
16856 MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16857 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers"
)), 0))
) {
16858 return false;
16859 }
16860 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16860); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 16860); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
16861 args.rval().setUndefined();
16862 return true;
16863}
16864
16865static const JSJitInfo passRecordOfArrayBuffers_methodinfo = {
16866 { (JSJitGetterOp)passRecordOfArrayBuffers },
16867 { prototypes::id::TestJSImplInterface },
16868 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16869 JSJitInfo::Method,
16870 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16871 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16872 false, /* isInfallible. False in setters. */
16873 false, /* isMovable. Not relevant for setters. */
16874 false, /* isEliminatable. Not relevant for setters. */
16875 false, /* isAlwaysInSlot. Only relevant for getters. */
16876 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16877 false, /* isTypedMethod. Only relevant for methods. */
16878 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16879};
16880
16881MOZ_CAN_RUN_SCRIPT static bool
16882passRecordOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16883{
16884 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableArrayBuffers");
16885 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16888( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16886 "TestJSImplInterface", "passRecordOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16888( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16887 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16888( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16888 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16888( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16889
16890 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16891 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers", 1)) {
16892 return false;
16893 }
16894 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16895 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16896 if (objIsXray) {
16897 unwrappedObj.emplace(cx, obj);
16898 }
16899 Record<nsString, Nullable<ArrayBuffer>> arg0;
16900 RecordRooter<nsString, Nullable<ArrayBuffer>> arg0_holder(cx, &arg0);
16901 if (args[0].isObject()) {
16902 auto& recordEntries = arg0.Entries();
16903
16904 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
16905 JS::RootedVector<jsid> ids(cx);
16906 if (!js::GetPropertyKeys(cx, recordObj,
16907 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
16908 return false;
16909 }
16910 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
16911 JS_ReportOutOfMemory(cx);
16912 return false;
16913 }
16914 JS::Rooted<JS::Value> propNameValue(cx);
16915 JS::Rooted<JS::Value> temp(cx);
16916 JS::Rooted<jsid> curId(cx);
16917 JS::Rooted<JS::Value> idVal(cx);
16918 // Use a hashset to keep track of ids seen, to avoid
16919 // introducing nasty O(N^2) behavior scanning for them all the
16920 // time. Ideally we'd use a data structure with O(1) lookup
16921 // _and_ ordering for the MozMap, but we don't have one lying
16922 // around.
16923 nsTHashtable<nsStringHashKey> idsSeen;
16924 for (size_t i = 0; i < ids.length(); ++i) {
16925 curId = ids[i];
16926
16927 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
16928 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
16929 &desc)) {
16930 return false;
16931 }
16932
16933 if (desc.isNothing() || !desc->enumerable()) {
16934 continue;
16935 }
16936
16937 idVal = js::IdToValue(curId);
16938 nsString propName;
16939 // This will just throw if idVal is a Symbol, like the spec says
16940 // to do.
16941 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
16942 return false;
16943 }
16944
16945 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
16946 return false;
16947 }
16948
16949 Record<nsString, Nullable<ArrayBuffer>>::EntryType* entry;
16950 if (!idsSeen.EnsureInserted(propName)) {
16951 // Find the existing entry.
16952 auto idx = recordEntries.IndexOf(propName);
16953 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", 16954); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 16954); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
16954 "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", 16954); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 16954); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
16955 // Now blow it away to make it look like it was just added
16956 // to the array, because it's not obvious that it's
16957 // safe to write to its already-initialized mValue via our
16958 // normal codegen conversions. For example, the value
16959 // could be a union and this would change its type, but
16960 // codegen assumes we won't do that.
16961 entry = recordEntries.ReconstructElementAt(idx);
16962 } else {
16963 // Safe to do an infallible append here, because we did a
16964 // SetCapacity above to the right capacity.
16965 entry = recordEntries.AppendElement();
16966 }
16967 entry->mKey = propName;
16968 Nullable<ArrayBuffer>& slot = entry->mValue;
16969 if (temp.isObject()) {
16970 if (!slot.SetValue().Init(&temp.toObject())) {
16971 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBufferOrNull");
16972 return false;
16973 }
16974 if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) {
16975 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1");
16976 return false;
16977 }
16978 if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) {
16979 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1");
16980 return false;
16981 }
16982 if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16983 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1");
16984 return false;
16985 }
16986 if (JS::IsImmutableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16987 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value in argument 1");
16988 return false;
16989 }
16990 } else if (temp.isNullOrUndefined()) {
16991 slot.SetNull();
16992 } else {
16993 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
16994 return false;
16995 }
16996 }
16997 } else {
16998 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16999 return false;
17000 }
17001 if (objIsXray) {
17002 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17003 // we know Xrays have no dynamic unwrap behavior.
17004 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17005 if (!unwrappedObj.ref()) {
17006 return false;
17007 }
17008 }
17009 FastErrorResult rv;
17010 // NOTE: This assert does NOT call the function.
17011 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");
17012 MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17013 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers"
)), 0))
) {
17014 return false;
17015 }
17016 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17016); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17016); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17017 args.rval().setUndefined();
17018 return true;
17019}
17020
17021static const JSJitInfo passRecordOfNullableArrayBuffers_methodinfo = {
17022 { (JSJitGetterOp)passRecordOfNullableArrayBuffers },
17023 { prototypes::id::TestJSImplInterface },
17024 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17025 JSJitInfo::Method,
17026 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17027 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17028 false, /* isInfallible. False in setters. */
17029 false, /* isMovable. Not relevant for setters. */
17030 false, /* isEliminatable. Not relevant for setters. */
17031 false, /* isAlwaysInSlot. Only relevant for getters. */
17032 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17033 false, /* isTypedMethod. Only relevant for methods. */
17034 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17035};
17036
17037MOZ_CAN_RUN_SCRIPT static bool
17038passVariadicTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17039{
17040 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicTypedArray");
17041 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17044( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17042 "TestJSImplInterface", "passVariadicTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17044( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17043 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17044( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17044 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17044( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17045
17046 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17047 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17048 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17049 if (objIsXray) {
17050 unwrappedObj.emplace(cx, obj);
17051 }
17052 AutoSequence<Float32Array> arg0;
17053 SequenceRooter<Float32Array> arg0_holder(cx, &arg0);
17054 if (args.length() > 0) {
17055 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
17056 JS_ReportOutOfMemory(cx);
17057 return false;
17058 }
17059 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
17060 // OK to do infallible append here, since we ensured capacity already.
17061 Float32Array& slot = *arg0.AppendElement();
17062 if (args[variadicArg].isObject()) {
17063 if (!slot.Init(&args[variadicArg].toObject())) {
17064 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array");
17065 return false;
17066 }
17067 if (JS::IsArrayBufferViewShared(slot.Obj())) {
17068 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
17069 return false;
17070 }
17071 if (JS::IsLargeArrayBufferView(slot.Obj())) {
17072 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
17073 return false;
17074 }
17075 if (JS::IsResizableArrayBufferView(slot.Obj())) {
17076 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
17077 return false;
17078 }
17079 if (JS::IsImmutableArrayBufferView(slot.Obj())) {
17080 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
17081 return false;
17082 }
17083 } else {
17084 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
17085 return false;
17086 }
17087 }
17088 }
17089 if (objIsXray) {
17090 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17091 // we know Xrays have no dynamic unwrap behavior.
17092 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17093 if (!unwrappedObj.ref()) {
17094 return false;
17095 }
17096 }
17097 FastErrorResult rv;
17098 // NOTE: This assert does NOT call the function.
17099 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");
17100 MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17101 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray"
)), 0))
) {
17102 return false;
17103 }
17104 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17104); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17104); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17105 args.rval().setUndefined();
17106 return true;
17107}
17108
17109static const JSJitInfo passVariadicTypedArray_methodinfo = {
17110 { (JSJitGetterOp)passVariadicTypedArray },
17111 { prototypes::id::TestJSImplInterface },
17112 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17113 JSJitInfo::Method,
17114 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17115 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17116 false, /* isInfallible. False in setters. */
17117 false, /* isMovable. Not relevant for setters. */
17118 false, /* isEliminatable. Not relevant for setters. */
17119 false, /* isAlwaysInSlot. Only relevant for getters. */
17120 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17121 false, /* isTypedMethod. Only relevant for methods. */
17122 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17123};
17124
17125MOZ_CAN_RUN_SCRIPT static bool
17126passVariadicNullableTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17127{
17128 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableTypedArray");
17129 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17132( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17130 "TestJSImplInterface", "passVariadicNullableTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17132( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17131 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17132( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", 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::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17132( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17133
17134 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17135 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17136 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17137 if (objIsXray) {
17138 unwrappedObj.emplace(cx, obj);
17139 }
17140 AutoSequence<Nullable<Float32Array>> arg0;
17141 SequenceRooter<Nullable<Float32Array>> arg0_holder(cx, &arg0);
17142 if (args.length() > 0) {
17143 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
17144 JS_ReportOutOfMemory(cx);
17145 return false;
17146 }
17147 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
17148 // OK to do infallible append here, since we ensured capacity already.
17149 Nullable<Float32Array>& slot = *arg0.AppendElement();
17150 if (args[variadicArg].isObject()) {
17151 if (!slot.SetValue().Init(&args[variadicArg].toObject())) {
17152 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32ArrayOrNull");
17153 return false;
17154 }
17155 if (JS::IsArrayBufferViewShared(slot.SetValue().Obj())) {
17156 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
17157 return false;
17158 }
17159 if (JS::IsLargeArrayBufferView(slot.SetValue().Obj())) {
17160 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
17161 return false;
17162 }
17163 if (JS::IsResizableArrayBufferView(slot.SetValue().Obj())) {
17164 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
17165 return false;
17166 }
17167 if (JS::IsImmutableArrayBufferView(slot.SetValue().Obj())) {
17168 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
17169 return false;
17170 }
17171 } else if (args[variadicArg].isNullOrUndefined()) {
17172 slot.SetNull();
17173 } else {
17174 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
17175 return false;
17176 }
17177 }
17178 }
17179 if (objIsXray) {
17180 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17181 // we know Xrays have no dynamic unwrap behavior.
17182 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17183 if (!unwrappedObj.ref()) {
17184 return false;
17185 }
17186 }
17187 FastErrorResult rv;
17188 // NOTE: This assert does NOT call the function.
17189 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");
17190 MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17191 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray"
)), 0))
) {
17192 return false;
17193 }
17194 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17194); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17194); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17195 args.rval().setUndefined();
17196 return true;
17197}
17198
17199static const JSJitInfo passVariadicNullableTypedArray_methodinfo = {
17200 { (JSJitGetterOp)passVariadicNullableTypedArray },
17201 { prototypes::id::TestJSImplInterface },
17202 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17203 JSJitInfo::Method,
17204 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17205 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17206 false, /* isInfallible. False in setters. */
17207 false, /* isMovable. Not relevant for setters. */
17208 false, /* isEliminatable. Not relevant for setters. */
17209 false, /* isAlwaysInSlot. Only relevant for getters. */
17210 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17211 false, /* isTypedMethod. Only relevant for methods. */
17212 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17213};
17214
17215MOZ_CAN_RUN_SCRIPT static bool
17216receiveUint8Array(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17217{
17218 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17221( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17219 "TestJSImplInterface", "receiveUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17221( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17220 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17221( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17221 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17221( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17222
17223 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17224 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17225 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17226 if (objIsXray) {
17227 unwrappedObj.emplace(cx, obj);
17228 }
17229 if (objIsXray) {
17230 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17231 // we know Xrays have no dynamic unwrap behavior.
17232 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17233 if (!unwrappedObj.ref()) {
17234 return false;
17235 }
17236 }
17237 FastErrorResult rv;
17238 JS::Rooted<JSObject*> result(cx);
17239 // NOTE: This assert does NOT call the function.
17240 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");
17241 MOZ_KnownLive(self)(self)->ReceiveUint8Array(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17242 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array"
)), 0))
) {
17243 return false;
17244 }
17245 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17245); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17245); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17246 JS::ExposeObjectToActiveJS(result);
17247 args.rval().setObject(*result);
17248 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
17249 return false;
17250 }
17251 return true;
17252}
17253
17254static const JSJitInfo receiveUint8Array_methodinfo = {
17255 { (JSJitGetterOp)receiveUint8Array },
17256 { prototypes::id::TestJSImplInterface },
17257 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17258 JSJitInfo::Method,
17259 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17260 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
17261 false, /* isInfallible. False in setters. */
17262 false, /* isMovable. Not relevant for setters. */
17263 false, /* isEliminatable. Not relevant for setters. */
17264 false, /* isAlwaysInSlot. Only relevant for getters. */
17265 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17266 false, /* isTypedMethod. Only relevant for methods. */
17267 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17268};
17269
17270MOZ_CAN_RUN_SCRIPT static bool
17271get_uint8ArrayAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
17272{
17273 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17276( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17274 "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17276( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17275 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17276( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17276 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17276( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17277
17278 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17279 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17280 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17281 if (objIsXray) {
17282 unwrappedObj.emplace(cx, obj);
17283 }
17284 if (objIsXray) {
17285 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17286 // we know Xrays have no dynamic unwrap behavior.
17287 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17288 if (!unwrappedObj.ref()) {
17289 return false;
17290 }
17291 }
17292 FastErrorResult rv;
17293 JS::Rooted<JSObject*> result(cx);
17294 // NOTE: This assert does NOT call the function.
17295 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");
17296 MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17297 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter"
)), 0))
) {
17298 return false;
17299 }
17300 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17300); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17300); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17301 JS::ExposeObjectToActiveJS(result);
17302 args.rval().setObject(*result);
17303 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
17304 return false;
17305 }
17306 return true;
17307}
17308
17309MOZ_CAN_RUN_SCRIPT static bool
17310set_uint8ArrayAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
17311{
17312 BindingCallContext cx(cx_, "TestJSImplInterface.uint8ArrayAttr setter");
17313 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17316( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17314 "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17316( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17315 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject17316( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17316 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17316( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17317
17318 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17319 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17320 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17321 if (objIsXray) {
17322 unwrappedObj.emplace(cx, obj);
17323 }
17324 RootedSpiderMonkeyInterface<Uint8Array> arg0(cx);
17325 if (args[0].isObject()) {
17326 if (!arg0.Init(&args[0].toObject())) {
17327 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "Uint8Array");
17328 return false;
17329 }
17330 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
17331 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value being assigned");
17332 return false;
17333 }
17334 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
17335 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
17336 return false;
17337 }
17338 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
17339 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
17340 return false;
17341 }
17342 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
17343 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
17344 return false;
17345 }
17346 } else {
17347 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
17348 return false;
17349 }
17350 if (objIsXray) {
17351 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17352 // we know Xrays have no dynamic unwrap behavior.
17353 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17354 if (!unwrappedObj.ref()) {
17355 return false;
17356 }
17357 }
17358 FastErrorResult rv;
17359 // NOTE: This assert does NOT call the function.
17360 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");
17361 MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17362 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter"
)), 0))
) {
17363 return false;
17364 }
17365 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17365); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17365); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17366
17367 return true;
17368}
17369
17370static const JSJitInfo uint8ArrayAttr_getterinfo = {
17371 { get_uint8ArrayAttr },
17372 { prototypes::id::TestJSImplInterface },
17373 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17374 JSJitInfo::Getter,
17375 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17376 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
17377 false, /* isInfallible. False in setters. */
17378 false, /* isMovable. Not relevant for setters. */
17379 false, /* isEliminatable. Not relevant for setters. */
17380 false, /* isAlwaysInSlot. Only relevant for getters. */
17381 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17382 false, /* isTypedMethod. Only relevant for methods. */
17383 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17384};
17385static const JSJitInfo uint8ArrayAttr_setterinfo = {
17386 { (JSJitGetterOp)set_uint8ArrayAttr },
17387 { prototypes::id::TestJSImplInterface },
17388 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17389 JSJitInfo::Setter,
17390 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17391 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17392 false, /* isInfallible. False in setters. */
17393 false, /* isMovable. Not relevant for setters. */
17394 false, /* isEliminatable. Not relevant for setters. */
17395 false, /* isAlwaysInSlot. Only relevant for getters. */
17396 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17397 false, /* isTypedMethod. Only relevant for methods. */
17398 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17399};
17400
17401MOZ_CAN_RUN_SCRIPT static bool
17402passString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17403{
17404 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17407( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17405 "TestJSImplInterface", "passString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17407( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17406 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17407( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17407 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17407( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17408
17409 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17410 if (!args.requireAtLeast(cx, "TestJSImplInterface.passString", 1)) {
17411 return false;
17412 }
17413 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17414 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17415 if (objIsXray) {
17416 unwrappedObj.emplace(cx, obj);
17417 }
17418 binding_detail::FakeString<char16_t> arg0;
17419 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
17420 return false;
17421 }
17422 if (objIsXray) {
17423 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17424 // we know Xrays have no dynamic unwrap behavior.
17425 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17426 if (!unwrappedObj.ref()) {
17427 return false;
17428 }
17429 }
17430 FastErrorResult rv;
17431 // NOTE: This assert does NOT call the function.
17432 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");
17433 MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17434 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString"
)), 0))
) {
17435 return false;
17436 }
17437 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17437); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17438 args.rval().setUndefined();
17439 return true;
17440}
17441
17442static const JSJitInfo passString_methodinfo = {
17443 { (JSJitGetterOp)passString },
17444 { prototypes::id::TestJSImplInterface },
17445 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17446 JSJitInfo::Method,
17447 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17448 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17449 false, /* isInfallible. False in setters. */
17450 false, /* isMovable. Not relevant for setters. */
17451 false, /* isEliminatable. Not relevant for setters. */
17452 false, /* isAlwaysInSlot. Only relevant for getters. */
17453 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17454 false, /* isTypedMethod. Only relevant for methods. */
17455 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17456};
17457
17458MOZ_CAN_RUN_SCRIPT static bool
17459passNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17460{
17461 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17464( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17462 "TestJSImplInterface", "passNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17464( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17463 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17464( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17464 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17464( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17465
17466 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17467 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableString", 1)) {
17468 return false;
17469 }
17470 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17471 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17472 if (objIsXray) {
17473 unwrappedObj.emplace(cx, obj);
17474 }
17475 binding_detail::FakeString<char16_t> arg0;
17476 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
17477 return false;
17478 }
17479 if (objIsXray) {
17480 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17481 // we know Xrays have no dynamic unwrap behavior.
17482 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17483 if (!unwrappedObj.ref()) {
17484 return false;
17485 }
17486 }
17487 FastErrorResult rv;
17488 // NOTE: This assert does NOT call the function.
17489 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");
17490 MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17491 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString"
)), 0))
) {
17492 return false;
17493 }
17494 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17494); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17494); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17495 args.rval().setUndefined();
17496 return true;
17497}
17498
17499static const JSJitInfo passNullableString_methodinfo = {
17500 { (JSJitGetterOp)passNullableString },
17501 { prototypes::id::TestJSImplInterface },
17502 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17503 JSJitInfo::Method,
17504 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17505 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17506 false, /* isInfallible. False in setters. */
17507 false, /* isMovable. Not relevant for setters. */
17508 false, /* isEliminatable. Not relevant for setters. */
17509 false, /* isAlwaysInSlot. Only relevant for getters. */
17510 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17511 false, /* isTypedMethod. Only relevant for methods. */
17512 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17513};
17514
17515MOZ_CAN_RUN_SCRIPT static bool
17516passOptionalString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17517{
17518 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17521( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17519 "TestJSImplInterface", "passOptionalString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17521( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17520 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17521( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17521 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17521( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17522
17523 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17524 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17525 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17526 if (objIsXray) {
17527 unwrappedObj.emplace(cx, obj);
17528 }
17529 Optional<nsAString> arg0;
17530 binding_detail::FakeString<char16_t> arg0_holder;
17531 if (args.hasDefined(0)) {
17532 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
17533 return false;
17534 }
17535 arg0 = &arg0_holder;
17536 }
17537 if (objIsXray) {
17538 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17539 // we know Xrays have no dynamic unwrap behavior.
17540 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17541 if (!unwrappedObj.ref()) {
17542 return false;
17543 }
17544 }
17545 FastErrorResult rv;
17546 // NOTE: This assert does NOT call the function.
17547 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");
17548 MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17549 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString"
)), 0))
) {
17550 return false;
17551 }
17552 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17552); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17553 args.rval().setUndefined();
17554 return true;
17555}
17556
17557static const JSJitInfo passOptionalString_methodinfo = {
17558 { (JSJitGetterOp)passOptionalString },
17559 { prototypes::id::TestJSImplInterface },
17560 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17561 JSJitInfo::Method,
17562 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17563 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17564 false, /* isInfallible. False in setters. */
17565 false, /* isMovable. Not relevant for setters. */
17566 false, /* isEliminatable. Not relevant for setters. */
17567 false, /* isAlwaysInSlot. Only relevant for getters. */
17568 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17569 false, /* isTypedMethod. Only relevant for methods. */
17570 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17571};
17572
17573MOZ_CAN_RUN_SCRIPT static bool
17574passOptionalStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17575{
17576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17579( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17577 "TestJSImplInterface", "passOptionalStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17579( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17579( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17579( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17580
17581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17584 if (objIsXray) {
17585 unwrappedObj.emplace(cx, obj);
17586 }
17587 binding_detail::FakeString<char16_t> arg0;
17588 if (args.hasDefined(0)) {
17589 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
17590 return false;
17591 }
17592 } else {
17593 arg0.AssignLiteral(u"abc");
17594 }
17595 if (objIsXray) {
17596 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17597 // we know Xrays have no dynamic unwrap behavior.
17598 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17599 if (!unwrappedObj.ref()) {
17600 return false;
17601 }
17602 }
17603 FastErrorResult rv;
17604 // NOTE: This assert does NOT call the function.
17605 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");
17606 MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17607 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue"
)), 0))
) {
17608 return false;
17609 }
17610 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17610); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17610); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17611 args.rval().setUndefined();
17612 return true;
17613}
17614
17615static const JSJitInfo passOptionalStringWithDefaultValue_methodinfo = {
17616 { (JSJitGetterOp)passOptionalStringWithDefaultValue },
17617 { prototypes::id::TestJSImplInterface },
17618 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17619 JSJitInfo::Method,
17620 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17621 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17622 false, /* isInfallible. False in setters. */
17623 false, /* isMovable. Not relevant for setters. */
17624 false, /* isEliminatable. Not relevant for setters. */
17625 false, /* isAlwaysInSlot. Only relevant for getters. */
17626 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17627 false, /* isTypedMethod. Only relevant for methods. */
17628 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17629};
17630
17631MOZ_CAN_RUN_SCRIPT static bool
17632passOptionalNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17633{
17634 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17637( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17635 "TestJSImplInterface", "passOptionalNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17637( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17636 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17637( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17637 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17637( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17638
17639 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17640 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17641 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17642 if (objIsXray) {
17643 unwrappedObj.emplace(cx, obj);
17644 }
17645 Optional<nsAString> arg0;
17646 binding_detail::FakeString<char16_t> arg0_holder;
17647 if (args.hasDefined(0)) {
17648 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
17649 return false;
17650 }
17651 arg0 = &arg0_holder;
17652 }
17653 if (objIsXray) {
17654 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17655 // we know Xrays have no dynamic unwrap behavior.
17656 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17657 if (!unwrappedObj.ref()) {
17658 return false;
17659 }
17660 }
17661 FastErrorResult rv;
17662 // NOTE: This assert does NOT call the function.
17663 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");
17664 MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17665 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString"
)), 0))
) {
17666 return false;
17667 }
17668 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17668); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17668); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17669 args.rval().setUndefined();
17670 return true;
17671}
17672
17673static const JSJitInfo passOptionalNullableString_methodinfo = {
17674 { (JSJitGetterOp)passOptionalNullableString },
17675 { prototypes::id::TestJSImplInterface },
17676 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17677 JSJitInfo::Method,
17678 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17679 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17680 false, /* isInfallible. False in setters. */
17681 false, /* isMovable. Not relevant for setters. */
17682 false, /* isEliminatable. Not relevant for setters. */
17683 false, /* isAlwaysInSlot. Only relevant for getters. */
17684 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17685 false, /* isTypedMethod. Only relevant for methods. */
17686 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17687};
17688
17689MOZ_CAN_RUN_SCRIPT static bool
17690passOptionalNullableStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17691{
17692 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17695( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17693 "TestJSImplInterface", "passOptionalNullableStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17695( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17694 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17695( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17695 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17695( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17696
17697 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17698 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17699 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17700 if (objIsXray) {
17701 unwrappedObj.emplace(cx, obj);
17702 }
17703 binding_detail::FakeString<char16_t> arg0;
17704 if (args.hasDefined(0)) {
17705 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
17706 return false;
17707 }
17708 } else {
17709 arg0.SetIsVoid(true);
17710 }
17711 if (objIsXray) {
17712 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17713 // we know Xrays have no dynamic unwrap behavior.
17714 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17715 if (!unwrappedObj.ref()) {
17716 return false;
17717 }
17718 }
17719 FastErrorResult rv;
17720 // NOTE: This assert does NOT call the function.
17721 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");
17722 MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17723 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue"
)), 0))
) {
17724 return false;
17725 }
17726 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17726); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17726); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17727 args.rval().setUndefined();
17728 return true;
17729}
17730
17731static const JSJitInfo passOptionalNullableStringWithDefaultValue_methodinfo = {
17732 { (JSJitGetterOp)passOptionalNullableStringWithDefaultValue },
17733 { prototypes::id::TestJSImplInterface },
17734 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17735 JSJitInfo::Method,
17736 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17737 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17738 false, /* isInfallible. False in setters. */
17739 false, /* isMovable. Not relevant for setters. */
17740 false, /* isEliminatable. Not relevant for setters. */
17741 false, /* isAlwaysInSlot. Only relevant for getters. */
17742 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17743 false, /* isTypedMethod. Only relevant for methods. */
17744 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17745};
17746
17747MOZ_CAN_RUN_SCRIPT static bool
17748passVariadicString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17749{
17750 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17753( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17751 "TestJSImplInterface", "passVariadicString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17753( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17752 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17753( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17753 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17753( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17754
17755 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17756 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17757 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17758 if (objIsXray) {
17759 unwrappedObj.emplace(cx, obj);
17760 }
17761 AutoSequence<nsString> arg0;
17762 if (args.length() > 0) {
17763 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
17764 JS_ReportOutOfMemory(cx);
17765 return false;
17766 }
17767 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
17768 // OK to do infallible append here, since we ensured capacity already.
17769 nsString& slot = *arg0.AppendElement();
17770 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
17771 return false;
17772 }
17773 }
17774 }
17775 if (objIsXray) {
17776 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17777 // we know Xrays have no dynamic unwrap behavior.
17778 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17779 if (!unwrappedObj.ref()) {
17780 return false;
17781 }
17782 }
17783 FastErrorResult rv;
17784 // NOTE: This assert does NOT call the function.
17785 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");
17786 MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17787 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString"
)), 0))
) {
17788 return false;
17789 }
17790 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17790); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17790); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17791 args.rval().setUndefined();
17792 return true;
17793}
17794
17795static const JSJitInfo passVariadicString_methodinfo = {
17796 { (JSJitGetterOp)passVariadicString },
17797 { prototypes::id::TestJSImplInterface },
17798 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17799 JSJitInfo::Method,
17800 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17801 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17802 false, /* isInfallible. False in setters. */
17803 false, /* isMovable. Not relevant for setters. */
17804 false, /* isEliminatable. Not relevant for setters. */
17805 false, /* isAlwaysInSlot. Only relevant for getters. */
17806 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17807 false, /* isTypedMethod. Only relevant for methods. */
17808 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17809};
17810
17811MOZ_CAN_RUN_SCRIPT static bool
17812passByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17813{
17814 BindingCallContext cx(cx_, "TestJSImplInterface.passByteString");
17815 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17816 "TestJSImplInterface", "passByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17817 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17818 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17818( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17819
17820 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17821 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByteString", 1)) {
17822 return false;
17823 }
17824 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17825 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17826 if (objIsXray) {
17827 unwrappedObj.emplace(cx, obj);
17828 }
17829 nsCString arg0;
17830 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
17831 return false;
17832 }
17833 if (objIsXray) {
17834 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17835 // we know Xrays have no dynamic unwrap behavior.
17836 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17837 if (!unwrappedObj.ref()) {
17838 return false;
17839 }
17840 }
17841 FastErrorResult rv;
17842 // NOTE: This assert does NOT call the function.
17843 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");
17844 MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17845 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString"
)), 0))
) {
17846 return false;
17847 }
17848 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17848); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17848); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17849 args.rval().setUndefined();
17850 return true;
17851}
17852
17853static const JSJitInfo passByteString_methodinfo = {
17854 { (JSJitGetterOp)passByteString },
17855 { prototypes::id::TestJSImplInterface },
17856 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17857 JSJitInfo::Method,
17858 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17859 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17860 false, /* isInfallible. False in setters. */
17861 false, /* isMovable. Not relevant for setters. */
17862 false, /* isEliminatable. Not relevant for setters. */
17863 false, /* isAlwaysInSlot. Only relevant for getters. */
17864 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17865 false, /* isTypedMethod. Only relevant for methods. */
17866 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17867};
17868
17869MOZ_CAN_RUN_SCRIPT static bool
17870passNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17871{
17872 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableByteString");
17873 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17876( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17874 "TestJSImplInterface", "passNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17876( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17875 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17876( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17876 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17876( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17877
17878 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17879 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByteString", 1)) {
17880 return false;
17881 }
17882 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17883 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17884 if (objIsXray) {
17885 unwrappedObj.emplace(cx, obj);
17886 }
17887 nsCString arg0;
17888 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) {
17889 return false;
17890 }
17891 if (objIsXray) {
17892 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17893 // we know Xrays have no dynamic unwrap behavior.
17894 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17895 if (!unwrappedObj.ref()) {
17896 return false;
17897 }
17898 }
17899 FastErrorResult rv;
17900 // NOTE: This assert does NOT call the function.
17901 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");
17902 MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17903 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString"
)), 0))
) {
17904 return false;
17905 }
17906 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17906); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17906); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17907 args.rval().setUndefined();
17908 return true;
17909}
17910
17911static const JSJitInfo passNullableByteString_methodinfo = {
17912 { (JSJitGetterOp)passNullableByteString },
17913 { prototypes::id::TestJSImplInterface },
17914 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17915 JSJitInfo::Method,
17916 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17917 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17918 false, /* isInfallible. False in setters. */
17919 false, /* isMovable. Not relevant for setters. */
17920 false, /* isEliminatable. Not relevant for setters. */
17921 false, /* isAlwaysInSlot. Only relevant for getters. */
17922 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17923 false, /* isTypedMethod. Only relevant for methods. */
17924 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17925};
17926
17927MOZ_CAN_RUN_SCRIPT static bool
17928passOptionalByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17929{
17930 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteString");
17931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17934( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17932 "TestJSImplInterface", "passOptionalByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17934( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17934( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17934( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17935
17936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17939 if (objIsXray) {
17940 unwrappedObj.emplace(cx, obj);
17941 }
17942 Optional<nsCString> arg0;
17943 if (args.hasDefined(0)) {
17944 arg0.Construct();
17945 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0.Value())) {
17946 return false;
17947 }
17948 }
17949 if (objIsXray) {
17950 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17951 // we know Xrays have no dynamic unwrap behavior.
17952 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17953 if (!unwrappedObj.ref()) {
17954 return false;
17955 }
17956 }
17957 FastErrorResult rv;
17958 // NOTE: This assert does NOT call the function.
17959 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");
17960 MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17961 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString"
)), 0))
) {
17962 return false;
17963 }
17964 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17964); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 17964); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
17965 args.rval().setUndefined();
17966 return true;
17967}
17968
17969static const JSJitInfo passOptionalByteString_methodinfo = {
17970 { (JSJitGetterOp)passOptionalByteString },
17971 { prototypes::id::TestJSImplInterface },
17972 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17973 JSJitInfo::Method,
17974 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17975 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17976 false, /* isInfallible. False in setters. */
17977 false, /* isMovable. Not relevant for setters. */
17978 false, /* isEliminatable. Not relevant for setters. */
17979 false, /* isAlwaysInSlot. Only relevant for getters. */
17980 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17981 false, /* isTypedMethod. Only relevant for methods. */
17982 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17983};
17984
17985MOZ_CAN_RUN_SCRIPT static bool
17986passOptionalByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17987{
17988 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteStringWithDefaultValue");
17989 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17992( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17990 "TestJSImplInterface", "passOptionalByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17992( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17991 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17992( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17992 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17992( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17993
17994 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17995 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17996 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17997 if (objIsXray) {
17998 unwrappedObj.emplace(cx, obj);
17999 }
18000 nsCString arg0;
18001 if (args.hasDefined(0)) {
18002 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
18003 return false;
18004 }
18005 } else {
18006 arg0.AssignLiteral("abc");
18007 }
18008 if (objIsXray) {
18009 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18010 // we know Xrays have no dynamic unwrap behavior.
18011 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18012 if (!unwrappedObj.ref()) {
18013 return false;
18014 }
18015 }
18016 FastErrorResult rv;
18017 // NOTE: This assert does NOT call the function.
18018 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");
18019 MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18020 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"
)), 0))
) {
18021 return false;
18022 }
18023 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18023); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18023); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18024 args.rval().setUndefined();
18025 return true;
18026}
18027
18028static const JSJitInfo passOptionalByteStringWithDefaultValue_methodinfo = {
18029 { (JSJitGetterOp)passOptionalByteStringWithDefaultValue },
18030 { prototypes::id::TestJSImplInterface },
18031 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18032 JSJitInfo::Method,
18033 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18034 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18035 false, /* isInfallible. False in setters. */
18036 false, /* isMovable. Not relevant for setters. */
18037 false, /* isEliminatable. Not relevant for setters. */
18038 false, /* isAlwaysInSlot. Only relevant for getters. */
18039 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18040 false, /* isTypedMethod. Only relevant for methods. */
18041 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18042};
18043
18044MOZ_CAN_RUN_SCRIPT static bool
18045passOptionalNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18046{
18047 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteString");
18048 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18051( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18049 "TestJSImplInterface", "passOptionalNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18051( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18050 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18051( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18051 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18051( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18052
18053 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18054 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18055 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18056 if (objIsXray) {
18057 unwrappedObj.emplace(cx, obj);
18058 }
18059 Optional<nsCString> arg0;
18060 if (args.hasDefined(0)) {
18061 arg0.Construct();
18062 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0.Value())) {
18063 return false;
18064 }
18065 }
18066 if (objIsXray) {
18067 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18068 // we know Xrays have no dynamic unwrap behavior.
18069 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18070 if (!unwrappedObj.ref()) {
18071 return false;
18072 }
18073 }
18074 FastErrorResult rv;
18075 // NOTE: This assert does NOT call the function.
18076 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");
18077 MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18078 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString"
)), 0))
) {
18079 return false;
18080 }
18081 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18081); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18081); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18082 args.rval().setUndefined();
18083 return true;
18084}
18085
18086static const JSJitInfo passOptionalNullableByteString_methodinfo = {
18087 { (JSJitGetterOp)passOptionalNullableByteString },
18088 { prototypes::id::TestJSImplInterface },
18089 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18090 JSJitInfo::Method,
18091 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18092 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18093 false, /* isInfallible. False in setters. */
18094 false, /* isMovable. Not relevant for setters. */
18095 false, /* isEliminatable. Not relevant for setters. */
18096 false, /* isAlwaysInSlot. Only relevant for getters. */
18097 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18098 false, /* isTypedMethod. Only relevant for methods. */
18099 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18100};
18101
18102MOZ_CAN_RUN_SCRIPT static bool
18103passOptionalNullableByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18104{
18105 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue");
18106 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18109( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18107 "TestJSImplInterface", "passOptionalNullableByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18109( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18108 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18109( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18109 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18109( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18110
18111 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18112 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18113 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18114 if (objIsXray) {
18115 unwrappedObj.emplace(cx, obj);
18116 }
18117 nsCString arg0;
18118 if (args.hasDefined(0)) {
18119 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) {
18120 return false;
18121 }
18122 } else {
18123 arg0.SetIsVoid(true);
18124 }
18125 if (objIsXray) {
18126 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18127 // we know Xrays have no dynamic unwrap behavior.
18128 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18129 if (!unwrappedObj.ref()) {
18130 return false;
18131 }
18132 }
18133 FastErrorResult rv;
18134 // NOTE: This assert does NOT call the function.
18135 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");
18136 MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18137 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"
)), 0))
) {
18138 return false;
18139 }
18140 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18140); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18141 args.rval().setUndefined();
18142 return true;
18143}
18144
18145static const JSJitInfo passOptionalNullableByteStringWithDefaultValue_methodinfo = {
18146 { (JSJitGetterOp)passOptionalNullableByteStringWithDefaultValue },
18147 { prototypes::id::TestJSImplInterface },
18148 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18149 JSJitInfo::Method,
18150 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18151 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18152 false, /* isInfallible. False in setters. */
18153 false, /* isMovable. Not relevant for setters. */
18154 false, /* isEliminatable. Not relevant for setters. */
18155 false, /* isAlwaysInSlot. Only relevant for getters. */
18156 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18157 false, /* isTypedMethod. Only relevant for methods. */
18158 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18159};
18160
18161MOZ_CAN_RUN_SCRIPT static bool
18162passVariadicByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18163{
18164 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicByteString");
18165 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18168( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18166 "TestJSImplInterface", "passVariadicByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18168( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18167 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18168( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18168 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18168( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18169
18170 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18171 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18172 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18173 if (objIsXray) {
18174 unwrappedObj.emplace(cx, obj);
18175 }
18176 AutoSequence<nsCString> arg0;
18177 if (args.length() > 0) {
18178 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
18179 JS_ReportOutOfMemory(cx);
18180 return false;
18181 }
18182 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
18183 // OK to do infallible append here, since we ensured capacity already.
18184 nsCString& slot = *arg0.AppendElement();
18185 if (!ConvertJSValueToByteString(cx, args[variadicArg], false, "argument 1", slot)) {
18186 return false;
18187 }
18188 }
18189 }
18190 if (objIsXray) {
18191 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18192 // we know Xrays have no dynamic unwrap behavior.
18193 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18194 if (!unwrappedObj.ref()) {
18195 return false;
18196 }
18197 }
18198 FastErrorResult rv;
18199 // NOTE: This assert does NOT call the function.
18200 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");
18201 MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18202 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString"
)), 0))
) {
18203 return false;
18204 }
18205 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18205); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18205); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18206 args.rval().setUndefined();
18207 return true;
18208}
18209
18210static const JSJitInfo passVariadicByteString_methodinfo = {
18211 { (JSJitGetterOp)passVariadicByteString },
18212 { prototypes::id::TestJSImplInterface },
18213 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18214 JSJitInfo::Method,
18215 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18216 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18217 false, /* isInfallible. False in setters. */
18218 false, /* isMovable. Not relevant for setters. */
18219 false, /* isEliminatable. Not relevant for setters. */
18220 false, /* isAlwaysInSlot. Only relevant for getters. */
18221 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18222 false, /* isTypedMethod. Only relevant for methods. */
18223 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18224};
18225
18226MOZ_CAN_RUN_SCRIPT static bool
18227passUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18228{
18229 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionByteString");
18230 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18233( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18231 "TestJSImplInterface", "passUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18233( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18232 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18233( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18233 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18233( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18234
18235 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18236 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionByteString", 1)) {
18237 return false;
18238 }
18239 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18240 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18241 if (objIsXray) {
18242 unwrappedObj.emplace(cx, obj);
18243 }
18244 ByteStringOrLong arg0;
18245 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18246 return false;
18247 }
18248 if (objIsXray) {
18249 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18250 // we know Xrays have no dynamic unwrap behavior.
18251 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18252 if (!unwrappedObj.ref()) {
18253 return false;
18254 }
18255 }
18256 FastErrorResult rv;
18257 // NOTE: This assert does NOT call the function.
18258 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");
18259 MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18260 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString"
)), 0))
) {
18261 return false;
18262 }
18263 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18263); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18264 args.rval().setUndefined();
18265 return true;
18266}
18267
18268static const JSJitInfo passUnionByteString_methodinfo = {
18269 { (JSJitGetterOp)passUnionByteString },
18270 { prototypes::id::TestJSImplInterface },
18271 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18272 JSJitInfo::Method,
18273 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18274 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18275 false, /* isInfallible. False in setters. */
18276 false, /* isMovable. Not relevant for setters. */
18277 false, /* isEliminatable. Not relevant for setters. */
18278 false, /* isAlwaysInSlot. Only relevant for getters. */
18279 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18280 false, /* isTypedMethod. Only relevant for methods. */
18281 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18282};
18283
18284MOZ_CAN_RUN_SCRIPT static bool
18285passOptionalUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18286{
18287 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteString");
18288 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18291( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18289 "TestJSImplInterface", "passOptionalUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18291( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18290 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18291( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18291 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18291( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18292
18293 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18294 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18295 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18296 if (objIsXray) {
18297 unwrappedObj.emplace(cx, obj);
18298 }
18299 Optional<ByteStringOrLong> arg0;
18300 if (args.hasDefined(0)) {
18301 arg0.Construct();
18302 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
18303 return false;
18304 }
18305 }
18306 if (objIsXray) {
18307 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18308 // we know Xrays have no dynamic unwrap behavior.
18309 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18310 if (!unwrappedObj.ref()) {
18311 return false;
18312 }
18313 }
18314 FastErrorResult rv;
18315 // NOTE: This assert does NOT call the function.
18316 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");
18317 MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18318 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString"
)), 0))
) {
18319 return false;
18320 }
18321 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18321); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18321); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18322 args.rval().setUndefined();
18323 return true;
18324}
18325
18326static const JSJitInfo passOptionalUnionByteString_methodinfo = {
18327 { (JSJitGetterOp)passOptionalUnionByteString },
18328 { prototypes::id::TestJSImplInterface },
18329 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18330 JSJitInfo::Method,
18331 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18332 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18333 false, /* isInfallible. False in setters. */
18334 false, /* isMovable. Not relevant for setters. */
18335 false, /* isEliminatable. Not relevant for setters. */
18336 false, /* isAlwaysInSlot. Only relevant for getters. */
18337 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18338 false, /* isTypedMethod. Only relevant for methods. */
18339 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18340};
18341
18342MOZ_CAN_RUN_SCRIPT static bool
18343passOptionalUnionByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18344{
18345 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue");
18346 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18349( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18347 "TestJSImplInterface", "passOptionalUnionByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18349( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18348 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18349( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18349 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18349( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18350
18351 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18352 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18353 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18354 if (objIsXray) {
18355 unwrappedObj.emplace(cx, obj);
18356 }
18357 ByteStringOrLong arg0;
18358 if (!(args.hasDefined(0))) {
18359 arg0.SetStringLiteral("abc");
18360 } else {
18361 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18362 return false;
18363 }
18364 }
18365 if (objIsXray) {
18366 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18367 // we know Xrays have no dynamic unwrap behavior.
18368 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18369 if (!unwrappedObj.ref()) {
18370 return false;
18371 }
18372 }
18373 FastErrorResult rv;
18374 // NOTE: This assert does NOT call the function.
18375 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");
18376 MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18377 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"
)), 0))
) {
18378 return false;
18379 }
18380 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18380); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18380); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18381 args.rval().setUndefined();
18382 return true;
18383}
18384
18385static const JSJitInfo passOptionalUnionByteStringWithDefaultValue_methodinfo = {
18386 { (JSJitGetterOp)passOptionalUnionByteStringWithDefaultValue },
18387 { prototypes::id::TestJSImplInterface },
18388 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18389 JSJitInfo::Method,
18390 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18391 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18392 false, /* isInfallible. False in setters. */
18393 false, /* isMovable. Not relevant for setters. */
18394 false, /* isEliminatable. Not relevant for setters. */
18395 false, /* isAlwaysInSlot. Only relevant for getters. */
18396 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18397 false, /* isTypedMethod. Only relevant for methods. */
18398 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18399};
18400
18401MOZ_CAN_RUN_SCRIPT static bool
18402passUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18403{
18404 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18407( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18405 "TestJSImplInterface", "passUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18407( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18406 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18407( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18407 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18407( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18408
18409 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18410 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUTF8String", 1)) {
18411 return false;
18412 }
18413 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18414 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18415 if (objIsXray) {
18416 unwrappedObj.emplace(cx, obj);
18417 }
18418 binding_detail::FakeString<char> arg0;
18419 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
18420 return false;
18421 }
18422 if (objIsXray) {
18423 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18424 // we know Xrays have no dynamic unwrap behavior.
18425 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18426 if (!unwrappedObj.ref()) {
18427 return false;
18428 }
18429 }
18430 FastErrorResult rv;
18431 // NOTE: This assert does NOT call the function.
18432 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");
18433 MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18434 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String"
)), 0))
) {
18435 return false;
18436 }
18437 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18437); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18438 args.rval().setUndefined();
18439 return true;
18440}
18441
18442static const JSJitInfo passUTF8String_methodinfo = {
18443 { (JSJitGetterOp)passUTF8String },
18444 { prototypes::id::TestJSImplInterface },
18445 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18446 JSJitInfo::Method,
18447 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18448 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18449 false, /* isInfallible. False in setters. */
18450 false, /* isMovable. Not relevant for setters. */
18451 false, /* isEliminatable. Not relevant for setters. */
18452 false, /* isAlwaysInSlot. Only relevant for getters. */
18453 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18454 false, /* isTypedMethod. Only relevant for methods. */
18455 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18456};
18457
18458MOZ_CAN_RUN_SCRIPT static bool
18459passNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18460{
18461 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18464( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18462 "TestJSImplInterface", "passNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18464( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18463 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18464( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18464 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18464( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18465
18466 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18467 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUTF8String", 1)) {
18468 return false;
18469 }
18470 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18471 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18472 if (objIsXray) {
18473 unwrappedObj.emplace(cx, obj);
18474 }
18475 binding_detail::FakeString<char> arg0;
18476 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
18477 return false;
18478 }
18479 if (objIsXray) {
18480 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18481 // we know Xrays have no dynamic unwrap behavior.
18482 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18483 if (!unwrappedObj.ref()) {
18484 return false;
18485 }
18486 }
18487 FastErrorResult rv;
18488 // NOTE: This assert does NOT call the function.
18489 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");
18490 MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18491 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String"
)), 0))
) {
18492 return false;
18493 }
18494 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18494); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18494); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18495 args.rval().setUndefined();
18496 return true;
18497}
18498
18499static const JSJitInfo passNullableUTF8String_methodinfo = {
18500 { (JSJitGetterOp)passNullableUTF8String },
18501 { prototypes::id::TestJSImplInterface },
18502 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18503 JSJitInfo::Method,
18504 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18505 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18506 false, /* isInfallible. False in setters. */
18507 false, /* isMovable. Not relevant for setters. */
18508 false, /* isEliminatable. Not relevant for setters. */
18509 false, /* isAlwaysInSlot. Only relevant for getters. */
18510 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18511 false, /* isTypedMethod. Only relevant for methods. */
18512 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18513};
18514
18515MOZ_CAN_RUN_SCRIPT static bool
18516passOptionalUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18517{
18518 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18521( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18519 "TestJSImplInterface", "passOptionalUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18521( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18520 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18521( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18521 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18521( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18522
18523 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18524 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18525 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18526 if (objIsXray) {
18527 unwrappedObj.emplace(cx, obj);
18528 }
18529 Optional<nsACString> arg0;
18530 binding_detail::FakeString<char> arg0_holder;
18531 if (args.hasDefined(0)) {
18532 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
18533 return false;
18534 }
18535 arg0 = &arg0_holder;
18536 }
18537 if (objIsXray) {
18538 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18539 // we know Xrays have no dynamic unwrap behavior.
18540 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18541 if (!unwrappedObj.ref()) {
18542 return false;
18543 }
18544 }
18545 FastErrorResult rv;
18546 // NOTE: This assert does NOT call the function.
18547 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");
18548 MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18549 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String"
)), 0))
) {
18550 return false;
18551 }
18552 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18552); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18553 args.rval().setUndefined();
18554 return true;
18555}
18556
18557static const JSJitInfo passOptionalUTF8String_methodinfo = {
18558 { (JSJitGetterOp)passOptionalUTF8String },
18559 { prototypes::id::TestJSImplInterface },
18560 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18561 JSJitInfo::Method,
18562 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18563 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18564 false, /* isInfallible. False in setters. */
18565 false, /* isMovable. Not relevant for setters. */
18566 false, /* isEliminatable. Not relevant for setters. */
18567 false, /* isAlwaysInSlot. Only relevant for getters. */
18568 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18569 false, /* isTypedMethod. Only relevant for methods. */
18570 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18571};
18572
18573MOZ_CAN_RUN_SCRIPT static bool
18574passOptionalUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18575{
18576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18579( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18577 "TestJSImplInterface", "passOptionalUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18579( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18579( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18579( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18580
18581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18584 if (objIsXray) {
18585 unwrappedObj.emplace(cx, obj);
18586 }
18587 binding_detail::FakeString<char> arg0;
18588 if (args.hasDefined(0)) {
18589 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
18590 return false;
18591 }
18592 } else {
18593 arg0.AssignLiteral("abc");
18594 }
18595 if (objIsXray) {
18596 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18597 // we know Xrays have no dynamic unwrap behavior.
18598 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18599 if (!unwrappedObj.ref()) {
18600 return false;
18601 }
18602 }
18603 FastErrorResult rv;
18604 // NOTE: This assert does NOT call the function.
18605 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");
18606 MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18607 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue"
)), 0))
) {
18608 return false;
18609 }
18610 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18610); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18610); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18611 args.rval().setUndefined();
18612 return true;
18613}
18614
18615static const JSJitInfo passOptionalUTF8StringWithDefaultValue_methodinfo = {
18616 { (JSJitGetterOp)passOptionalUTF8StringWithDefaultValue },
18617 { prototypes::id::TestJSImplInterface },
18618 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18619 JSJitInfo::Method,
18620 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18621 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18622 false, /* isInfallible. False in setters. */
18623 false, /* isMovable. Not relevant for setters. */
18624 false, /* isEliminatable. Not relevant for setters. */
18625 false, /* isAlwaysInSlot. Only relevant for getters. */
18626 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18627 false, /* isTypedMethod. Only relevant for methods. */
18628 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18629};
18630
18631MOZ_CAN_RUN_SCRIPT static bool
18632passOptionalNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18633{
18634 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18637( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18635 "TestJSImplInterface", "passOptionalNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18637( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18636 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18637( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18637 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18637( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18638
18639 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18640 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18641 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18642 if (objIsXray) {
18643 unwrappedObj.emplace(cx, obj);
18644 }
18645 Optional<nsACString> arg0;
18646 binding_detail::FakeString<char> arg0_holder;
18647 if (args.hasDefined(0)) {
18648 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
18649 return false;
18650 }
18651 arg0 = &arg0_holder;
18652 }
18653 if (objIsXray) {
18654 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18655 // we know Xrays have no dynamic unwrap behavior.
18656 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18657 if (!unwrappedObj.ref()) {
18658 return false;
18659 }
18660 }
18661 FastErrorResult rv;
18662 // NOTE: This assert does NOT call the function.
18663 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");
18664 MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18665 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String"
)), 0))
) {
18666 return false;
18667 }
18668 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18668); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18668); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18669 args.rval().setUndefined();
18670 return true;
18671}
18672
18673static const JSJitInfo passOptionalNullableUTF8String_methodinfo = {
18674 { (JSJitGetterOp)passOptionalNullableUTF8String },
18675 { prototypes::id::TestJSImplInterface },
18676 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18677 JSJitInfo::Method,
18678 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18679 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18680 false, /* isInfallible. False in setters. */
18681 false, /* isMovable. Not relevant for setters. */
18682 false, /* isEliminatable. Not relevant for setters. */
18683 false, /* isAlwaysInSlot. Only relevant for getters. */
18684 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18685 false, /* isTypedMethod. Only relevant for methods. */
18686 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18687};
18688
18689MOZ_CAN_RUN_SCRIPT static bool
18690passOptionalNullableUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18691{
18692 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18695( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18693 "TestJSImplInterface", "passOptionalNullableUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18695( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18694 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18695( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18695 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18695( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18696
18697 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18698 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18699 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18700 if (objIsXray) {
18701 unwrappedObj.emplace(cx, obj);
18702 }
18703 binding_detail::FakeString<char> arg0;
18704 if (args.hasDefined(0)) {
18705 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
18706 return false;
18707 }
18708 } else {
18709 arg0.SetIsVoid(true);
18710 }
18711 if (objIsXray) {
18712 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18713 // we know Xrays have no dynamic unwrap behavior.
18714 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18715 if (!unwrappedObj.ref()) {
18716 return false;
18717 }
18718 }
18719 FastErrorResult rv;
18720 // NOTE: This assert does NOT call the function.
18721 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");
18722 MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18723 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue"
)), 0))
) {
18724 return false;
18725 }
18726 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18726); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18726); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18727 args.rval().setUndefined();
18728 return true;
18729}
18730
18731static const JSJitInfo passOptionalNullableUTF8StringWithDefaultValue_methodinfo = {
18732 { (JSJitGetterOp)passOptionalNullableUTF8StringWithDefaultValue },
18733 { prototypes::id::TestJSImplInterface },
18734 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18735 JSJitInfo::Method,
18736 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18737 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18738 false, /* isInfallible. False in setters. */
18739 false, /* isMovable. Not relevant for setters. */
18740 false, /* isEliminatable. Not relevant for setters. */
18741 false, /* isAlwaysInSlot. Only relevant for getters. */
18742 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18743 false, /* isTypedMethod. Only relevant for methods. */
18744 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18745};
18746
18747MOZ_CAN_RUN_SCRIPT static bool
18748passVariadicUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18749{
18750 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18753( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18751 "TestJSImplInterface", "passVariadicUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18753( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18752 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18753( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18753 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18753( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18754
18755 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18756 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18757 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18758 if (objIsXray) {
18759 unwrappedObj.emplace(cx, obj);
18760 }
18761 AutoSequence<nsCString> arg0;
18762 if (args.length() > 0) {
18763 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
18764 JS_ReportOutOfMemory(cx);
18765 return false;
18766 }
18767 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
18768 // OK to do infallible append here, since we ensured capacity already.
18769 nsCString& slot = *arg0.AppendElement();
18770 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
18771 return false;
18772 }
18773 }
18774 }
18775 if (objIsXray) {
18776 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18777 // we know Xrays have no dynamic unwrap behavior.
18778 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18779 if (!unwrappedObj.ref()) {
18780 return false;
18781 }
18782 }
18783 FastErrorResult rv;
18784 // NOTE: This assert does NOT call the function.
18785 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");
18786 MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18787 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String"
)), 0))
) {
18788 return false;
18789 }
18790 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18790); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18790); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18791 args.rval().setUndefined();
18792 return true;
18793}
18794
18795static const JSJitInfo passVariadicUTF8String_methodinfo = {
18796 { (JSJitGetterOp)passVariadicUTF8String },
18797 { prototypes::id::TestJSImplInterface },
18798 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18799 JSJitInfo::Method,
18800 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18801 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18802 false, /* isInfallible. False in setters. */
18803 false, /* isMovable. Not relevant for setters. */
18804 false, /* isEliminatable. Not relevant for setters. */
18805 false, /* isAlwaysInSlot. Only relevant for getters. */
18806 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18807 false, /* isTypedMethod. Only relevant for methods. */
18808 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18809};
18810
18811MOZ_CAN_RUN_SCRIPT static bool
18812passUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18813{
18814 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionUTF8String");
18815 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18818( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18816 "TestJSImplInterface", "passUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18818( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18817 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18818( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18818 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18818( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18819
18820 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18821 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionUTF8String", 1)) {
18822 return false;
18823 }
18824 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18825 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18826 if (objIsXray) {
18827 unwrappedObj.emplace(cx, obj);
18828 }
18829 UTF8StringOrLong arg0;
18830 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18831 return false;
18832 }
18833 if (objIsXray) {
18834 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18835 // we know Xrays have no dynamic unwrap behavior.
18836 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18837 if (!unwrappedObj.ref()) {
18838 return false;
18839 }
18840 }
18841 FastErrorResult rv;
18842 // NOTE: This assert does NOT call the function.
18843 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");
18844 MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18845 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String"
)), 0))
) {
18846 return false;
18847 }
18848 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18848); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18848); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18849 args.rval().setUndefined();
18850 return true;
18851}
18852
18853static const JSJitInfo passUnionUTF8String_methodinfo = {
18854 { (JSJitGetterOp)passUnionUTF8String },
18855 { prototypes::id::TestJSImplInterface },
18856 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18857 JSJitInfo::Method,
18858 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18859 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18860 false, /* isInfallible. False in setters. */
18861 false, /* isMovable. Not relevant for setters. */
18862 false, /* isEliminatable. Not relevant for setters. */
18863 false, /* isAlwaysInSlot. Only relevant for getters. */
18864 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18865 false, /* isTypedMethod. Only relevant for methods. */
18866 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18867};
18868
18869MOZ_CAN_RUN_SCRIPT static bool
18870passOptionalUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18871{
18872 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8String");
18873 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18876( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18874 "TestJSImplInterface", "passOptionalUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18876( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18875 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18876( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18876 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18876( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18877
18878 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18879 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18880 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18881 if (objIsXray) {
18882 unwrappedObj.emplace(cx, obj);
18883 }
18884 Optional<UTF8StringOrLong> arg0;
18885 if (args.hasDefined(0)) {
18886 arg0.Construct();
18887 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
18888 return false;
18889 }
18890 }
18891 if (objIsXray) {
18892 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18893 // we know Xrays have no dynamic unwrap behavior.
18894 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18895 if (!unwrappedObj.ref()) {
18896 return false;
18897 }
18898 }
18899 FastErrorResult rv;
18900 // NOTE: This assert does NOT call the function.
18901 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");
18902 MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18903 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String"
)), 0))
) {
18904 return false;
18905 }
18906 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18906); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18906); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18907 args.rval().setUndefined();
18908 return true;
18909}
18910
18911static const JSJitInfo passOptionalUnionUTF8String_methodinfo = {
18912 { (JSJitGetterOp)passOptionalUnionUTF8String },
18913 { prototypes::id::TestJSImplInterface },
18914 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18915 JSJitInfo::Method,
18916 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18917 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18918 false, /* isInfallible. False in setters. */
18919 false, /* isMovable. Not relevant for setters. */
18920 false, /* isEliminatable. Not relevant for setters. */
18921 false, /* isAlwaysInSlot. Only relevant for getters. */
18922 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18923 false, /* isTypedMethod. Only relevant for methods. */
18924 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18925};
18926
18927MOZ_CAN_RUN_SCRIPT static bool
18928passOptionalUnionUTF8StringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18929{
18930 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue");
18931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18934( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18932 "TestJSImplInterface", "passOptionalUnionUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18934( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18934( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18934( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18935
18936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18939 if (objIsXray) {
18940 unwrappedObj.emplace(cx, obj);
18941 }
18942 UTF8StringOrLong arg0;
18943 if (!(args.hasDefined(0))) {
18944 arg0.SetStringLiteral("abc");
18945 } else {
18946 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18947 return false;
18948 }
18949 }
18950 if (objIsXray) {
18951 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18952 // we know Xrays have no dynamic unwrap behavior.
18953 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18954 if (!unwrappedObj.ref()) {
18955 return false;
18956 }
18957 }
18958 FastErrorResult rv;
18959 // NOTE: This assert does NOT call the function.
18960 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");
18961 MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18962 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"
)), 0))
) {
18963 return false;
18964 }
18965 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18965); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 18965); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
18966 args.rval().setUndefined();
18967 return true;
18968}
18969
18970static const JSJitInfo passOptionalUnionUTF8StringWithDefaultValue_methodinfo = {
18971 { (JSJitGetterOp)passOptionalUnionUTF8StringWithDefaultValue },
18972 { prototypes::id::TestJSImplInterface },
18973 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18974 JSJitInfo::Method,
18975 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18976 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18977 false, /* isInfallible. False in setters. */
18978 false, /* isMovable. Not relevant for setters. */
18979 false, /* isEliminatable. Not relevant for setters. */
18980 false, /* isAlwaysInSlot. Only relevant for getters. */
18981 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18982 false, /* isTypedMethod. Only relevant for methods. */
18983 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18984};
18985
18986MOZ_CAN_RUN_SCRIPT static bool
18987passSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18988{
18989 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18992( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18990 "TestJSImplInterface", "passSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18992( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18991 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18992( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18992 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18992( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
18993
18994 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18995 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSVS", 1)) {
18996 return false;
18997 }
18998 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18999 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19000 if (objIsXray) {
19001 unwrappedObj.emplace(cx, obj);
19002 }
19003 binding_detail::FakeString<char16_t> arg0;
19004 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
19005 return false;
19006 }
19007 if (!NormalizeUSVString(arg0)) {
19008 JS_ReportOutOfMemory(cx);
19009 return false;
19010 }
19011 if (objIsXray) {
19012 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19013 // we know Xrays have no dynamic unwrap behavior.
19014 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19015 if (!unwrappedObj.ref()) {
19016 return false;
19017 }
19018 }
19019 FastErrorResult rv;
19020 // NOTE: This assert does NOT call the function.
19021 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");
19022 MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19023 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS"
)), 0))
) {
19024 return false;
19025 }
19026 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19026); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19027 args.rval().setUndefined();
19028 return true;
19029}
19030
19031static const JSJitInfo passSVS_methodinfo = {
19032 { (JSJitGetterOp)passSVS },
19033 { prototypes::id::TestJSImplInterface },
19034 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19035 JSJitInfo::Method,
19036 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19037 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19038 false, /* isInfallible. False in setters. */
19039 false, /* isMovable. Not relevant for setters. */
19040 false, /* isEliminatable. Not relevant for setters. */
19041 false, /* isAlwaysInSlot. Only relevant for getters. */
19042 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19043 false, /* isTypedMethod. Only relevant for methods. */
19044 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19045};
19046
19047MOZ_CAN_RUN_SCRIPT static bool
19048passNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19049{
19050 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19053( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19051 "TestJSImplInterface", "passNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19053( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19052 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19053( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19053 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19053( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19054
19055 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19056 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSVS", 1)) {
19057 return false;
19058 }
19059 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19060 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19061 if (objIsXray) {
19062 unwrappedObj.emplace(cx, obj);
19063 }
19064 binding_detail::FakeString<char16_t> arg0;
19065 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
19066 return false;
19067 }
19068 if (!NormalizeUSVString(arg0)) {
19069 JS_ReportOutOfMemory(cx);
19070 return false;
19071 }
19072 if (objIsXray) {
19073 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19074 // we know Xrays have no dynamic unwrap behavior.
19075 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19076 if (!unwrappedObj.ref()) {
19077 return false;
19078 }
19079 }
19080 FastErrorResult rv;
19081 // NOTE: This assert does NOT call the function.
19082 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");
19083 MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19084 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS"
)), 0))
) {
19085 return false;
19086 }
19087 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19087); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19087); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19088 args.rval().setUndefined();
19089 return true;
19090}
19091
19092static const JSJitInfo passNullableSVS_methodinfo = {
19093 { (JSJitGetterOp)passNullableSVS },
19094 { prototypes::id::TestJSImplInterface },
19095 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19096 JSJitInfo::Method,
19097 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19098 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19099 false, /* isInfallible. False in setters. */
19100 false, /* isMovable. Not relevant for setters. */
19101 false, /* isEliminatable. Not relevant for setters. */
19102 false, /* isAlwaysInSlot. Only relevant for getters. */
19103 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19104 false, /* isTypedMethod. Only relevant for methods. */
19105 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19106};
19107
19108MOZ_CAN_RUN_SCRIPT static bool
19109passOptionalSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19110{
19111 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19114( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19112 "TestJSImplInterface", "passOptionalSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19114( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19113 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19114( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19114 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19114( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19115
19116 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19117 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19118 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19119 if (objIsXray) {
19120 unwrappedObj.emplace(cx, obj);
19121 }
19122 Optional<nsAString> arg0;
19123 binding_detail::FakeString<char16_t> arg0_holder;
19124 if (args.hasDefined(0)) {
19125 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
19126 return false;
19127 }
19128 if (!NormalizeUSVString(arg0_holder)) {
19129 JS_ReportOutOfMemory(cx);
19130 return false;
19131 }
19132 arg0 = &arg0_holder;
19133 }
19134 if (objIsXray) {
19135 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19136 // we know Xrays have no dynamic unwrap behavior.
19137 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19138 if (!unwrappedObj.ref()) {
19139 return false;
19140 }
19141 }
19142 FastErrorResult rv;
19143 // NOTE: This assert does NOT call the function.
19144 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");
19145 MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19146 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS"
)), 0))
) {
19147 return false;
19148 }
19149 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19149); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19149); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19150 args.rval().setUndefined();
19151 return true;
19152}
19153
19154static const JSJitInfo passOptionalSVS_methodinfo = {
19155 { (JSJitGetterOp)passOptionalSVS },
19156 { prototypes::id::TestJSImplInterface },
19157 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19158 JSJitInfo::Method,
19159 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19160 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19161 false, /* isInfallible. False in setters. */
19162 false, /* isMovable. Not relevant for setters. */
19163 false, /* isEliminatable. Not relevant for setters. */
19164 false, /* isAlwaysInSlot. Only relevant for getters. */
19165 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19166 false, /* isTypedMethod. Only relevant for methods. */
19167 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19168};
19169
19170MOZ_CAN_RUN_SCRIPT static bool
19171passOptionalSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19172{
19173 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19176( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19174 "TestJSImplInterface", "passOptionalSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19176( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19175 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19176( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19176 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19176( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19177
19178 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19179 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19180 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19181 if (objIsXray) {
19182 unwrappedObj.emplace(cx, obj);
19183 }
19184 binding_detail::FakeString<char16_t> arg0;
19185 if (args.hasDefined(0)) {
19186 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
19187 return false;
19188 }
19189 if (!NormalizeUSVString(arg0)) {
19190 JS_ReportOutOfMemory(cx);
19191 return false;
19192 }
19193 } else {
19194 arg0.AssignLiteral(u"abc");
19195 }
19196 if (objIsXray) {
19197 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19198 // we know Xrays have no dynamic unwrap behavior.
19199 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19200 if (!unwrappedObj.ref()) {
19201 return false;
19202 }
19203 }
19204 FastErrorResult rv;
19205 // NOTE: This assert does NOT call the function.
19206 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");
19207 MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19208 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue"
)), 0))
) {
19209 return false;
19210 }
19211 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19211); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19211); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19212 args.rval().setUndefined();
19213 return true;
19214}
19215
19216static const JSJitInfo passOptionalSVSWithDefaultValue_methodinfo = {
19217 { (JSJitGetterOp)passOptionalSVSWithDefaultValue },
19218 { prototypes::id::TestJSImplInterface },
19219 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19220 JSJitInfo::Method,
19221 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19222 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19223 false, /* isInfallible. False in setters. */
19224 false, /* isMovable. Not relevant for setters. */
19225 false, /* isEliminatable. Not relevant for setters. */
19226 false, /* isAlwaysInSlot. Only relevant for getters. */
19227 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19228 false, /* isTypedMethod. Only relevant for methods. */
19229 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19230};
19231
19232MOZ_CAN_RUN_SCRIPT static bool
19233passOptionalNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19234{
19235 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19238( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19236 "TestJSImplInterface", "passOptionalNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19238( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19237 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19238( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19238 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19238( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19239
19240 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19241 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19242 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19243 if (objIsXray) {
19244 unwrappedObj.emplace(cx, obj);
19245 }
19246 Optional<nsAString> arg0;
19247 binding_detail::FakeString<char16_t> arg0_holder;
19248 if (args.hasDefined(0)) {
19249 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
19250 return false;
19251 }
19252 if (!NormalizeUSVString(arg0_holder)) {
19253 JS_ReportOutOfMemory(cx);
19254 return false;
19255 }
19256 arg0 = &arg0_holder;
19257 }
19258 if (objIsXray) {
19259 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19260 // we know Xrays have no dynamic unwrap behavior.
19261 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19262 if (!unwrappedObj.ref()) {
19263 return false;
19264 }
19265 }
19266 FastErrorResult rv;
19267 // NOTE: This assert does NOT call the function.
19268 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");
19269 MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19270 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS"
)), 0))
) {
19271 return false;
19272 }
19273 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19273); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19273); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19274 args.rval().setUndefined();
19275 return true;
19276}
19277
19278static const JSJitInfo passOptionalNullableSVS_methodinfo = {
19279 { (JSJitGetterOp)passOptionalNullableSVS },
19280 { prototypes::id::TestJSImplInterface },
19281 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19282 JSJitInfo::Method,
19283 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19284 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19285 false, /* isInfallible. False in setters. */
19286 false, /* isMovable. Not relevant for setters. */
19287 false, /* isEliminatable. Not relevant for setters. */
19288 false, /* isAlwaysInSlot. Only relevant for getters. */
19289 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19290 false, /* isTypedMethod. Only relevant for methods. */
19291 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19292};
19293
19294MOZ_CAN_RUN_SCRIPT static bool
19295passOptionalNullableSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19296{
19297 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19300( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19298 "TestJSImplInterface", "passOptionalNullableSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19300( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19299 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19300( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19300 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19300( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19301
19302 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19303 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19304 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19305 if (objIsXray) {
19306 unwrappedObj.emplace(cx, obj);
19307 }
19308 binding_detail::FakeString<char16_t> arg0;
19309 if (args.hasDefined(0)) {
19310 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
19311 return false;
19312 }
19313 if (!NormalizeUSVString(arg0)) {
19314 JS_ReportOutOfMemory(cx);
19315 return false;
19316 }
19317 } else {
19318 arg0.SetIsVoid(true);
19319 }
19320 if (objIsXray) {
19321 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19322 // we know Xrays have no dynamic unwrap behavior.
19323 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19324 if (!unwrappedObj.ref()) {
19325 return false;
19326 }
19327 }
19328 FastErrorResult rv;
19329 // NOTE: This assert does NOT call the function.
19330 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");
19331 MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19332 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue"
)), 0))
) {
19333 return false;
19334 }
19335 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19335); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19335); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19336 args.rval().setUndefined();
19337 return true;
19338}
19339
19340static const JSJitInfo passOptionalNullableSVSWithDefaultValue_methodinfo = {
19341 { (JSJitGetterOp)passOptionalNullableSVSWithDefaultValue },
19342 { prototypes::id::TestJSImplInterface },
19343 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19344 JSJitInfo::Method,
19345 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19346 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19347 false, /* isInfallible. False in setters. */
19348 false, /* isMovable. Not relevant for setters. */
19349 false, /* isEliminatable. Not relevant for setters. */
19350 false, /* isAlwaysInSlot. Only relevant for getters. */
19351 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19352 false, /* isTypedMethod. Only relevant for methods. */
19353 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19354};
19355
19356MOZ_CAN_RUN_SCRIPT static bool
19357passVariadicSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19358{
19359 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19362( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19360 "TestJSImplInterface", "passVariadicSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19362( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19361 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19362( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19362 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19362( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19363
19364 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19365 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19366 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19367 if (objIsXray) {
19368 unwrappedObj.emplace(cx, obj);
19369 }
19370 AutoSequence<nsString> arg0;
19371 if (args.length() > 0) {
19372 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
19373 JS_ReportOutOfMemory(cx);
19374 return false;
19375 }
19376 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
19377 // OK to do infallible append here, since we ensured capacity already.
19378 nsString& slot = *arg0.AppendElement();
19379 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
19380 return false;
19381 }
19382 if (!NormalizeUSVString(slot)) {
19383 JS_ReportOutOfMemory(cx);
19384 return false;
19385 }
19386 }
19387 }
19388 if (objIsXray) {
19389 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19390 // we know Xrays have no dynamic unwrap behavior.
19391 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19392 if (!unwrappedObj.ref()) {
19393 return false;
19394 }
19395 }
19396 FastErrorResult rv;
19397 // NOTE: This assert does NOT call the function.
19398 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");
19399 MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19400 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS"
)), 0))
) {
19401 return false;
19402 }
19403 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19403); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19403); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19404 args.rval().setUndefined();
19405 return true;
19406}
19407
19408static const JSJitInfo passVariadicSVS_methodinfo = {
19409 { (JSJitGetterOp)passVariadicSVS },
19410 { prototypes::id::TestJSImplInterface },
19411 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19412 JSJitInfo::Method,
19413 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19414 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19415 false, /* isInfallible. False in setters. */
19416 false, /* isMovable. Not relevant for setters. */
19417 false, /* isEliminatable. Not relevant for setters. */
19418 false, /* isAlwaysInSlot. Only relevant for getters. */
19419 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19420 false, /* isTypedMethod. Only relevant for methods. */
19421 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19422};
19423
19424MOZ_CAN_RUN_SCRIPT static bool
19425receiveSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19426{
19427 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19430( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19428 "TestJSImplInterface", "receiveSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19430( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19429 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19430( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19430 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19430( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19431
19432 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19433 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19434 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19435 if (objIsXray) {
19436 unwrappedObj.emplace(cx, obj);
19437 }
19438 if (objIsXray) {
19439 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19440 // we know Xrays have no dynamic unwrap behavior.
19441 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19442 if (!unwrappedObj.ref()) {
19443 return false;
19444 }
19445 }
19446 FastErrorResult rv;
19447 DOMString result;
19448 // NOTE: This assert does NOT call the function.
19449 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");
19450 MOZ_KnownLive(self)(self)->ReceiveSVS(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19451 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS"
)), 0))
) {
19452 return false;
19453 }
19454 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19454); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19454); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19455 if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
19456 return false;
19457 }
19458 return true;
19459}
19460
19461static const JSJitInfo receiveSVS_methodinfo = {
19462 { (JSJitGetterOp)receiveSVS },
19463 { prototypes::id::TestJSImplInterface },
19464 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19465 JSJitInfo::Method,
19466 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19467 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19468 false, /* isInfallible. False in setters. */
19469 false, /* isMovable. Not relevant for setters. */
19470 false, /* isEliminatable. Not relevant for setters. */
19471 false, /* isAlwaysInSlot. Only relevant for getters. */
19472 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19473 false, /* isTypedMethod. Only relevant for methods. */
19474 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19475};
19476
19477MOZ_CAN_RUN_SCRIPT static bool
19478passJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19479{
19480 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19483( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19481 "TestJSImplInterface", "passJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19483( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19482 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19483( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19483 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19483( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19484
19485 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19486 if (!args.requireAtLeast(cx, "TestJSImplInterface.passJSString", 1)) {
19487 return false;
19488 }
19489 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19490 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19491 if (objIsXray) {
19492 unwrappedObj.emplace(cx, obj);
19493 }
19494 JS::Rooted<JSString*> arg0(cx);
19495 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19496 return false;
19497 }
19498 if (objIsXray) {
19499 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19500 // we know Xrays have no dynamic unwrap behavior.
19501 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19502 if (!unwrappedObj.ref()) {
19503 return false;
19504 }
19505 }
19506 FastErrorResult rv;
19507 // NOTE: This assert does NOT call the function.
19508 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");
19509 MOZ_KnownLive(self)(self)->PassJSString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19510 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString"
)), 0))
) {
19511 return false;
19512 }
19513 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19513); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19514 args.rval().setUndefined();
19515 return true;
19516}
19517
19518static const JSJitInfo passJSString_methodinfo = {
19519 { (JSJitGetterOp)passJSString },
19520 { prototypes::id::TestJSImplInterface },
19521 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19522 JSJitInfo::Method,
19523 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19524 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19525 false, /* isInfallible. False in setters. */
19526 false, /* isMovable. Not relevant for setters. */
19527 false, /* isEliminatable. Not relevant for setters. */
19528 false, /* isAlwaysInSlot. Only relevant for getters. */
19529 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19530 false, /* isTypedMethod. Only relevant for methods. */
19531 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19532};
19533
19534MOZ_CAN_RUN_SCRIPT static bool
19535passOptionalJSStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19536{
19537 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19540( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19538 "TestJSImplInterface", "passOptionalJSStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19540( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19539 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19540( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19540 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19540( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19541
19542 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19543 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19544 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19545 if (objIsXray) {
19546 unwrappedObj.emplace(cx, obj);
19547 }
19548 JS::Rooted<JSString*> arg0(cx);
19549 if (args.hasDefined(0)) {
19550 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19551 return false;
19552 }
19553 } else {
19554 static const char data[] = { 'a', 'b', 'c', 0 };
19555 arg0 = JS_NewStringCopyN(cx, data, std::size(data) - 1);
19556 if (!arg0) {
19557 return false;
19558 }
19559 }
19560 if (objIsXray) {
19561 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19562 // we know Xrays have no dynamic unwrap behavior.
19563 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19564 if (!unwrappedObj.ref()) {
19565 return false;
19566 }
19567 }
19568 FastErrorResult rv;
19569 // NOTE: This assert does NOT call the function.
19570 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");
19571 MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19572 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue"
)), 0))
) {
19573 return false;
19574 }
19575 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19575); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19576 args.rval().setUndefined();
19577 return true;
19578}
19579
19580static const JSJitInfo passOptionalJSStringWithDefaultValue_methodinfo = {
19581 { (JSJitGetterOp)passOptionalJSStringWithDefaultValue },
19582 { prototypes::id::TestJSImplInterface },
19583 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19584 JSJitInfo::Method,
19585 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19586 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19587 false, /* isInfallible. False in setters. */
19588 false, /* isMovable. Not relevant for setters. */
19589 false, /* isEliminatable. Not relevant for setters. */
19590 false, /* isAlwaysInSlot. Only relevant for getters. */
19591 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19592 false, /* isTypedMethod. Only relevant for methods. */
19593 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19594};
19595
19596MOZ_CAN_RUN_SCRIPT static bool
19597receiveJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19598{
19599 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19602( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19600 "TestJSImplInterface", "receiveJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19602( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19601 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19602( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19602 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19602( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19603
19604 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19605 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19606 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19607 if (objIsXray) {
19608 unwrappedObj.emplace(cx, obj);
19609 }
19610 if (objIsXray) {
19611 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19612 // we know Xrays have no dynamic unwrap behavior.
19613 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19614 if (!unwrappedObj.ref()) {
19615 return false;
19616 }
19617 }
19618 FastErrorResult rv;
19619 JS::Rooted<JSString*> result(cx);
19620 // NOTE: This assert does NOT call the function.
19621 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");
19622 MOZ_KnownLive(self)(self)->ReceiveJSString(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19623 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString"
)), 0))
) {
19624 return false;
19625 }
19626 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19626); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19626); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19627 args.rval().setString(result);
19628 if (!MaybeWrapStringValue(cx, args.rval())) {
19629 return false;
19630 }
19631 return true;
19632}
19633
19634static const JSJitInfo receiveJSString_methodinfo = {
19635 { (JSJitGetterOp)receiveJSString },
19636 { prototypes::id::TestJSImplInterface },
19637 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19638 JSJitInfo::Method,
19639 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19640 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19641 false, /* isInfallible. False in setters. */
19642 false, /* isMovable. Not relevant for setters. */
19643 false, /* isEliminatable. Not relevant for setters. */
19644 false, /* isAlwaysInSlot. Only relevant for getters. */
19645 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19646 false, /* isTypedMethod. Only relevant for methods. */
19647 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19648};
19649
19650MOZ_CAN_RUN_SCRIPT static bool
19651get_readonlyJSStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
19652{
19653 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19654 "TestJSImplInterface", "readonlyJSStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19655 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19656 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | 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 if (objIsXray) {
19665 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19666 // we know Xrays have no dynamic unwrap behavior.
19667 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19668 if (!unwrappedObj.ref()) {
19669 return false;
19670 }
19671 }
19672 FastErrorResult rv;
19673 JS::Rooted<JSString*> result(cx);
19674 // NOTE: This assert does NOT call the function.
19675 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");
19676 MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19677 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter"
)), 0))
) {
19678 return false;
19679 }
19680 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19680); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19680); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19681 args.rval().setString(result);
19682 if (!MaybeWrapStringValue(cx, args.rval())) {
19683 return false;
19684 }
19685 return true;
19686}
19687
19688static const JSJitInfo readonlyJSStringAttr_getterinfo = {
19689 { get_readonlyJSStringAttr },
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};
19703
19704MOZ_CAN_RUN_SCRIPT static bool
19705get_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
19706{
19707 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19710( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19708 "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19710( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19709 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19710( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19710 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19710( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19711
19712 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19713 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19714 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19715 if (objIsXray) {
19716 unwrappedObj.emplace(cx, obj);
19717 }
19718 if (objIsXray) {
19719 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19720 // we know Xrays have no dynamic unwrap behavior.
19721 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19722 if (!unwrappedObj.ref()) {
19723 return false;
19724 }
19725 }
19726 FastErrorResult rv;
19727 JS::Rooted<JSString*> result(cx);
19728 // NOTE: This assert does NOT call the function.
19729 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");
19730 MOZ_KnownLive(self)(self)->GetJsStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19731 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter"
)), 0))
) {
19732 return false;
19733 }
19734 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19734); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19735 args.rval().setString(result);
19736 if (!MaybeWrapStringValue(cx, args.rval())) {
19737 return false;
19738 }
19739 return true;
19740}
19741
19742MOZ_CAN_RUN_SCRIPT static bool
19743set_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
19744{
19745 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19748( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19746 "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19748( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19747 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject19748( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19748 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19748( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19749
19750 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19751 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19752 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19753 if (objIsXray) {
19754 unwrappedObj.emplace(cx, obj);
19755 }
19756 JS::Rooted<JSString*> arg0(cx);
19757 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19758 return false;
19759 }
19760 if (objIsXray) {
19761 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19762 // we know Xrays have no dynamic unwrap behavior.
19763 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19764 if (!unwrappedObj.ref()) {
19765 return false;
19766 }
19767 }
19768 FastErrorResult rv;
19769 // NOTE: This assert does NOT call the function.
19770 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");
19771 MOZ_KnownLive(self)(self)->SetJsStringAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19772 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter"
)), 0))
) {
19773 return false;
19774 }
19775 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19775); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19775); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19776
19777 return true;
19778}
19779
19780static const JSJitInfo jsStringAttr_getterinfo = {
19781 { get_jsStringAttr },
19782 { prototypes::id::TestJSImplInterface },
19783 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19784 JSJitInfo::Getter,
19785 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19786 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19787 false, /* isInfallible. False in setters. */
19788 false, /* isMovable. Not relevant for setters. */
19789 false, /* isEliminatable. Not relevant for setters. */
19790 false, /* isAlwaysInSlot. Only relevant for getters. */
19791 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19792 false, /* isTypedMethod. Only relevant for methods. */
19793 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19794};
19795static const JSJitInfo jsStringAttr_setterinfo = {
19796 { (JSJitGetterOp)set_jsStringAttr },
19797 { prototypes::id::TestJSImplInterface },
19798 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19799 JSJitInfo::Setter,
19800 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19801 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19802 false, /* isInfallible. False in setters. */
19803 false, /* isMovable. Not relevant for setters. */
19804 false, /* isEliminatable. Not relevant for setters. */
19805 false, /* isAlwaysInSlot. Only relevant for getters. */
19806 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19807 false, /* isTypedMethod. Only relevant for methods. */
19808 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19809};
19810
19811MOZ_CAN_RUN_SCRIPT static bool
19812passEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19813{
19814 BindingCallContext cx(cx_, "TestJSImplInterface.passEnum");
19815 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19818( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19816 "TestJSImplInterface", "passEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19818( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19817 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19818( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19818 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19818( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
19819
19820 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19821 if (!args.requireAtLeast(cx, "TestJSImplInterface.passEnum", 1)) {
19822 return false;
19823 }
19824 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19825 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19826 if (objIsXray) {
19827 unwrappedObj.emplace(cx, obj);
19828 }
19829 MyTestEnum arg0;
19830 {
19831 int index;
19832 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19833 binding_detail::EnumStrings<MyTestEnum>::Values,
19834 "MyTestEnum", "argument 1",
19835 &index)) {
19836 return false;
19837 }
19838 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", 19838); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 19838); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19839 arg0 = static_cast<MyTestEnum>(index);
19840 }
19841 if (objIsXray) {
19842 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19843 // we know Xrays have no dynamic unwrap behavior.
19844 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19845 if (!unwrappedObj.ref()) {
19846 return false;
19847 }
19848 }
19849 FastErrorResult rv;
19850 // NOTE: This assert does NOT call the function.
19851 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");
19852 MOZ_KnownLive(self)(self)->PassEnum(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19853 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum"
)), 0))
) {
19854 return false;
19855 }
19856 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19856); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19856); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19857 args.rval().setUndefined();
19858 return true;
19859}
19860
19861static const JSJitInfo passEnum_methodinfo = {
19862 { (JSJitGetterOp)passEnum },
19863 { prototypes::id::TestJSImplInterface },
19864 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19865 JSJitInfo::Method,
19866 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19867 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19868 false, /* isInfallible. False in setters. */
19869 false, /* isMovable. Not relevant for setters. */
19870 false, /* isEliminatable. Not relevant for setters. */
19871 false, /* isAlwaysInSlot. Only relevant for getters. */
19872 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19873 false, /* isTypedMethod. Only relevant for methods. */
19874 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19875};
19876
19877MOZ_CAN_RUN_SCRIPT static bool
19878passNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19879{
19880 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableEnum");
19881 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19884( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19882 "TestJSImplInterface", "passNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19884( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19883 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19884( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19884 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19884( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19885
19886 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19887 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableEnum", 1)) {
19888 return false;
19889 }
19890 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19891 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19892 if (objIsXray) {
19893 unwrappedObj.emplace(cx, obj);
19894 }
19895 Nullable<MyTestEnum> arg0;
19896 if (args[0].isNullOrUndefined()) {
19897 arg0.SetNull();
19898 } else {
19899 {
19900 int index;
19901 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19902 binding_detail::EnumStrings<MyTestEnum>::Values,
19903 "MyTestEnum", "argument 1",
19904 &index)) {
19905 return false;
19906 }
19907 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", 19907); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 19907); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19908 arg0.SetValue() = static_cast<MyTestEnum>(index);
19909 }
19910 }
19911 if (objIsXray) {
19912 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19913 // we know Xrays have no dynamic unwrap behavior.
19914 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19915 if (!unwrappedObj.ref()) {
19916 return false;
19917 }
19918 }
19919 FastErrorResult rv;
19920 // NOTE: This assert does NOT call the function.
19921 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");
19922 MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19923 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum"
)), 0))
) {
19924 return false;
19925 }
19926 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19926); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19927 args.rval().setUndefined();
19928 return true;
19929}
19930
19931static const JSJitInfo passNullableEnum_methodinfo = {
19932 { (JSJitGetterOp)passNullableEnum },
19933 { prototypes::id::TestJSImplInterface },
19934 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19935 JSJitInfo::Method,
19936 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19937 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19938 false, /* isInfallible. False in setters. */
19939 false, /* isMovable. Not relevant for setters. */
19940 false, /* isEliminatable. Not relevant for setters. */
19941 false, /* isAlwaysInSlot. Only relevant for getters. */
19942 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19943 false, /* isTypedMethod. Only relevant for methods. */
19944 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19945};
19946
19947MOZ_CAN_RUN_SCRIPT static bool
19948passOptionalEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19949{
19950 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalEnum");
19951 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19954( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19952 "TestJSImplInterface", "passOptionalEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19954( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19953 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19954( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19954 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19954( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19955
19956 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19957 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19958 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19959 if (objIsXray) {
19960 unwrappedObj.emplace(cx, obj);
19961 }
19962 Optional<MyTestEnum> arg0;
19963 if (args.hasDefined(0)) {
19964 arg0.Construct();
19965 {
19966 int index;
19967 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19968 binding_detail::EnumStrings<MyTestEnum>::Values,
19969 "MyTestEnum", "argument 1",
19970 &index)) {
19971 return false;
19972 }
19973 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", 19973); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 19973); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19974 arg0.Value() = static_cast<MyTestEnum>(index);
19975 }
19976 }
19977 if (objIsXray) {
19978 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19979 // we know Xrays have no dynamic unwrap behavior.
19980 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19981 if (!unwrappedObj.ref()) {
19982 return false;
19983 }
19984 }
19985 FastErrorResult rv;
19986 // NOTE: This assert does NOT call the function.
19987 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");
19988 MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19989 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum"
)), 0))
) {
19990 return false;
19991 }
19992 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19992); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 19992); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
19993 args.rval().setUndefined();
19994 return true;
19995}
19996
19997static const JSJitInfo passOptionalEnum_methodinfo = {
19998 { (JSJitGetterOp)passOptionalEnum },
19999 { prototypes::id::TestJSImplInterface },
20000 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20001 JSJitInfo::Method,
20002 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20003 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20004 false, /* isInfallible. False in setters. */
20005 false, /* isMovable. Not relevant for setters. */
20006 false, /* isEliminatable. Not relevant for setters. */
20007 false, /* isAlwaysInSlot. Only relevant for getters. */
20008 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20009 false, /* isTypedMethod. Only relevant for methods. */
20010 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20011};
20012
20013MOZ_CAN_RUN_SCRIPT static bool
20014passEnumWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20015{
20016 BindingCallContext cx(cx_, "TestJSImplInterface.passEnumWithDefault");
20017 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20020( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20018 "TestJSImplInterface", "passEnumWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20020( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20019 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20020( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20020 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20020( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20021
20022 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20023 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20024 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20025 if (objIsXray) {
20026 unwrappedObj.emplace(cx, obj);
20027 }
20028 MyTestEnum arg0;
20029 if (args.hasDefined(0)) {
20030 {
20031 int index;
20032 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20033 binding_detail::EnumStrings<MyTestEnum>::Values,
20034 "MyTestEnum", "argument 1",
20035 &index)) {
20036 return false;
20037 }
20038 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", 20038); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 20038); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20039 arg0 = static_cast<MyTestEnum>(index);
20040 }
20041 } else {
20042 arg0 = MyTestEnum::A;
20043 }
20044 if (objIsXray) {
20045 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20046 // we know Xrays have no dynamic unwrap behavior.
20047 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20048 if (!unwrappedObj.ref()) {
20049 return false;
20050 }
20051 }
20052 FastErrorResult rv;
20053 // NOTE: This assert does NOT call the function.
20054 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");
20055 MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20056 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault"
)), 0))
) {
20057 return false;
20058 }
20059 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20059); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20059); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20060 args.rval().setUndefined();
20061 return true;
20062}
20063
20064static const JSJitInfo passEnumWithDefault_methodinfo = {
20065 { (JSJitGetterOp)passEnumWithDefault },
20066 { prototypes::id::TestJSImplInterface },
20067 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20068 JSJitInfo::Method,
20069 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20070 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20071 false, /* isInfallible. False in setters. */
20072 false, /* isMovable. Not relevant for setters. */
20073 false, /* isEliminatable. Not relevant for setters. */
20074 false, /* isAlwaysInSlot. Only relevant for getters. */
20075 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20076 false, /* isTypedMethod. Only relevant for methods. */
20077 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20078};
20079
20080MOZ_CAN_RUN_SCRIPT static bool
20081passOptionalNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20082{
20083 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnum");
20084 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20087( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20085 "TestJSImplInterface", "passOptionalNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20087( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20086 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20087( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20087 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20087( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20088
20089 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20090 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20091 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20092 if (objIsXray) {
20093 unwrappedObj.emplace(cx, obj);
20094 }
20095 Optional<Nullable<MyTestEnum>> arg0;
20096 if (args.hasDefined(0)) {
20097 arg0.Construct();
20098 if (args[0].isNullOrUndefined()) {
20099 arg0.Value().SetNull();
20100 } else {
20101 {
20102 int index;
20103 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20104 binding_detail::EnumStrings<MyTestEnum>::Values,
20105 "MyTestEnum", "argument 1",
20106 &index)) {
20107 return false;
20108 }
20109 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", 20109); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 20109); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20110 arg0.Value().SetValue() = static_cast<MyTestEnum>(index);
20111 }
20112 }
20113 }
20114 if (objIsXray) {
20115 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20116 // we know Xrays have no dynamic unwrap behavior.
20117 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20118 if (!unwrappedObj.ref()) {
20119 return false;
20120 }
20121 }
20122 FastErrorResult rv;
20123 // NOTE: This assert does NOT call the function.
20124 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");
20125 MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20126 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum"
)), 0))
) {
20127 return false;
20128 }
20129 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20129); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20129); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20130 args.rval().setUndefined();
20131 return true;
20132}
20133
20134static const JSJitInfo passOptionalNullableEnum_methodinfo = {
20135 { (JSJitGetterOp)passOptionalNullableEnum },
20136 { prototypes::id::TestJSImplInterface },
20137 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20138 JSJitInfo::Method,
20139 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20140 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20141 false, /* isInfallible. False in setters. */
20142 false, /* isMovable. Not relevant for setters. */
20143 false, /* isEliminatable. Not relevant for setters. */
20144 false, /* isAlwaysInSlot. Only relevant for getters. */
20145 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20146 false, /* isTypedMethod. Only relevant for methods. */
20147 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20148};
20149
20150MOZ_CAN_RUN_SCRIPT static bool
20151passOptionalNullableEnumWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20152{
20153 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue");
20154 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20157( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20155 "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20157( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20156 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20157( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20157 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20157( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20158
20159 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20160 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20161 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20162 if (objIsXray) {
20163 unwrappedObj.emplace(cx, obj);
20164 }
20165 Nullable<MyTestEnum> arg0;
20166 if (args.hasDefined(0)) {
20167 if (args[0].isNullOrUndefined()) {
20168 arg0.SetNull();
20169 } else {
20170 {
20171 int index;
20172 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20173 binding_detail::EnumStrings<MyTestEnum>::Values,
20174 "MyTestEnum", "argument 1",
20175 &index)) {
20176 return false;
20177 }
20178 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", 20178); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 20178); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20179 arg0.SetValue() = static_cast<MyTestEnum>(index);
20180 }
20181 }
20182 } else {
20183 arg0.SetNull();
20184 }
20185 if (objIsXray) {
20186 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20187 // we know Xrays have no dynamic unwrap behavior.
20188 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20189 if (!unwrappedObj.ref()) {
20190 return false;
20191 }
20192 }
20193 FastErrorResult rv;
20194 // NOTE: This assert does NOT call the function.
20195 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");
20196 MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20197 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"
)), 0))
) {
20198 return false;
20199 }
20200 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20200); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20200); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20201 args.rval().setUndefined();
20202 return true;
20203}
20204
20205static const JSJitInfo passOptionalNullableEnumWithDefaultValue_methodinfo = {
20206 { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue },
20207 { prototypes::id::TestJSImplInterface },
20208 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20209 JSJitInfo::Method,
20210 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20211 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20212 false, /* isInfallible. False in setters. */
20213 false, /* isMovable. Not relevant for setters. */
20214 false, /* isEliminatable. Not relevant for setters. */
20215 false, /* isAlwaysInSlot. Only relevant for getters. */
20216 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20217 false, /* isTypedMethod. Only relevant for methods. */
20218 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20219};
20220
20221MOZ_CAN_RUN_SCRIPT static bool
20222passOptionalNullableEnumWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20223{
20224 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2");
20225 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20228( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20226 "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20228( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20227 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20228( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20228 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20228( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20229
20230 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20231 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20232 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20233 if (objIsXray) {
20234 unwrappedObj.emplace(cx, obj);
20235 }
20236 Nullable<MyTestEnum> arg0;
20237 if (args.hasDefined(0)) {
20238 if (args[0].isNullOrUndefined()) {
20239 arg0.SetNull();
20240 } else {
20241 {
20242 int index;
20243 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20244 binding_detail::EnumStrings<MyTestEnum>::Values,
20245 "MyTestEnum", "argument 1",
20246 &index)) {
20247 return false;
20248 }
20249 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", 20249); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 20249); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20250 arg0.SetValue() = static_cast<MyTestEnum>(index);
20251 }
20252 }
20253 } else {
20254 arg0.SetValue() = MyTestEnum::A;
20255 }
20256 if (objIsXray) {
20257 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20258 // we know Xrays have no dynamic unwrap behavior.
20259 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20260 if (!unwrappedObj.ref()) {
20261 return false;
20262 }
20263 }
20264 FastErrorResult rv;
20265 // NOTE: This assert does NOT call the function.
20266 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");
20267 MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20268 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"
)), 0))
) {
20269 return false;
20270 }
20271 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20271); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20271); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20272 args.rval().setUndefined();
20273 return true;
20274}
20275
20276static const JSJitInfo passOptionalNullableEnumWithDefaultValue2_methodinfo = {
20277 { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue2 },
20278 { prototypes::id::TestJSImplInterface },
20279 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20280 JSJitInfo::Method,
20281 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20282 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20283 false, /* isInfallible. False in setters. */
20284 false, /* isMovable. Not relevant for setters. */
20285 false, /* isEliminatable. Not relevant for setters. */
20286 false, /* isAlwaysInSlot. Only relevant for getters. */
20287 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20288 false, /* isTypedMethod. Only relevant for methods. */
20289 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20290};
20291
20292MOZ_CAN_RUN_SCRIPT static bool
20293receiveEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20294{
20295 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20298( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20296 "TestJSImplInterface", "receiveEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20298( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20297 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20298( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20298 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20298( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20299
20300 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20301 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20302 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20303 if (objIsXray) {
20304 unwrappedObj.emplace(cx, obj);
20305 }
20306 if (objIsXray) {
20307 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20308 // we know Xrays have no dynamic unwrap behavior.
20309 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20310 if (!unwrappedObj.ref()) {
20311 return false;
20312 }
20313 }
20314 FastErrorResult rv;
20315 MyTestEnum result(MOZ_KnownLive(self)(self)->ReceiveEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum"
)), 0))
) {
20317 return false;
20318 }
20319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20319); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20320 if (!ToJSValue(cx, result, args.rval())) {
20321 return false;
20322 }
20323 return true;
20324}
20325
20326static const JSJitInfo receiveEnum_methodinfo = {
20327 { (JSJitGetterOp)receiveEnum },
20328 { prototypes::id::TestJSImplInterface },
20329 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20330 JSJitInfo::Method,
20331 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20332 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20333 false, /* isInfallible. False in setters. */
20334 false, /* isMovable. Not relevant for setters. */
20335 false, /* isEliminatable. Not relevant for setters. */
20336 false, /* isAlwaysInSlot. Only relevant for getters. */
20337 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20338 false, /* isTypedMethod. Only relevant for methods. */
20339 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20340};
20341
20342MOZ_CAN_RUN_SCRIPT static bool
20343receiveNullableEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20344{
20345 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20348( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20346 "TestJSImplInterface", "receiveNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20348( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20347 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20348( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20348 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20348( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20349
20350 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20351 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20352 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20353 if (objIsXray) {
20354 unwrappedObj.emplace(cx, obj);
20355 }
20356 if (objIsXray) {
20357 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20358 // we know Xrays have no dynamic unwrap behavior.
20359 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20360 if (!unwrappedObj.ref()) {
20361 return false;
20362 }
20363 }
20364 FastErrorResult rv;
20365 Nullable<MyTestEnum> result(MOZ_KnownLive(self)(self)->ReceiveNullableEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20366 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum"
)), 0))
) {
20367 return false;
20368 }
20369 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20369); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20369); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20370 if (result.IsNull()) {
20371 args.rval().setNull();
20372 return true;
20373 } else {
20374 if (!ToJSValue(cx, result.Value(), args.rval())) {
20375 return false;
20376 }
20377 return true;
20378 }
20379}
20380
20381static const JSJitInfo receiveNullableEnum_methodinfo = {
20382 { (JSJitGetterOp)receiveNullableEnum },
20383 { prototypes::id::TestJSImplInterface },
20384 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20385 JSJitInfo::Method,
20386 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20387 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
20388 false, /* isInfallible. False in setters. */
20389 false, /* isMovable. Not relevant for setters. */
20390 false, /* isEliminatable. Not relevant for setters. */
20391 false, /* isAlwaysInSlot. Only relevant for getters. */
20392 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20393 false, /* isTypedMethod. Only relevant for methods. */
20394 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20395};
20396
20397MOZ_CAN_RUN_SCRIPT static bool
20398get_enumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
20399{
20400 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20403( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20401 "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20403( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20402 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20403( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20403 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20403( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20404
20405 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20406 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20407 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20408 if (objIsXray) {
20409 unwrappedObj.emplace(cx, obj);
20410 }
20411 if (objIsXray) {
20412 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20413 // we know Xrays have no dynamic unwrap behavior.
20414 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20415 if (!unwrappedObj.ref()) {
20416 return false;
20417 }
20418 }
20419 FastErrorResult rv;
20420 MyTestEnum result(MOZ_KnownLive(self)(self)->GetEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20421 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter"
)), 0))
) {
20422 return false;
20423 }
20424 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20424); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20424); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20425 if (!ToJSValue(cx, result, args.rval())) {
20426 return false;
20427 }
20428 return true;
20429}
20430
20431MOZ_CAN_RUN_SCRIPT static bool
20432set_enumAttribute(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
20433{
20434 BindingCallContext cx(cx_, "TestJSImplInterface.enumAttribute setter");
20435 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20438( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20436 "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20438( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20437 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject20438( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20438 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20438( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20439
20440 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20441 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20442 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20443 if (objIsXray) {
20444 unwrappedObj.emplace(cx, obj);
20445 }
20446 MyTestEnum arg0;
20447 {
20448 int index;
20449 if (!binding_detail::FindEnumStringIndex<false>(cx, args[0],
20450 binding_detail::EnumStrings<MyTestEnum>::Values,
20451 "MyTestEnum", "value being assigned",
20452 &index)) {
20453 return false;
20454 }
20455 if (index < 0) {
20456 return true;
20457 }
20458 arg0 = static_cast<MyTestEnum>(index);
20459 }
20460 if (objIsXray) {
20461 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20462 // we know Xrays have no dynamic unwrap behavior.
20463 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20464 if (!unwrappedObj.ref()) {
20465 return false;
20466 }
20467 }
20468 FastErrorResult rv;
20469 // NOTE: This assert does NOT call the function.
20470 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");
20471 MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20472 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter"
)), 0))
) {
20473 return false;
20474 }
20475 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20475); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20475); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20476
20477 return true;
20478}
20479
20480static const JSJitInfo enumAttribute_getterinfo = {
20481 { get_enumAttribute },
20482 { prototypes::id::TestJSImplInterface },
20483 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20484 JSJitInfo::Getter,
20485 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20486 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20487 false, /* isInfallible. False in setters. */
20488 false, /* isMovable. Not relevant for setters. */
20489 false, /* isEliminatable. Not relevant for setters. */
20490 false, /* isAlwaysInSlot. Only relevant for getters. */
20491 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20492 false, /* isTypedMethod. Only relevant for methods. */
20493 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20494};
20495static const JSJitInfo enumAttribute_setterinfo = {
20496 { (JSJitGetterOp)set_enumAttribute },
20497 { prototypes::id::TestJSImplInterface },
20498 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20499 JSJitInfo::Setter,
20500 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20501 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20502 false, /* isInfallible. False in setters. */
20503 false, /* isMovable. Not relevant for setters. */
20504 false, /* isEliminatable. Not relevant for setters. */
20505 false, /* isAlwaysInSlot. Only relevant for getters. */
20506 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20507 false, /* isTypedMethod. Only relevant for methods. */
20508 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20509};
20510
20511MOZ_CAN_RUN_SCRIPT static bool
20512get_readonlyEnumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
20513{
20514 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20517( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20515 "TestJSImplInterface", "readonlyEnumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20517( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20516 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20517( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20517 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20517( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20518
20519 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20520 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20521 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20522 if (objIsXray) {
20523 unwrappedObj.emplace(cx, obj);
20524 }
20525 if (objIsXray) {
20526 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20527 // we know Xrays have no dynamic unwrap behavior.
20528 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20529 if (!unwrappedObj.ref()) {
20530 return false;
20531 }
20532 }
20533 FastErrorResult rv;
20534 MyTestEnum result(MOZ_KnownLive(self)(self)->GetReadonlyEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20535 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter"
)), 0))
) {
20536 return false;
20537 }
20538 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20538); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20539 if (!ToJSValue(cx, result, args.rval())) {
20540 return false;
20541 }
20542 return true;
20543}
20544
20545static const JSJitInfo readonlyEnumAttribute_getterinfo = {
20546 { get_readonlyEnumAttribute },
20547 { prototypes::id::TestJSImplInterface },
20548 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20549 JSJitInfo::Getter,
20550 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20551 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20552 false, /* isInfallible. False in setters. */
20553 false, /* isMovable. Not relevant for setters. */
20554 false, /* isEliminatable. Not relevant for setters. */
20555 false, /* isAlwaysInSlot. Only relevant for getters. */
20556 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20557 false, /* isTypedMethod. Only relevant for methods. */
20558 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20559};
20560
20561MOZ_CAN_RUN_SCRIPT static bool
20562passCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20563{
20564 BindingCallContext cx(cx_, "TestJSImplInterface.passCallback");
20565 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20568( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20566 "TestJSImplInterface", "passCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20568( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20567 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20568( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20568 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20568( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20569
20570 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20571 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCallback", 1)) {
20572 return false;
20573 }
20574 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20575 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20576 if (objIsXray) {
20577 unwrappedObj.emplace(cx, obj);
20578 }
20579 RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx);
20580 if (args[0].isObject()) {
20581 if (JS::IsCallable(&args[0].toObject())) {
20582 { // scope for tempRoot and tempGlobalRoot if needed
20583 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20584 }
20585 } else {
20586 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20587 return false;
20588 }
20589 } else {
20590 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20591 return false;
20592 }
20593 if (objIsXray) {
20594 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20595 // we know Xrays have no dynamic unwrap behavior.
20596 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20597 if (!unwrappedObj.ref()) {
20598 return false;
20599 }
20600 }
20601 FastErrorResult rv;
20602 // NOTE: This assert does NOT call the function.
20603 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");
20604 MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20605 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback"
)), 0))
) {
20606 return false;
20607 }
20608 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20608); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20608); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20609 args.rval().setUndefined();
20610 return true;
20611}
20612
20613static const JSJitInfo passCallback_methodinfo = {
20614 { (JSJitGetterOp)passCallback },
20615 { prototypes::id::TestJSImplInterface },
20616 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20617 JSJitInfo::Method,
20618 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20619 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20620 false, /* isInfallible. False in setters. */
20621 false, /* isMovable. Not relevant for setters. */
20622 false, /* isEliminatable. Not relevant for setters. */
20623 false, /* isAlwaysInSlot. Only relevant for getters. */
20624 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20625 false, /* isTypedMethod. Only relevant for methods. */
20626 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20627};
20628
20629MOZ_CAN_RUN_SCRIPT static bool
20630passNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20631{
20632 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCallback");
20633 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20636( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20634 "TestJSImplInterface", "passNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20636( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20635 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20636( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20636 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20636( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20637
20638 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20639 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCallback", 1)) {
20640 return false;
20641 }
20642 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20643 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20644 if (objIsXray) {
20645 unwrappedObj.emplace(cx, obj);
20646 }
20647 RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx);
20648 if (args[0].isObject()) {
20649 if (JS::IsCallable(&args[0].toObject())) {
20650 { // scope for tempRoot and tempGlobalRoot if needed
20651 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20652 }
20653 } else {
20654 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20655 return false;
20656 }
20657 } else if (args[0].isNullOrUndefined()) {
20658 arg0 = nullptr;
20659 } else {
20660 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20661 return false;
20662 }
20663 if (objIsXray) {
20664 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20665 // we know Xrays have no dynamic unwrap behavior.
20666 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20667 if (!unwrappedObj.ref()) {
20668 return false;
20669 }
20670 }
20671 FastErrorResult rv;
20672 // NOTE: This assert does NOT call the function.
20673 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");
20674 MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20675 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback"
)), 0))
) {
20676 return false;
20677 }
20678 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20678); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20678); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20679 args.rval().setUndefined();
20680 return true;
20681}
20682
20683static const JSJitInfo passNullableCallback_methodinfo = {
20684 { (JSJitGetterOp)passNullableCallback },
20685 { prototypes::id::TestJSImplInterface },
20686 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20687 JSJitInfo::Method,
20688 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20689 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20690 false, /* isInfallible. False in setters. */
20691 false, /* isMovable. Not relevant for setters. */
20692 false, /* isEliminatable. Not relevant for setters. */
20693 false, /* isAlwaysInSlot. Only relevant for getters. */
20694 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20695 false, /* isTypedMethod. Only relevant for methods. */
20696 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20697};
20698
20699MOZ_CAN_RUN_SCRIPT static bool
20700passOptionalCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20701{
20702 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallback");
20703 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20706( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20704 "TestJSImplInterface", "passOptionalCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20706( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20705 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20706( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20706 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20706( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20707
20708 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20709 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20710 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20711 if (objIsXray) {
20712 unwrappedObj.emplace(cx, obj);
20713 }
20714 Optional<OwningNonNull<MyTestCallback>> arg0;
20715 if (args.hasDefined(0)) {
20716 arg0.Construct();
20717 if (args[0].isObject()) {
20718 if (JS::IsCallable(&args[0].toObject())) {
20719 { // scope for tempRoot and tempGlobalRoot if needed
20720 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
20721 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
20722 arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
20723 }
20724 } else {
20725 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20726 return false;
20727 }
20728 } else {
20729 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20730 return false;
20731 }
20732 }
20733 if (objIsXray) {
20734 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20735 // we know Xrays have no dynamic unwrap behavior.
20736 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20737 if (!unwrappedObj.ref()) {
20738 return false;
20739 }
20740 }
20741 FastErrorResult rv;
20742 // NOTE: This assert does NOT call the function.
20743 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");
20744 MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20745 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback"
)), 0))
) {
20746 return false;
20747 }
20748 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20748); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20748); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20749 args.rval().setUndefined();
20750 return true;
20751}
20752
20753static const JSJitInfo passOptionalCallback_methodinfo = {
20754 { (JSJitGetterOp)passOptionalCallback },
20755 { prototypes::id::TestJSImplInterface },
20756 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20757 JSJitInfo::Method,
20758 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20759 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20760 false, /* isInfallible. False in setters. */
20761 false, /* isMovable. Not relevant for setters. */
20762 false, /* isEliminatable. Not relevant for setters. */
20763 false, /* isAlwaysInSlot. Only relevant for getters. */
20764 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20765 false, /* isTypedMethod. Only relevant for methods. */
20766 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20767};
20768
20769MOZ_CAN_RUN_SCRIPT static bool
20770passOptionalNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20771{
20772 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallback");
20773 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20776( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20774 "TestJSImplInterface", "passOptionalNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20776( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20775 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20776( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20776 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20776( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20777
20778 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20779 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20780 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20781 if (objIsXray) {
20782 unwrappedObj.emplace(cx, obj);
20783 }
20784 Optional<RefPtr<MyTestCallback>> arg0;
20785 if (args.hasDefined(0)) {
20786 arg0.Construct();
20787 if (args[0].isObject()) {
20788 if (JS::IsCallable(&args[0].toObject())) {
20789 { // scope for tempRoot and tempGlobalRoot if needed
20790 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
20791 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
20792 arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
20793 }
20794 } else {
20795 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20796 return false;
20797 }
20798 } else if (args[0].isNullOrUndefined()) {
20799 arg0.Value() = nullptr;
20800 } else {
20801 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20802 return false;
20803 }
20804 }
20805 if (objIsXray) {
20806 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20807 // we know Xrays have no dynamic unwrap behavior.
20808 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20809 if (!unwrappedObj.ref()) {
20810 return false;
20811 }
20812 }
20813 FastErrorResult rv;
20814 // NOTE: This assert does NOT call the function.
20815 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");
20816 MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20817 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback"
)), 0))
) {
20818 return false;
20819 }
20820 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20820); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20820); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20821 args.rval().setUndefined();
20822 return true;
20823}
20824
20825static const JSJitInfo passOptionalNullableCallback_methodinfo = {
20826 { (JSJitGetterOp)passOptionalNullableCallback },
20827 { prototypes::id::TestJSImplInterface },
20828 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20829 JSJitInfo::Method,
20830 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20831 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20832 false, /* isInfallible. False in setters. */
20833 false, /* isMovable. Not relevant for setters. */
20834 false, /* isEliminatable. Not relevant for setters. */
20835 false, /* isAlwaysInSlot. Only relevant for getters. */
20836 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20837 false, /* isTypedMethod. Only relevant for methods. */
20838 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20839};
20840
20841MOZ_CAN_RUN_SCRIPT static bool
20842passOptionalNullableCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20843{
20844 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue");
20845 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20848( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20846 "TestJSImplInterface", "passOptionalNullableCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20848( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20847 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20848( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20848 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20848( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20849
20850 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20851 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20852 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20853 if (objIsXray) {
20854 unwrappedObj.emplace(cx, obj);
20855 }
20856 RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx);
20857 if (args.hasDefined(0)) {
20858 if (args[0].isObject()) {
20859 if (JS::IsCallable(&args[0].toObject())) {
20860 { // scope for tempRoot and tempGlobalRoot if needed
20861 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20862 }
20863 } else {
20864 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20865 return false;
20866 }
20867 } else if (args[0].isNullOrUndefined()) {
20868 arg0 = nullptr;
20869 } else {
20870 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20871 return false;
20872 }
20873 } else {
20874 arg0 = nullptr;
20875 }
20876 if (objIsXray) {
20877 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20878 // we know Xrays have no dynamic unwrap behavior.
20879 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20880 if (!unwrappedObj.ref()) {
20881 return false;
20882 }
20883 }
20884 FastErrorResult rv;
20885 // NOTE: This assert does NOT call the function.
20886 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");
20887 MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20888 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"
)), 0))
) {
20889 return false;
20890 }
20891 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20891); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20891); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20892 args.rval().setUndefined();
20893 return true;
20894}
20895
20896static const JSJitInfo passOptionalNullableCallbackWithDefaultValue_methodinfo = {
20897 { (JSJitGetterOp)passOptionalNullableCallbackWithDefaultValue },
20898 { prototypes::id::TestJSImplInterface },
20899 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20900 JSJitInfo::Method,
20901 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20902 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20903 false, /* isInfallible. False in setters. */
20904 false, /* isMovable. Not relevant for setters. */
20905 false, /* isEliminatable. Not relevant for setters. */
20906 false, /* isAlwaysInSlot. Only relevant for getters. */
20907 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20908 false, /* isTypedMethod. Only relevant for methods. */
20909 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20910};
20911
20912MOZ_CAN_RUN_SCRIPT static bool
20913receiveCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20914{
20915 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20918( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20916 "TestJSImplInterface", "receiveCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20918( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20917 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20918( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20918 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20918( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20919
20920 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20921 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20922 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20923 if (objIsXray) {
20924 unwrappedObj.emplace(cx, obj);
20925 }
20926 if (objIsXray) {
20927 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20928 // we know Xrays have no dynamic unwrap behavior.
20929 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20930 if (!unwrappedObj.ref()) {
20931 return false;
20932 }
20933 }
20934 FastErrorResult rv;
20935 RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20936 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback"
)), 0))
) {
20937 return false;
20938 }
20939 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20939); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20939); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20940 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
20941 if (!MaybeWrapObjectValue(cx, args.rval())) {
20942 return false;
20943 }
20944 return true;
20945}
20946
20947static const JSJitInfo receiveCallback_methodinfo = {
20948 { (JSJitGetterOp)receiveCallback },
20949 { prototypes::id::TestJSImplInterface },
20950 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20951 JSJitInfo::Method,
20952 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20953 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
20954 false, /* isInfallible. False in setters. */
20955 false, /* isMovable. Not relevant for setters. */
20956 false, /* isEliminatable. Not relevant for setters. */
20957 false, /* isAlwaysInSlot. Only relevant for getters. */
20958 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20959 false, /* isTypedMethod. Only relevant for methods. */
20960 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20961};
20962
20963MOZ_CAN_RUN_SCRIPT static bool
20964receiveNullableCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20965{
20966 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20969( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20967 "TestJSImplInterface", "receiveNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20969( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20968 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20969( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20969 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20969( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20970
20971 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20972 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20973 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20974 if (objIsXray) {
20975 unwrappedObj.emplace(cx, obj);
20976 }
20977 if (objIsXray) {
20978 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20979 // we know Xrays have no dynamic unwrap behavior.
20980 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20981 if (!unwrappedObj.ref()) {
20982 return false;
20983 }
20984 }
20985 FastErrorResult rv;
20986 RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveNullableCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20987 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback"
)), 0))
) {
20988 return false;
20989 }
20990 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20990); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 20990); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
20991 if (result) {
20992 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
20993 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
20994 return false;
20995 }
20996 return true;
20997 } else {
20998 args.rval().setNull();
20999 return true;
21000 }
21001}
21002
21003static const JSJitInfo receiveNullableCallback_methodinfo = {
21004 { (JSJitGetterOp)receiveNullableCallback },
21005 { prototypes::id::TestJSImplInterface },
21006 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21007 JSJitInfo::Method,
21008 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21009 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
21010 false, /* isInfallible. False in setters. */
21011 false, /* isMovable. Not relevant for setters. */
21012 false, /* isEliminatable. Not relevant for setters. */
21013 false, /* isAlwaysInSlot. Only relevant for getters. */
21014 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21015 false, /* isTypedMethod. Only relevant for methods. */
21016 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21017};
21018
21019MOZ_CAN_RUN_SCRIPT static bool
21020passOptionalNullableTreatAsNullCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21021{
21022 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue");
21023 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21026( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21024 "TestJSImplInterface", "passOptionalNullableTreatAsNullCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21026( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21025 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21026( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21026 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21026( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
21027
21028 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21029 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21030 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21031 if (objIsXray) {
21032 unwrappedObj.emplace(cx, obj);
21033 }
21034 RootedCallback<RefPtr<binding_detail::FastTestTreatAsNullCallback>> arg0(cx);
21035 if (args.hasDefined(0)) {
21036 if (args[0].isObject()) {
21037 if (JS::IsCallable(&args[0].toObject())) {
21038 { // scope for tempRoot and tempGlobalRoot if needed
21039 arg0 = new binding_detail::FastTestTreatAsNullCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
21040 }
21041 } else {
21042 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
21043 return false;
21044 }
21045 } else if (args[0].isNullOrUndefined()) {
21046 arg0 = nullptr;
21047 } else {
21048 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
21049 return false;
21050 }
21051 } else {
21052 arg0 = nullptr;
21053 }
21054 if (objIsXray) {
21055 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21056 // we know Xrays have no dynamic unwrap behavior.
21057 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21058 if (!unwrappedObj.ref()) {
21059 return false;
21060 }
21061 }
21062 FastErrorResult rv;
21063 // NOTE: This assert does NOT call the function.
21064 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");
21065 MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21066 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"
)), 0))
) {
21067 return false;
21068 }
21069 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21069); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21070 args.rval().setUndefined();
21071 return true;
21072}
21073
21074static const JSJitInfo passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo = {
21075 { (JSJitGetterOp)passOptionalNullableTreatAsNullCallbackWithDefaultValue },
21076 { prototypes::id::TestJSImplInterface },
21077 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21078 JSJitInfo::Method,
21079 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21080 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21081 false, /* isInfallible. False in setters. */
21082 false, /* isMovable. Not relevant for setters. */
21083 false, /* isEliminatable. Not relevant for setters. */
21084 false, /* isAlwaysInSlot. Only relevant for getters. */
21085 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21086 false, /* isTypedMethod. Only relevant for methods. */
21087 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21088};
21089
21090MOZ_CAN_RUN_SCRIPT static bool
21091passAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21092{
21093 BindingCallContext cx(cx_, "TestJSImplInterface.passAny");
21094 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21097( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21095 "TestJSImplInterface", "passAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21097( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21096 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21097( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21097 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21097( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
21098
21099 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21100 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAny", 1)) {
21101 return false;
21102 }
21103 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21104 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21105 if (objIsXray) {
21106 unwrappedObj.emplace(cx, obj);
21107 }
21108 JS::Rooted<JS::Value> arg0(cx);
21109#ifdef __clang__1
21110#pragma clang diagnostic push
21111#pragma clang diagnostic ignored "-Wunreachable-code"
21112#pragma clang diagnostic ignored "-Wunreachable-code-return"
21113#endif // __clang__
21114 if ((true) && !CallerSubsumes(args[0])) {
21115 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21116 return false;
21117 }
21118#ifdef __clang__1
21119#pragma clang diagnostic pop
21120#endif // __clang__
21121 arg0 = args[0];
21122 if (objIsXray) {
21123 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21124 // we know Xrays have no dynamic unwrap behavior.
21125 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21126 if (!unwrappedObj.ref()) {
21127 return false;
21128 }
21129 }
21130 FastErrorResult rv;
21131 // NOTE: This assert does NOT call the function.
21132 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");
21133 MOZ_KnownLive(self)(self)->PassAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21134 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny"
)), 0))
) {
21135 return false;
21136 }
21137 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21137); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21137); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21138 args.rval().setUndefined();
21139 return true;
21140}
21141
21142static const JSJitInfo passAny_methodinfo = {
21143 { (JSJitGetterOp)passAny },
21144 { prototypes::id::TestJSImplInterface },
21145 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21146 JSJitInfo::Method,
21147 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21148 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21149 false, /* isInfallible. False in setters. */
21150 false, /* isMovable. Not relevant for setters. */
21151 false, /* isEliminatable. Not relevant for setters. */
21152 false, /* isAlwaysInSlot. Only relevant for getters. */
21153 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21154 false, /* isTypedMethod. Only relevant for methods. */
21155 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21156};
21157
21158MOZ_CAN_RUN_SCRIPT static bool
21159passVariadicAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21160{
21161 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicAny");
21162 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21165( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21163 "TestJSImplInterface", "passVariadicAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21165( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21164 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21165( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21165 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21165( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21166
21167 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21168 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21169 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21170 if (objIsXray) {
21171 unwrappedObj.emplace(cx, obj);
21172 }
21173 AutoSequence<JS::Value> arg0;
21174 SequenceRooter<JS::Value> arg0_holder(cx, &arg0);
21175 if (args.length() > 0) {
21176 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
21177 JS_ReportOutOfMemory(cx);
21178 return false;
21179 }
21180 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
21181 // OK to do infallible append here, since we ensured capacity already.
21182 JS::Value& slot = *arg0.AppendElement();
21183#ifdef __clang__1
21184#pragma clang diagnostic push
21185#pragma clang diagnostic ignored "-Wunreachable-code"
21186#pragma clang diagnostic ignored "-Wunreachable-code-return"
21187#endif // __clang__
21188 if ((true) && !CallerSubsumes(args[variadicArg])) {
21189 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21190 return false;
21191 }
21192#ifdef __clang__1
21193#pragma clang diagnostic pop
21194#endif // __clang__
21195 slot = args[variadicArg];
21196 }
21197 }
21198 if (objIsXray) {
21199 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21200 // we know Xrays have no dynamic unwrap behavior.
21201 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21202 if (!unwrappedObj.ref()) {
21203 return false;
21204 }
21205 }
21206 FastErrorResult rv;
21207 // NOTE: This assert does NOT call the function.
21208 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");
21209 MOZ_KnownLive(self)(self)->PassVariadicAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21210 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny"
)), 0))
) {
21211 return false;
21212 }
21213 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21213); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21213); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21214 args.rval().setUndefined();
21215 return true;
21216}
21217
21218static const JSJitInfo passVariadicAny_methodinfo = {
21219 { (JSJitGetterOp)passVariadicAny },
21220 { prototypes::id::TestJSImplInterface },
21221 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21222 JSJitInfo::Method,
21223 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21224 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21225 false, /* isInfallible. False in setters. */
21226 false, /* isMovable. Not relevant for setters. */
21227 false, /* isEliminatable. Not relevant for setters. */
21228 false, /* isAlwaysInSlot. Only relevant for getters. */
21229 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21230 false, /* isTypedMethod. Only relevant for methods. */
21231 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21232};
21233
21234MOZ_CAN_RUN_SCRIPT static bool
21235passOptionalAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21236{
21237 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalAny");
21238 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21241( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21239 "TestJSImplInterface", "passOptionalAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21241( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21240 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21241( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21241 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21241( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21242
21243 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21244 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21245 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21246 if (objIsXray) {
21247 unwrappedObj.emplace(cx, obj);
21248 }
21249 JS::Rooted<JS::Value> arg0(cx);
21250 if (args.hasDefined(0)) {
21251#ifdef __clang__1
21252#pragma clang diagnostic push
21253#pragma clang diagnostic ignored "-Wunreachable-code"
21254#pragma clang diagnostic ignored "-Wunreachable-code-return"
21255#endif // __clang__
21256 if ((true) && !CallerSubsumes(args[0])) {
21257 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21258 return false;
21259 }
21260#ifdef __clang__1
21261#pragma clang diagnostic pop
21262#endif // __clang__
21263 arg0 = args[0];
21264 } else {
21265 arg0 = JS::UndefinedValue();
21266 }
21267 if (objIsXray) {
21268 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21269 // we know Xrays have no dynamic unwrap behavior.
21270 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21271 if (!unwrappedObj.ref()) {
21272 return false;
21273 }
21274 }
21275 FastErrorResult rv;
21276 // NOTE: This assert does NOT call the function.
21277 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");
21278 MOZ_KnownLive(self)(self)->PassOptionalAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21279 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny"
)), 0))
) {
21280 return false;
21281 }
21282 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21282); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21282); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21283 args.rval().setUndefined();
21284 return true;
21285}
21286
21287static const JSJitInfo passOptionalAny_methodinfo = {
21288 { (JSJitGetterOp)passOptionalAny },
21289 { prototypes::id::TestJSImplInterface },
21290 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21291 JSJitInfo::Method,
21292 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21293 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21294 false, /* isInfallible. False in setters. */
21295 false, /* isMovable. Not relevant for setters. */
21296 false, /* isEliminatable. Not relevant for setters. */
21297 false, /* isAlwaysInSlot. Only relevant for getters. */
21298 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21299 false, /* isTypedMethod. Only relevant for methods. */
21300 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21301};
21302
21303MOZ_CAN_RUN_SCRIPT static bool
21304passAnyDefaultNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21305{
21306 BindingCallContext cx(cx_, "TestJSImplInterface.passAnyDefaultNull");
21307 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21310( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21308 "TestJSImplInterface", "passAnyDefaultNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21310( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21309 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21310( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21310 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21310( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21311
21312 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21313 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21314 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21315 if (objIsXray) {
21316 unwrappedObj.emplace(cx, obj);
21317 }
21318 JS::Rooted<JS::Value> arg0(cx);
21319 if (args.hasDefined(0)) {
21320#ifdef __clang__1
21321#pragma clang diagnostic push
21322#pragma clang diagnostic ignored "-Wunreachable-code"
21323#pragma clang diagnostic ignored "-Wunreachable-code-return"
21324#endif // __clang__
21325 if ((true) && !CallerSubsumes(args[0])) {
21326 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21327 return false;
21328 }
21329#ifdef __clang__1
21330#pragma clang diagnostic pop
21331#endif // __clang__
21332 arg0 = args[0];
21333 } else {
21334 arg0 = JS::NullValue();
21335 }
21336 if (objIsXray) {
21337 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21338 // we know Xrays have no dynamic unwrap behavior.
21339 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21340 if (!unwrappedObj.ref()) {
21341 return false;
21342 }
21343 }
21344 FastErrorResult rv;
21345 // NOTE: This assert does NOT call the function.
21346 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");
21347 MOZ_KnownLive(self)(self)->PassAnyDefaultNull(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21348 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull"
)), 0))
) {
21349 return false;
21350 }
21351 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21351); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21351); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21352 args.rval().setUndefined();
21353 return true;
21354}
21355
21356static const JSJitInfo passAnyDefaultNull_methodinfo = {
21357 { (JSJitGetterOp)passAnyDefaultNull },
21358 { prototypes::id::TestJSImplInterface },
21359 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21360 JSJitInfo::Method,
21361 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21362 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21363 false, /* isInfallible. False in setters. */
21364 false, /* isMovable. Not relevant for setters. */
21365 false, /* isEliminatable. Not relevant for setters. */
21366 false, /* isAlwaysInSlot. Only relevant for getters. */
21367 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21368 false, /* isTypedMethod. Only relevant for methods. */
21369 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21370};
21371
21372MOZ_CAN_RUN_SCRIPT static bool
21373passSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21374{
21375 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfAny");
21376 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21379( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21377 "TestJSImplInterface", "passSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21379( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21378 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21379( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21379 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21379( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21380
21381 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21382 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfAny", 1)) {
21383 return false;
21384 }
21385 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21386 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21387 if (objIsXray) {
21388 unwrappedObj.emplace(cx, obj);
21389 }
21390 binding_detail::AutoSequence<JS::Value> arg0;
21391 SequenceRooter<JS::Value> arg0_holder(cx, &arg0);
21392 if (args[0].isObject()) {
21393 JS::ForOfIterator iter(cx);
21394 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21395 return false;
21396 }
21397 if (!iter.valueIsIterable()) {
21398 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21399 return false;
21400 }
21401 binding_detail::AutoSequence<JS::Value> &arr = arg0;
21402 JS::Rooted<JS::Value> temp(cx);
21403 while (true) {
21404 bool done;
21405 if (!iter.next(&temp, &done)) {
21406 return false;
21407 }
21408 if (done) {
21409 break;
21410 }
21411 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21412 if (!slotPtr) {
21413 JS_ReportOutOfMemory(cx);
21414 return false;
21415 }
21416 JS::Value& slot = *slotPtr;
21417#ifdef __clang__1
21418#pragma clang diagnostic push
21419#pragma clang diagnostic ignored "-Wunreachable-code"
21420#pragma clang diagnostic ignored "-Wunreachable-code-return"
21421#endif // __clang__
21422 if ((true) && !CallerSubsumes(temp)) {
21423 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21424 return false;
21425 }
21426#ifdef __clang__1
21427#pragma clang diagnostic pop
21428#endif // __clang__
21429 slot = temp;
21430 }
21431 } else {
21432 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21433 return false;
21434 }
21435 if (objIsXray) {
21436 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21437 // we know Xrays have no dynamic unwrap behavior.
21438 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21439 if (!unwrappedObj.ref()) {
21440 return false;
21441 }
21442 }
21443 FastErrorResult rv;
21444 // NOTE: This assert does NOT call the function.
21445 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");
21446 MOZ_KnownLive(self)(self)->PassSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21447 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny"
)), 0))
) {
21448 return false;
21449 }
21450 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21450); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21451 args.rval().setUndefined();
21452 return true;
21453}
21454
21455static const JSJitInfo passSequenceOfAny_methodinfo = {
21456 { (JSJitGetterOp)passSequenceOfAny },
21457 { prototypes::id::TestJSImplInterface },
21458 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21459 JSJitInfo::Method,
21460 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21461 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21462 false, /* isInfallible. False in setters. */
21463 false, /* isMovable. Not relevant for setters. */
21464 false, /* isEliminatable. Not relevant for setters. */
21465 false, /* isAlwaysInSlot. Only relevant for getters. */
21466 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21467 false, /* isTypedMethod. Only relevant for methods. */
21468 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21469};
21470
21471MOZ_CAN_RUN_SCRIPT static bool
21472passNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21473{
21474 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfAny");
21475 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21478( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21476 "TestJSImplInterface", "passNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21478( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21477 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21478( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21478 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21478( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21479
21480 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21481 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfAny", 1)) {
21482 return false;
21483 }
21484 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21485 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21486 if (objIsXray) {
21487 unwrappedObj.emplace(cx, obj);
21488 }
21489 Nullable<Sequence<JS::Value>> arg0;
21490 SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue());
21491 if (args[0].isObject()) {
21492 JS::ForOfIterator iter(cx);
21493 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21494 return false;
21495 }
21496 if (!iter.valueIsIterable()) {
21497 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21498 return false;
21499 }
21500 Sequence<JS::Value> &arr = arg0.SetValue();
21501 JS::Rooted<JS::Value> temp(cx);
21502 while (true) {
21503 bool done;
21504 if (!iter.next(&temp, &done)) {
21505 return false;
21506 }
21507 if (done) {
21508 break;
21509 }
21510 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21511 if (!slotPtr) {
21512 JS_ReportOutOfMemory(cx);
21513 return false;
21514 }
21515 JS::Value& slot = *slotPtr;
21516#ifdef __clang__1
21517#pragma clang diagnostic push
21518#pragma clang diagnostic ignored "-Wunreachable-code"
21519#pragma clang diagnostic ignored "-Wunreachable-code-return"
21520#endif // __clang__
21521 if ((true) && !CallerSubsumes(temp)) {
21522 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21523 return false;
21524 }
21525#ifdef __clang__1
21526#pragma clang diagnostic pop
21527#endif // __clang__
21528 slot = temp;
21529 }
21530 } else if (args[0].isNullOrUndefined()) {
21531 arg0.SetNull();
21532 } else {
21533 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21534 return false;
21535 }
21536 if (objIsXray) {
21537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21538 // we know Xrays have no dynamic unwrap behavior.
21539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21540 if (!unwrappedObj.ref()) {
21541 return false;
21542 }
21543 }
21544 FastErrorResult rv;
21545 // NOTE: This assert does NOT call the function.
21546 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");
21547 MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny"
)), 0))
) {
21549 return false;
21550 }
21551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21551); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21552 args.rval().setUndefined();
21553 return true;
21554}
21555
21556static const JSJitInfo passNullableSequenceOfAny_methodinfo = {
21557 { (JSJitGetterOp)passNullableSequenceOfAny },
21558 { prototypes::id::TestJSImplInterface },
21559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21560 JSJitInfo::Method,
21561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21563 false, /* isInfallible. False in setters. */
21564 false, /* isMovable. Not relevant for setters. */
21565 false, /* isEliminatable. Not relevant for setters. */
21566 false, /* isAlwaysInSlot. Only relevant for getters. */
21567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21568 false, /* isTypedMethod. Only relevant for methods. */
21569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21570};
21571
21572MOZ_CAN_RUN_SCRIPT static bool
21573passOptionalSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21574{
21575 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAny");
21576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21579( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21577 "TestJSImplInterface", "passOptionalSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21579( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21579( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21579( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21580
21581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21584 if (objIsXray) {
21585 unwrappedObj.emplace(cx, obj);
21586 }
21587 Optional<Sequence<JS::Value>> arg0;
21588 Maybe<SequenceRooter<JS::Value>> arg0_holder;
21589 if (args.hasDefined(0)) {
21590 arg0.Construct();
21591 arg0_holder.emplace(cx, &arg0.Value());
21592 if (args[0].isObject()) {
21593 JS::ForOfIterator iter(cx);
21594 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21595 return false;
21596 }
21597 if (!iter.valueIsIterable()) {
21598 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21599 return false;
21600 }
21601 Sequence<JS::Value> &arr = arg0.Value();
21602 JS::Rooted<JS::Value> temp(cx);
21603 while (true) {
21604 bool done;
21605 if (!iter.next(&temp, &done)) {
21606 return false;
21607 }
21608 if (done) {
21609 break;
21610 }
21611 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21612 if (!slotPtr) {
21613 JS_ReportOutOfMemory(cx);
21614 return false;
21615 }
21616 JS::Value& slot = *slotPtr;
21617#ifdef __clang__1
21618#pragma clang diagnostic push
21619#pragma clang diagnostic ignored "-Wunreachable-code"
21620#pragma clang diagnostic ignored "-Wunreachable-code-return"
21621#endif // __clang__
21622 if ((true) && !CallerSubsumes(temp)) {
21623 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21624 return false;
21625 }
21626#ifdef __clang__1
21627#pragma clang diagnostic pop
21628#endif // __clang__
21629 slot = temp;
21630 }
21631 } else {
21632 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21633 return false;
21634 }
21635 }
21636 if (objIsXray) {
21637 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21638 // we know Xrays have no dynamic unwrap behavior.
21639 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21640 if (!unwrappedObj.ref()) {
21641 return false;
21642 }
21643 }
21644 FastErrorResult rv;
21645 // NOTE: This assert does NOT call the function.
21646 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");
21647 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21648 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny"
)), 0))
) {
21649 return false;
21650 }
21651 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21651); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21652 args.rval().setUndefined();
21653 return true;
21654}
21655
21656static const JSJitInfo passOptionalSequenceOfAny_methodinfo = {
21657 { (JSJitGetterOp)passOptionalSequenceOfAny },
21658 { prototypes::id::TestJSImplInterface },
21659 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21660 JSJitInfo::Method,
21661 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21662 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21663 false, /* isInfallible. False in setters. */
21664 false, /* isMovable. Not relevant for setters. */
21665 false, /* isEliminatable. Not relevant for setters. */
21666 false, /* isAlwaysInSlot. Only relevant for getters. */
21667 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21668 false, /* isTypedMethod. Only relevant for methods. */
21669 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21670};
21671
21672MOZ_CAN_RUN_SCRIPT static bool
21673passOptionalNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21674{
21675 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfAny");
21676 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21679( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21677 "TestJSImplInterface", "passOptionalNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21679( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21678 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21679( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21679 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21679( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21680
21681 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21682 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21683 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21684 if (objIsXray) {
21685 unwrappedObj.emplace(cx, obj);
21686 }
21687 Optional<Nullable<Sequence<JS::Value>>> arg0;
21688 Maybe<SequenceRooter<JS::Value>> arg0_holder;
21689 if (args.hasDefined(0)) {
21690 arg0.Construct();
21691 arg0_holder.emplace(cx, &arg0.Value().SetValue());
21692 if (args[0].isObject()) {
21693 JS::ForOfIterator iter(cx);
21694 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21695 return false;
21696 }
21697 if (!iter.valueIsIterable()) {
21698 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21699 return false;
21700 }
21701 Sequence<JS::Value> &arr = arg0.Value().SetValue();
21702 JS::Rooted<JS::Value> temp(cx);
21703 while (true) {
21704 bool done;
21705 if (!iter.next(&temp, &done)) {
21706 return false;
21707 }
21708 if (done) {
21709 break;
21710 }
21711 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21712 if (!slotPtr) {
21713 JS_ReportOutOfMemory(cx);
21714 return false;
21715 }
21716 JS::Value& slot = *slotPtr;
21717#ifdef __clang__1
21718#pragma clang diagnostic push
21719#pragma clang diagnostic ignored "-Wunreachable-code"
21720#pragma clang diagnostic ignored "-Wunreachable-code-return"
21721#endif // __clang__
21722 if ((true) && !CallerSubsumes(temp)) {
21723 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21724 return false;
21725 }
21726#ifdef __clang__1
21727#pragma clang diagnostic pop
21728#endif // __clang__
21729 slot = temp;
21730 }
21731 } else if (args[0].isNullOrUndefined()) {
21732 arg0.Value().SetNull();
21733 } else {
21734 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21735 return false;
21736 }
21737 }
21738 if (objIsXray) {
21739 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21740 // we know Xrays have no dynamic unwrap behavior.
21741 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21742 if (!unwrappedObj.ref()) {
21743 return false;
21744 }
21745 }
21746 FastErrorResult rv;
21747 // NOTE: This assert does NOT call the function.
21748 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");
21749 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21750 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny"
)), 0))
) {
21751 return false;
21752 }
21753 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21753); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21753); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21754 args.rval().setUndefined();
21755 return true;
21756}
21757
21758static const JSJitInfo passOptionalNullableSequenceOfAny_methodinfo = {
21759 { (JSJitGetterOp)passOptionalNullableSequenceOfAny },
21760 { prototypes::id::TestJSImplInterface },
21761 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21762 JSJitInfo::Method,
21763 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21764 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21765 false, /* isInfallible. False in setters. */
21766 false, /* isMovable. Not relevant for setters. */
21767 false, /* isEliminatable. Not relevant for setters. */
21768 false, /* isAlwaysInSlot. Only relevant for getters. */
21769 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21770 false, /* isTypedMethod. Only relevant for methods. */
21771 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21772};
21773
21774MOZ_CAN_RUN_SCRIPT static bool
21775passOptionalSequenceOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21776{
21777 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue");
21778 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21781( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21779 "TestJSImplInterface", "passOptionalSequenceOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21781( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21780 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21781( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21781 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21781( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21782
21783 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21784 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21785 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21786 if (objIsXray) {
21787 unwrappedObj.emplace(cx, obj);
21788 }
21789 Nullable<Sequence<JS::Value>> arg0;
21790 SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue());
21791 if (args.hasDefined(0)) {
21792 if (args[0].isObject()) {
21793 JS::ForOfIterator iter(cx);
21794 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21795 return false;
21796 }
21797 if (!iter.valueIsIterable()) {
21798 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21799 return false;
21800 }
21801 Sequence<JS::Value> &arr = arg0.SetValue();
21802 JS::Rooted<JS::Value> temp(cx);
21803 while (true) {
21804 bool done;
21805 if (!iter.next(&temp, &done)) {
21806 return false;
21807 }
21808 if (done) {
21809 break;
21810 }
21811 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21812 if (!slotPtr) {
21813 JS_ReportOutOfMemory(cx);
21814 return false;
21815 }
21816 JS::Value& slot = *slotPtr;
21817#ifdef __clang__1
21818#pragma clang diagnostic push
21819#pragma clang diagnostic ignored "-Wunreachable-code"
21820#pragma clang diagnostic ignored "-Wunreachable-code-return"
21821#endif // __clang__
21822 if ((true) && !CallerSubsumes(temp)) {
21823 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21824 return false;
21825 }
21826#ifdef __clang__1
21827#pragma clang diagnostic pop
21828#endif // __clang__
21829 slot = temp;
21830 }
21831 } else if (args[0].isNullOrUndefined()) {
21832 arg0.SetNull();
21833 } else {
21834 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21835 return false;
21836 }
21837 } else {
21838 arg0.SetNull();
21839 }
21840 if (objIsXray) {
21841 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21842 // we know Xrays have no dynamic unwrap behavior.
21843 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21844 if (!unwrappedObj.ref()) {
21845 return false;
21846 }
21847 }
21848 FastErrorResult rv;
21849 // NOTE: This assert does NOT call the function.
21850 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");
21851 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21852 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"
)), 0))
) {
21853 return false;
21854 }
21855 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21855); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21855); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21856 args.rval().setUndefined();
21857 return true;
21858}
21859
21860static const JSJitInfo passOptionalSequenceOfAnyWithDefaultValue_methodinfo = {
21861 { (JSJitGetterOp)passOptionalSequenceOfAnyWithDefaultValue },
21862 { prototypes::id::TestJSImplInterface },
21863 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21864 JSJitInfo::Method,
21865 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21866 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21867 false, /* isInfallible. False in setters. */
21868 false, /* isMovable. Not relevant for setters. */
21869 false, /* isEliminatable. Not relevant for setters. */
21870 false, /* isAlwaysInSlot. Only relevant for getters. */
21871 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21872 false, /* isTypedMethod. Only relevant for methods. */
21873 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21874};
21875
21876MOZ_CAN_RUN_SCRIPT static bool
21877passSequenceOfSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21878{
21879 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequenceOfAny");
21880 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21883( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21881 "TestJSImplInterface", "passSequenceOfSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21883( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21882 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21883( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21883 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21883( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21884
21885 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21886 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny", 1)) {
21887 return false;
21888 }
21889 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21890 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21891 if (objIsXray) {
21892 unwrappedObj.emplace(cx, obj);
21893 }
21894 binding_detail::AutoSequence<Sequence<JS::Value>> arg0;
21895 SequenceRooter<Sequence<JS::Value>> arg0_holder(cx, &arg0);
21896 if (args[0].isObject()) {
21897 JS::ForOfIterator iter(cx);
21898 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21899 return false;
21900 }
21901 if (!iter.valueIsIterable()) {
21902 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21903 return false;
21904 }
21905 binding_detail::AutoSequence<Sequence<JS::Value>> &arr = arg0;
21906 JS::Rooted<JS::Value> temp(cx);
21907 while (true) {
21908 bool done;
21909 if (!iter.next(&temp, &done)) {
21910 return false;
21911 }
21912 if (done) {
21913 break;
21914 }
21915 Sequence<JS::Value>* slotPtr = arr.AppendElement(mozilla::fallible);
21916 if (!slotPtr) {
21917 JS_ReportOutOfMemory(cx);
21918 return false;
21919 }
21920 Sequence<JS::Value>& slot = *slotPtr;
21921 if (temp.isObject()) {
21922 JS::ForOfIterator iter1(cx);
21923 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
21924 return false;
21925 }
21926 if (!iter1.valueIsIterable()) {
21927 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
21928 return false;
21929 }
21930 Sequence<JS::Value> &arr1 = slot;
21931 JS::Rooted<JS::Value> temp1(cx);
21932 while (true) {
21933 bool done1;
21934 if (!iter1.next(&temp1, &done1)) {
21935 return false;
21936 }
21937 if (done1) {
21938 break;
21939 }
21940 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
21941 if (!slotPtr1) {
21942 JS_ReportOutOfMemory(cx);
21943 return false;
21944 }
21945 JS::Value& slot1 = *slotPtr1;
21946#ifdef __clang__1
21947#pragma clang diagnostic push
21948#pragma clang diagnostic ignored "-Wunreachable-code"
21949#pragma clang diagnostic ignored "-Wunreachable-code-return"
21950#endif // __clang__
21951 if ((true) && !CallerSubsumes(temp1)) {
21952 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
21953 return false;
21954 }
21955#ifdef __clang__1
21956#pragma clang diagnostic pop
21957#endif // __clang__
21958 slot1 = temp1;
21959 }
21960 } else {
21961 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
21962 return false;
21963 }
21964 }
21965 } else {
21966 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21967 return false;
21968 }
21969 if (objIsXray) {
21970 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21971 // we know Xrays have no dynamic unwrap behavior.
21972 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21973 if (!unwrappedObj.ref()) {
21974 return false;
21975 }
21976 }
21977 FastErrorResult rv;
21978 // NOTE: This assert does NOT call the function.
21979 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");
21980 MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21981 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny"
)), 0))
) {
21982 return false;
21983 }
21984 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21984); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 21984); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
21985 args.rval().setUndefined();
21986 return true;
21987}
21988
21989static const JSJitInfo passSequenceOfSequenceOfAny_methodinfo = {
21990 { (JSJitGetterOp)passSequenceOfSequenceOfAny },
21991 { prototypes::id::TestJSImplInterface },
21992 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21993 JSJitInfo::Method,
21994 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21995 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21996 false, /* isInfallible. False in setters. */
21997 false, /* isMovable. Not relevant for setters. */
21998 false, /* isEliminatable. Not relevant for setters. */
21999 false, /* isAlwaysInSlot. Only relevant for getters. */
22000 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22001 false, /* isTypedMethod. Only relevant for methods. */
22002 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22003};
22004
22005MOZ_CAN_RUN_SCRIPT static bool
22006passSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22007{
22008 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny");
22009 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22012( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22010 "TestJSImplInterface", "passSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22012( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22011 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22012( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22012 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22012( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22013
22014 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22015 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", 1)) {
22016 return false;
22017 }
22018 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22019 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22020 if (objIsXray) {
22021 unwrappedObj.emplace(cx, obj);
22022 }
22023 binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> arg0;
22024 SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0);
22025 if (args[0].isObject()) {
22026 JS::ForOfIterator iter(cx);
22027 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
22028 return false;
22029 }
22030 if (!iter.valueIsIterable()) {
22031 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22032 return false;
22033 }
22034 binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> &arr = arg0;
22035 JS::Rooted<JS::Value> temp(cx);
22036 while (true) {
22037 bool done;
22038 if (!iter.next(&temp, &done)) {
22039 return false;
22040 }
22041 if (done) {
22042 break;
22043 }
22044 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
22045 if (!slotPtr) {
22046 JS_ReportOutOfMemory(cx);
22047 return false;
22048 }
22049 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
22050 if (temp.isObject()) {
22051 JS::ForOfIterator iter1(cx);
22052 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
22053 return false;
22054 }
22055 if (!iter1.valueIsIterable()) {
22056 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22057 return false;
22058 }
22059 Sequence<JS::Value> &arr1 = slot.SetValue();
22060 JS::Rooted<JS::Value> temp1(cx);
22061 while (true) {
22062 bool done1;
22063 if (!iter1.next(&temp1, &done1)) {
22064 return false;
22065 }
22066 if (done1) {
22067 break;
22068 }
22069 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
22070 if (!slotPtr1) {
22071 JS_ReportOutOfMemory(cx);
22072 return false;
22073 }
22074 JS::Value& slot1 = *slotPtr1;
22075#ifdef __clang__1
22076#pragma clang diagnostic push
22077#pragma clang diagnostic ignored "-Wunreachable-code"
22078#pragma clang diagnostic ignored "-Wunreachable-code-return"
22079#endif // __clang__
22080 if ((true) && !CallerSubsumes(temp1)) {
22081 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
22082 return false;
22083 }
22084#ifdef __clang__1
22085#pragma clang diagnostic pop
22086#endif // __clang__
22087 slot1 = temp1;
22088 }
22089 } else if (temp.isNullOrUndefined()) {
22090 slot.SetNull();
22091 } else {
22092 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22093 return false;
22094 }
22095 }
22096 } else {
22097 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22098 return false;
22099 }
22100 if (objIsXray) {
22101 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22102 // we know Xrays have no dynamic unwrap behavior.
22103 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22104 if (!unwrappedObj.ref()) {
22105 return false;
22106 }
22107 }
22108 FastErrorResult rv;
22109 // NOTE: This assert does NOT call the function.
22110 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");
22111 MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22112 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"
)), 0))
) {
22113 return false;
22114 }
22115 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22115); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22115); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22116 args.rval().setUndefined();
22117 return true;
22118}
22119
22120static const JSJitInfo passSequenceOfNullableSequenceOfAny_methodinfo = {
22121 { (JSJitGetterOp)passSequenceOfNullableSequenceOfAny },
22122 { prototypes::id::TestJSImplInterface },
22123 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22124 JSJitInfo::Method,
22125 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22126 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22127 false, /* isInfallible. False in setters. */
22128 false, /* isMovable. Not relevant for setters. */
22129 false, /* isEliminatable. Not relevant for setters. */
22130 false, /* isAlwaysInSlot. Only relevant for getters. */
22131 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22132 false, /* isTypedMethod. Only relevant for methods. */
22133 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22134};
22135
22136MOZ_CAN_RUN_SCRIPT static bool
22137passNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22138{
22139 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny");
22140 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22143( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22141 "TestJSImplInterface", "passNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22143( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22142 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22143( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22143 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22143( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22144
22145 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22146 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", 1)) {
22147 return false;
22148 }
22149 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22150 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22151 if (objIsXray) {
22152 unwrappedObj.emplace(cx, obj);
22153 }
22154 Nullable<Sequence<Nullable<Sequence<JS::Value>>>> arg0;
22155 SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0.SetValue());
22156 if (args[0].isObject()) {
22157 JS::ForOfIterator iter(cx);
22158 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
22159 return false;
22160 }
22161 if (!iter.valueIsIterable()) {
22162 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22163 return false;
22164 }
22165 Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.SetValue();
22166 JS::Rooted<JS::Value> temp(cx);
22167 while (true) {
22168 bool done;
22169 if (!iter.next(&temp, &done)) {
22170 return false;
22171 }
22172 if (done) {
22173 break;
22174 }
22175 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
22176 if (!slotPtr) {
22177 JS_ReportOutOfMemory(cx);
22178 return false;
22179 }
22180 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
22181 if (temp.isObject()) {
22182 JS::ForOfIterator iter1(cx);
22183 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
22184 return false;
22185 }
22186 if (!iter1.valueIsIterable()) {
22187 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22188 return false;
22189 }
22190 Sequence<JS::Value> &arr1 = slot.SetValue();
22191 JS::Rooted<JS::Value> temp1(cx);
22192 while (true) {
22193 bool done1;
22194 if (!iter1.next(&temp1, &done1)) {
22195 return false;
22196 }
22197 if (done1) {
22198 break;
22199 }
22200 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
22201 if (!slotPtr1) {
22202 JS_ReportOutOfMemory(cx);
22203 return false;
22204 }
22205 JS::Value& slot1 = *slotPtr1;
22206#ifdef __clang__1
22207#pragma clang diagnostic push
22208#pragma clang diagnostic ignored "-Wunreachable-code"
22209#pragma clang diagnostic ignored "-Wunreachable-code-return"
22210#endif // __clang__
22211 if ((true) && !CallerSubsumes(temp1)) {
22212 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
22213 return false;
22214 }
22215#ifdef __clang__1
22216#pragma clang diagnostic pop
22217#endif // __clang__
22218 slot1 = temp1;
22219 }
22220 } else if (temp.isNullOrUndefined()) {
22221 slot.SetNull();
22222 } else {
22223 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22224 return false;
22225 }
22226 }
22227 } else if (args[0].isNullOrUndefined()) {
22228 arg0.SetNull();
22229 } else {
22230 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22231 return false;
22232 }
22233 if (objIsXray) {
22234 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22235 // we know Xrays have no dynamic unwrap behavior.
22236 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22237 if (!unwrappedObj.ref()) {
22238 return false;
22239 }
22240 }
22241 FastErrorResult rv;
22242 // NOTE: This assert does NOT call the function.
22243 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");
22244 MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22245 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"
)), 0))
) {
22246 return false;
22247 }
22248 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22248); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22249 args.rval().setUndefined();
22250 return true;
22251}
22252
22253static const JSJitInfo passNullableSequenceOfNullableSequenceOfAny_methodinfo = {
22254 { (JSJitGetterOp)passNullableSequenceOfNullableSequenceOfAny },
22255 { prototypes::id::TestJSImplInterface },
22256 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22257 JSJitInfo::Method,
22258 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22259 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22260 false, /* isInfallible. False in setters. */
22261 false, /* isMovable. Not relevant for setters. */
22262 false, /* isEliminatable. Not relevant for setters. */
22263 false, /* isAlwaysInSlot. Only relevant for getters. */
22264 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22265 false, /* isTypedMethod. Only relevant for methods. */
22266 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22267};
22268
22269MOZ_CAN_RUN_SCRIPT static bool
22270passOptionalNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22271{
22272 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny");
22273 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22276( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22274 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22276( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22275 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22276( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22276 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22276( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
22277
22278 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22279 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22280 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22281 if (objIsXray) {
22282 unwrappedObj.emplace(cx, obj);
22283 }
22284 Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>> arg0;
22285 Maybe<SequenceRooter<Nullable<Sequence<JS::Value>>>> arg0_holder;
22286 if (args.hasDefined(0)) {
22287 arg0.Construct();
22288 arg0_holder.emplace(cx, &arg0.Value().SetValue());
22289 if (args[0].isObject()) {
22290 JS::ForOfIterator iter(cx);
22291 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
22292 return false;
22293 }
22294 if (!iter.valueIsIterable()) {
22295 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22296 return false;
22297 }
22298 Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.Value().SetValue();
22299 JS::Rooted<JS::Value> temp(cx);
22300 while (true) {
22301 bool done;
22302 if (!iter.next(&temp, &done)) {
22303 return false;
22304 }
22305 if (done) {
22306 break;
22307 }
22308 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
22309 if (!slotPtr) {
22310 JS_ReportOutOfMemory(cx);
22311 return false;
22312 }
22313 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
22314 if (temp.isObject()) {
22315 JS::ForOfIterator iter1(cx);
22316 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
22317 return false;
22318 }
22319 if (!iter1.valueIsIterable()) {
22320 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22321 return false;
22322 }
22323 Sequence<JS::Value> &arr1 = slot.SetValue();
22324 JS::Rooted<JS::Value> temp1(cx);
22325 while (true) {
22326 bool done1;
22327 if (!iter1.next(&temp1, &done1)) {
22328 return false;
22329 }
22330 if (done1) {
22331 break;
22332 }
22333 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
22334 if (!slotPtr1) {
22335 JS_ReportOutOfMemory(cx);
22336 return false;
22337 }
22338 JS::Value& slot1 = *slotPtr1;
22339#ifdef __clang__1
22340#pragma clang diagnostic push
22341#pragma clang diagnostic ignored "-Wunreachable-code"
22342#pragma clang diagnostic ignored "-Wunreachable-code-return"
22343#endif // __clang__
22344 if ((true) && !CallerSubsumes(temp1)) {
22345 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
22346 return false;
22347 }
22348#ifdef __clang__1
22349#pragma clang diagnostic pop
22350#endif // __clang__
22351 slot1 = temp1;
22352 }
22353 } else if (temp.isNullOrUndefined()) {
22354 slot.SetNull();
22355 } else {
22356 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22357 return false;
22358 }
22359 }
22360 } else if (args[0].isNullOrUndefined()) {
22361 arg0.Value().SetNull();
22362 } else {
22363 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22364 return false;
22365 }
22366 }
22367 if (objIsXray) {
22368 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22369 // we know Xrays have no dynamic unwrap behavior.
22370 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22371 if (!unwrappedObj.ref()) {
22372 return false;
22373 }
22374 }
22375 FastErrorResult rv;
22376 // NOTE: This assert does NOT call the function.
22377 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");
22378 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22379 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"
)), 0))
) {
22380 return false;
22381 }
22382 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22382); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22382); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22383 args.rval().setUndefined();
22384 return true;
22385}
22386
22387static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo = {
22388 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfAny },
22389 { prototypes::id::TestJSImplInterface },
22390 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22391 JSJitInfo::Method,
22392 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22393 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22394 false, /* isInfallible. False in setters. */
22395 false, /* isMovable. Not relevant for setters. */
22396 false, /* isEliminatable. Not relevant for setters. */
22397 false, /* isAlwaysInSlot. Only relevant for getters. */
22398 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22399 false, /* isTypedMethod. Only relevant for methods. */
22400 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22401};
22402
22403MOZ_CAN_RUN_SCRIPT static bool
22404passRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22405{
22406 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfAny");
22407 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22410( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22408 "TestJSImplInterface", "passRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22410( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22409 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22410( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22410 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22410( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22411
22412 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22413 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfAny", 1)) {
22414 return false;
22415 }
22416 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22417 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22418 if (objIsXray) {
22419 unwrappedObj.emplace(cx, obj);
22420 }
22421 Record<nsString, JS::Value> arg0;
22422 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0);
22423 if (args[0].isObject()) {
22424 auto& recordEntries = arg0.Entries();
22425
22426 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22427 JS::RootedVector<jsid> ids(cx);
22428 if (!js::GetPropertyKeys(cx, recordObj,
22429 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22430 return false;
22431 }
22432 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22433 JS_ReportOutOfMemory(cx);
22434 return false;
22435 }
22436 JS::Rooted<JS::Value> propNameValue(cx);
22437 JS::Rooted<JS::Value> temp(cx);
22438 JS::Rooted<jsid> curId(cx);
22439 JS::Rooted<JS::Value> idVal(cx);
22440 // Use a hashset to keep track of ids seen, to avoid
22441 // introducing nasty O(N^2) behavior scanning for them all the
22442 // time. Ideally we'd use a data structure with O(1) lookup
22443 // _and_ ordering for the MozMap, but we don't have one lying
22444 // around.
22445 nsTHashtable<nsStringHashKey> idsSeen;
22446 for (size_t i = 0; i < ids.length(); ++i) {
22447 curId = ids[i];
22448
22449 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22450 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22451 &desc)) {
22452 return false;
22453 }
22454
22455 if (desc.isNothing() || !desc->enumerable()) {
22456 continue;
22457 }
22458
22459 idVal = js::IdToValue(curId);
22460 nsString propName;
22461 // This will just throw if idVal is a Symbol, like the spec says
22462 // to do.
22463 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22464 return false;
22465 }
22466
22467 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22468 return false;
22469 }
22470
22471 Record<nsString, JS::Value>::EntryType* entry;
22472 if (!idsSeen.EnsureInserted(propName)) {
22473 // Find the existing entry.
22474 auto idx = recordEntries.IndexOf(propName);
22475 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", 22476); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22476); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22476 "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", 22476); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22476); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22477 // Now blow it away to make it look like it was just added
22478 // to the array, because it's not obvious that it's
22479 // safe to write to its already-initialized mValue via our
22480 // normal codegen conversions. For example, the value
22481 // could be a union and this would change its type, but
22482 // codegen assumes we won't do that.
22483 entry = recordEntries.ReconstructElementAt(idx);
22484 } else {
22485 // Safe to do an infallible append here, because we did a
22486 // SetCapacity above to the right capacity.
22487 entry = recordEntries.AppendElement();
22488 }
22489 entry->mKey = propName;
22490 JS::Value& slot = entry->mValue;
22491#ifdef __clang__1
22492#pragma clang diagnostic push
22493#pragma clang diagnostic ignored "-Wunreachable-code"
22494#pragma clang diagnostic ignored "-Wunreachable-code-return"
22495#endif // __clang__
22496 if ((true) && !CallerSubsumes(temp)) {
22497 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22498 return false;
22499 }
22500#ifdef __clang__1
22501#pragma clang diagnostic pop
22502#endif // __clang__
22503 slot = temp;
22504 }
22505 } else {
22506 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22507 return false;
22508 }
22509 if (objIsXray) {
22510 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22511 // we know Xrays have no dynamic unwrap behavior.
22512 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22513 if (!unwrappedObj.ref()) {
22514 return false;
22515 }
22516 }
22517 FastErrorResult rv;
22518 // NOTE: This assert does NOT call the function.
22519 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");
22520 MOZ_KnownLive(self)(self)->PassRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22521 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny"
)), 0))
) {
22522 return false;
22523 }
22524 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22524); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22524); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22525 args.rval().setUndefined();
22526 return true;
22527}
22528
22529static const JSJitInfo passRecordOfAny_methodinfo = {
22530 { (JSJitGetterOp)passRecordOfAny },
22531 { prototypes::id::TestJSImplInterface },
22532 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22533 JSJitInfo::Method,
22534 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22535 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22536 false, /* isInfallible. False in setters. */
22537 false, /* isMovable. Not relevant for setters. */
22538 false, /* isEliminatable. Not relevant for setters. */
22539 false, /* isAlwaysInSlot. Only relevant for getters. */
22540 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22541 false, /* isTypedMethod. Only relevant for methods. */
22542 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22543};
22544
22545MOZ_CAN_RUN_SCRIPT static bool
22546passNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22547{
22548 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfAny");
22549 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22552( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22550 "TestJSImplInterface", "passNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22552( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22551 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22552( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22552 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22552( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22553
22554 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22555 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfAny", 1)) {
22556 return false;
22557 }
22558 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22559 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22560 if (objIsXray) {
22561 unwrappedObj.emplace(cx, obj);
22562 }
22563 Nullable<Record<nsString, JS::Value>> arg0;
22564 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue());
22565 if (args[0].isObject()) {
22566 auto& recordEntries = arg0.SetValue().Entries();
22567
22568 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22569 JS::RootedVector<jsid> ids(cx);
22570 if (!js::GetPropertyKeys(cx, recordObj,
22571 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22572 return false;
22573 }
22574 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22575 JS_ReportOutOfMemory(cx);
22576 return false;
22577 }
22578 JS::Rooted<JS::Value> propNameValue(cx);
22579 JS::Rooted<JS::Value> temp(cx);
22580 JS::Rooted<jsid> curId(cx);
22581 JS::Rooted<JS::Value> idVal(cx);
22582 // Use a hashset to keep track of ids seen, to avoid
22583 // introducing nasty O(N^2) behavior scanning for them all the
22584 // time. Ideally we'd use a data structure with O(1) lookup
22585 // _and_ ordering for the MozMap, but we don't have one lying
22586 // around.
22587 nsTHashtable<nsStringHashKey> idsSeen;
22588 for (size_t i = 0; i < ids.length(); ++i) {
22589 curId = ids[i];
22590
22591 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22592 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22593 &desc)) {
22594 return false;
22595 }
22596
22597 if (desc.isNothing() || !desc->enumerable()) {
22598 continue;
22599 }
22600
22601 idVal = js::IdToValue(curId);
22602 nsString propName;
22603 // This will just throw if idVal is a Symbol, like the spec says
22604 // to do.
22605 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22606 return false;
22607 }
22608
22609 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22610 return false;
22611 }
22612
22613 Record<nsString, JS::Value>::EntryType* entry;
22614 if (!idsSeen.EnsureInserted(propName)) {
22615 // Find the existing entry.
22616 auto idx = recordEntries.IndexOf(propName);
22617 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", 22618); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22618); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22618 "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", 22618); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22618); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22619 // Now blow it away to make it look like it was just added
22620 // to the array, because it's not obvious that it's
22621 // safe to write to its already-initialized mValue via our
22622 // normal codegen conversions. For example, the value
22623 // could be a union and this would change its type, but
22624 // codegen assumes we won't do that.
22625 entry = recordEntries.ReconstructElementAt(idx);
22626 } else {
22627 // Safe to do an infallible append here, because we did a
22628 // SetCapacity above to the right capacity.
22629 entry = recordEntries.AppendElement();
22630 }
22631 entry->mKey = propName;
22632 JS::Value& slot = entry->mValue;
22633#ifdef __clang__1
22634#pragma clang diagnostic push
22635#pragma clang diagnostic ignored "-Wunreachable-code"
22636#pragma clang diagnostic ignored "-Wunreachable-code-return"
22637#endif // __clang__
22638 if ((true) && !CallerSubsumes(temp)) {
22639 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22640 return false;
22641 }
22642#ifdef __clang__1
22643#pragma clang diagnostic pop
22644#endif // __clang__
22645 slot = temp;
22646 }
22647 } else if (args[0].isNullOrUndefined()) {
22648 arg0.SetNull();
22649 } else {
22650 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22651 return false;
22652 }
22653 if (objIsXray) {
22654 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22655 // we know Xrays have no dynamic unwrap behavior.
22656 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22657 if (!unwrappedObj.ref()) {
22658 return false;
22659 }
22660 }
22661 FastErrorResult rv;
22662 // NOTE: This assert does NOT call the function.
22663 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");
22664 MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22665 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny"
)), 0))
) {
22666 return false;
22667 }
22668 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22668); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22668); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22669 args.rval().setUndefined();
22670 return true;
22671}
22672
22673static const JSJitInfo passNullableRecordOfAny_methodinfo = {
22674 { (JSJitGetterOp)passNullableRecordOfAny },
22675 { prototypes::id::TestJSImplInterface },
22676 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22677 JSJitInfo::Method,
22678 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22679 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22680 false, /* isInfallible. False in setters. */
22681 false, /* isMovable. Not relevant for setters. */
22682 false, /* isEliminatable. Not relevant for setters. */
22683 false, /* isAlwaysInSlot. Only relevant for getters. */
22684 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22685 false, /* isTypedMethod. Only relevant for methods. */
22686 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22687};
22688
22689MOZ_CAN_RUN_SCRIPT static bool
22690passOptionalRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22691{
22692 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAny");
22693 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22696( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22694 "TestJSImplInterface", "passOptionalRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22696( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22695 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22696( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22696 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22696( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22697
22698 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22699 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22700 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22701 if (objIsXray) {
22702 unwrappedObj.emplace(cx, obj);
22703 }
22704 Optional<Record<nsString, JS::Value>> arg0;
22705 Maybe<RecordRooter<nsString, JS::Value>> arg0_holder;
22706 if (args.hasDefined(0)) {
22707 arg0.Construct();
22708 arg0_holder.emplace(cx, &arg0.Value());
22709 if (args[0].isObject()) {
22710 auto& recordEntries = arg0.Value().Entries();
22711
22712 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22713 JS::RootedVector<jsid> ids(cx);
22714 if (!js::GetPropertyKeys(cx, recordObj,
22715 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22716 return false;
22717 }
22718 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22719 JS_ReportOutOfMemory(cx);
22720 return false;
22721 }
22722 JS::Rooted<JS::Value> propNameValue(cx);
22723 JS::Rooted<JS::Value> temp(cx);
22724 JS::Rooted<jsid> curId(cx);
22725 JS::Rooted<JS::Value> idVal(cx);
22726 // Use a hashset to keep track of ids seen, to avoid
22727 // introducing nasty O(N^2) behavior scanning for them all the
22728 // time. Ideally we'd use a data structure with O(1) lookup
22729 // _and_ ordering for the MozMap, but we don't have one lying
22730 // around.
22731 nsTHashtable<nsStringHashKey> idsSeen;
22732 for (size_t i = 0; i < ids.length(); ++i) {
22733 curId = ids[i];
22734
22735 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22736 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22737 &desc)) {
22738 return false;
22739 }
22740
22741 if (desc.isNothing() || !desc->enumerable()) {
22742 continue;
22743 }
22744
22745 idVal = js::IdToValue(curId);
22746 nsString propName;
22747 // This will just throw if idVal is a Symbol, like the spec says
22748 // to do.
22749 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22750 return false;
22751 }
22752
22753 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22754 return false;
22755 }
22756
22757 Record<nsString, JS::Value>::EntryType* entry;
22758 if (!idsSeen.EnsureInserted(propName)) {
22759 // Find the existing entry.
22760 auto idx = recordEntries.IndexOf(propName);
22761 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", 22762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22762); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22762 "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", 22762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22762); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22763 // Now blow it away to make it look like it was just added
22764 // to the array, because it's not obvious that it's
22765 // safe to write to its already-initialized mValue via our
22766 // normal codegen conversions. For example, the value
22767 // could be a union and this would change its type, but
22768 // codegen assumes we won't do that.
22769 entry = recordEntries.ReconstructElementAt(idx);
22770 } else {
22771 // Safe to do an infallible append here, because we did a
22772 // SetCapacity above to the right capacity.
22773 entry = recordEntries.AppendElement();
22774 }
22775 entry->mKey = propName;
22776 JS::Value& slot = entry->mValue;
22777#ifdef __clang__1
22778#pragma clang diagnostic push
22779#pragma clang diagnostic ignored "-Wunreachable-code"
22780#pragma clang diagnostic ignored "-Wunreachable-code-return"
22781#endif // __clang__
22782 if ((true) && !CallerSubsumes(temp)) {
22783 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22784 return false;
22785 }
22786#ifdef __clang__1
22787#pragma clang diagnostic pop
22788#endif // __clang__
22789 slot = temp;
22790 }
22791 } else {
22792 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22793 return false;
22794 }
22795 }
22796 if (objIsXray) {
22797 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22798 // we know Xrays have no dynamic unwrap behavior.
22799 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22800 if (!unwrappedObj.ref()) {
22801 return false;
22802 }
22803 }
22804 FastErrorResult rv;
22805 // NOTE: This assert does NOT call the function.
22806 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");
22807 MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22808 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny"
)), 0))
) {
22809 return false;
22810 }
22811 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22811); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22811); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22812 args.rval().setUndefined();
22813 return true;
22814}
22815
22816static const JSJitInfo passOptionalRecordOfAny_methodinfo = {
22817 { (JSJitGetterOp)passOptionalRecordOfAny },
22818 { prototypes::id::TestJSImplInterface },
22819 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22820 JSJitInfo::Method,
22821 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22822 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22823 false, /* isInfallible. False in setters. */
22824 false, /* isMovable. Not relevant for setters. */
22825 false, /* isEliminatable. Not relevant for setters. */
22826 false, /* isAlwaysInSlot. Only relevant for getters. */
22827 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22828 false, /* isTypedMethod. Only relevant for methods. */
22829 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22830};
22831
22832MOZ_CAN_RUN_SCRIPT static bool
22833passOptionalNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22834{
22835 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfAny");
22836 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22839( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22837 "TestJSImplInterface", "passOptionalNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22839( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22838 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22839( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22839 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22839( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22840
22841 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22842 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22843 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22844 if (objIsXray) {
22845 unwrappedObj.emplace(cx, obj);
22846 }
22847 Optional<Nullable<Record<nsString, JS::Value>>> arg0;
22848 Maybe<RecordRooter<nsString, JS::Value>> arg0_holder;
22849 if (args.hasDefined(0)) {
22850 arg0.Construct();
22851 arg0_holder.emplace(cx, &arg0.Value().SetValue());
22852 if (args[0].isObject()) {
22853 auto& recordEntries = arg0.Value().SetValue().Entries();
22854
22855 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22856 JS::RootedVector<jsid> ids(cx);
22857 if (!js::GetPropertyKeys(cx, recordObj,
22858 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22859 return false;
22860 }
22861 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22862 JS_ReportOutOfMemory(cx);
22863 return false;
22864 }
22865 JS::Rooted<JS::Value> propNameValue(cx);
22866 JS::Rooted<JS::Value> temp(cx);
22867 JS::Rooted<jsid> curId(cx);
22868 JS::Rooted<JS::Value> idVal(cx);
22869 // Use a hashset to keep track of ids seen, to avoid
22870 // introducing nasty O(N^2) behavior scanning for them all the
22871 // time. Ideally we'd use a data structure with O(1) lookup
22872 // _and_ ordering for the MozMap, but we don't have one lying
22873 // around.
22874 nsTHashtable<nsStringHashKey> idsSeen;
22875 for (size_t i = 0; i < ids.length(); ++i) {
22876 curId = ids[i];
22877
22878 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22879 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22880 &desc)) {
22881 return false;
22882 }
22883
22884 if (desc.isNothing() || !desc->enumerable()) {
22885 continue;
22886 }
22887
22888 idVal = js::IdToValue(curId);
22889 nsString propName;
22890 // This will just throw if idVal is a Symbol, like the spec says
22891 // to do.
22892 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22893 return false;
22894 }
22895
22896 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22897 return false;
22898 }
22899
22900 Record<nsString, JS::Value>::EntryType* entry;
22901 if (!idsSeen.EnsureInserted(propName)) {
22902 // Find the existing entry.
22903 auto idx = recordEntries.IndexOf(propName);
22904 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", 22905); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22905); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22905 "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", 22905); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 22905); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22906 // Now blow it away to make it look like it was just added
22907 // to the array, because it's not obvious that it's
22908 // safe to write to its already-initialized mValue via our
22909 // normal codegen conversions. For example, the value
22910 // could be a union and this would change its type, but
22911 // codegen assumes we won't do that.
22912 entry = recordEntries.ReconstructElementAt(idx);
22913 } else {
22914 // Safe to do an infallible append here, because we did a
22915 // SetCapacity above to the right capacity.
22916 entry = recordEntries.AppendElement();
22917 }
22918 entry->mKey = propName;
22919 JS::Value& slot = entry->mValue;
22920#ifdef __clang__1
22921#pragma clang diagnostic push
22922#pragma clang diagnostic ignored "-Wunreachable-code"
22923#pragma clang diagnostic ignored "-Wunreachable-code-return"
22924#endif // __clang__
22925 if ((true) && !CallerSubsumes(temp)) {
22926 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22927 return false;
22928 }
22929#ifdef __clang__1
22930#pragma clang diagnostic pop
22931#endif // __clang__
22932 slot = temp;
22933 }
22934 } else if (args[0].isNullOrUndefined()) {
22935 arg0.Value().SetNull();
22936 } else {
22937 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22938 return false;
22939 }
22940 }
22941 if (objIsXray) {
22942 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22943 // we know Xrays have no dynamic unwrap behavior.
22944 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22945 if (!unwrappedObj.ref()) {
22946 return false;
22947 }
22948 }
22949 FastErrorResult rv;
22950 // NOTE: This assert does NOT call the function.
22951 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");
22952 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22953 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny"
)), 0))
) {
22954 return false;
22955 }
22956 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 22956); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
22957 args.rval().setUndefined();
22958 return true;
22959}
22960
22961static const JSJitInfo passOptionalNullableRecordOfAny_methodinfo = {
22962 { (JSJitGetterOp)passOptionalNullableRecordOfAny },
22963 { prototypes::id::TestJSImplInterface },
22964 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22965 JSJitInfo::Method,
22966 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22967 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22968 false, /* isInfallible. False in setters. */
22969 false, /* isMovable. Not relevant for setters. */
22970 false, /* isEliminatable. Not relevant for setters. */
22971 false, /* isAlwaysInSlot. Only relevant for getters. */
22972 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22973 false, /* isTypedMethod. Only relevant for methods. */
22974 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22975};
22976
22977MOZ_CAN_RUN_SCRIPT static bool
22978passOptionalRecordOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22979{
22980 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue");
22981 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22984( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22982 "TestJSImplInterface", "passOptionalRecordOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22984( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22983 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22984( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22984 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22984( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22985
22986 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22987 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22988 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22989 if (objIsXray) {
22990 unwrappedObj.emplace(cx, obj);
22991 }
22992 Nullable<Record<nsString, JS::Value>> arg0;
22993 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue());
22994 if (args.hasDefined(0)) {
22995 if (args[0].isObject()) {
22996 auto& recordEntries = arg0.SetValue().Entries();
22997
22998 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22999 JS::RootedVector<jsid> ids(cx);
23000 if (!js::GetPropertyKeys(cx, recordObj,
23001 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23002 return false;
23003 }
23004 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23005 JS_ReportOutOfMemory(cx);
23006 return false;
23007 }
23008 JS::Rooted<JS::Value> propNameValue(cx);
23009 JS::Rooted<JS::Value> temp(cx);
23010 JS::Rooted<jsid> curId(cx);
23011 JS::Rooted<JS::Value> idVal(cx);
23012 // Use a hashset to keep track of ids seen, to avoid
23013 // introducing nasty O(N^2) behavior scanning for them all the
23014 // time. Ideally we'd use a data structure with O(1) lookup
23015 // _and_ ordering for the MozMap, but we don't have one lying
23016 // around.
23017 nsTHashtable<nsStringHashKey> idsSeen;
23018 for (size_t i = 0; i < ids.length(); ++i) {
23019 curId = ids[i];
23020
23021 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23022 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23023 &desc)) {
23024 return false;
23025 }
23026
23027 if (desc.isNothing() || !desc->enumerable()) {
23028 continue;
23029 }
23030
23031 idVal = js::IdToValue(curId);
23032 nsString propName;
23033 // This will just throw if idVal is a Symbol, like the spec says
23034 // to do.
23035 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23036 return false;
23037 }
23038
23039 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23040 return false;
23041 }
23042
23043 Record<nsString, JS::Value>::EntryType* entry;
23044 if (!idsSeen.EnsureInserted(propName)) {
23045 // Find the existing entry.
23046 auto idx = recordEntries.IndexOf(propName);
23047 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", 23048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23048); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23048 "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", 23048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23048); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23049 // Now blow it away to make it look like it was just added
23050 // to the array, because it's not obvious that it's
23051 // safe to write to its already-initialized mValue via our
23052 // normal codegen conversions. For example, the value
23053 // could be a union and this would change its type, but
23054 // codegen assumes we won't do that.
23055 entry = recordEntries.ReconstructElementAt(idx);
23056 } else {
23057 // Safe to do an infallible append here, because we did a
23058 // SetCapacity above to the right capacity.
23059 entry = recordEntries.AppendElement();
23060 }
23061 entry->mKey = propName;
23062 JS::Value& slot = entry->mValue;
23063#ifdef __clang__1
23064#pragma clang diagnostic push
23065#pragma clang diagnostic ignored "-Wunreachable-code"
23066#pragma clang diagnostic ignored "-Wunreachable-code-return"
23067#endif // __clang__
23068 if ((true) && !CallerSubsumes(temp)) {
23069 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
23070 return false;
23071 }
23072#ifdef __clang__1
23073#pragma clang diagnostic pop
23074#endif // __clang__
23075 slot = temp;
23076 }
23077 } else if (args[0].isNullOrUndefined()) {
23078 arg0.SetNull();
23079 } else {
23080 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23081 return false;
23082 }
23083 } else {
23084 arg0.SetNull();
23085 }
23086 if (objIsXray) {
23087 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23088 // we know Xrays have no dynamic unwrap behavior.
23089 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23090 if (!unwrappedObj.ref()) {
23091 return false;
23092 }
23093 }
23094 FastErrorResult rv;
23095 // NOTE: This assert does NOT call the function.
23096 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");
23097 MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23098 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"
)), 0))
) {
23099 return false;
23100 }
23101 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23101); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 23101); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
23102 args.rval().setUndefined();
23103 return true;
23104}
23105
23106static const JSJitInfo passOptionalRecordOfAnyWithDefaultValue_methodinfo = {
23107 { (JSJitGetterOp)passOptionalRecordOfAnyWithDefaultValue },
23108 { prototypes::id::TestJSImplInterface },
23109 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23110 JSJitInfo::Method,
23111 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23112 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23113 false, /* isInfallible. False in setters. */
23114 false, /* isMovable. Not relevant for setters. */
23115 false, /* isEliminatable. Not relevant for setters. */
23116 false, /* isAlwaysInSlot. Only relevant for getters. */
23117 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23118 false, /* isTypedMethod. Only relevant for methods. */
23119 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23120};
23121
23122MOZ_CAN_RUN_SCRIPT static bool
23123passRecordOfRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23124{
23125 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfRecordOfAny");
23126 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23129( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23127 "TestJSImplInterface", "passRecordOfRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23129( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23128 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23129( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23129 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23129( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
23130
23131 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23132 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfRecordOfAny", 1)) {
23133 return false;
23134 }
23135 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23136 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23137 if (objIsXray) {
23138 unwrappedObj.emplace(cx, obj);
23139 }
23140 Record<nsString, Record<nsString, JS::Value>> arg0;
23141 RecordRooter<nsString, Record<nsString, JS::Value>> arg0_holder(cx, &arg0);
23142 if (args[0].isObject()) {
23143 auto& recordEntries = arg0.Entries();
23144
23145 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23146 JS::RootedVector<jsid> ids(cx);
23147 if (!js::GetPropertyKeys(cx, recordObj,
23148 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23149 return false;
23150 }
23151 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23152 JS_ReportOutOfMemory(cx);
23153 return false;
23154 }
23155 JS::Rooted<JS::Value> propNameValue(cx);
23156 JS::Rooted<JS::Value> temp(cx);
23157 JS::Rooted<jsid> curId(cx);
23158 JS::Rooted<JS::Value> idVal(cx);
23159 // Use a hashset to keep track of ids seen, to avoid
23160 // introducing nasty O(N^2) behavior scanning for them all the
23161 // time. Ideally we'd use a data structure with O(1) lookup
23162 // _and_ ordering for the MozMap, but we don't have one lying
23163 // around.
23164 nsTHashtable<nsStringHashKey> idsSeen;
23165 for (size_t i = 0; i < ids.length(); ++i) {
23166 curId = ids[i];
23167
23168 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23169 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23170 &desc)) {
23171 return false;
23172 }
23173
23174 if (desc.isNothing() || !desc->enumerable()) {
23175 continue;
23176 }
23177
23178 idVal = js::IdToValue(curId);
23179 nsString propName;
23180 // This will just throw if idVal is a Symbol, like the spec says
23181 // to do.
23182 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23183 return false;
23184 }
23185
23186 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23187 return false;
23188 }
23189
23190 Record<nsString, Record<nsString, JS::Value>>::EntryType* entry;
23191 if (!idsSeen.EnsureInserted(propName)) {
23192 // Find the existing entry.
23193 auto idx = recordEntries.IndexOf(propName);
23194 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", 23195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23195); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23195 "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", 23195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23195); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23196 // Now blow it away to make it look like it was just added
23197 // to the array, because it's not obvious that it's
23198 // safe to write to its already-initialized mValue via our
23199 // normal codegen conversions. For example, the value
23200 // could be a union and this would change its type, but
23201 // codegen assumes we won't do that.
23202 entry = recordEntries.ReconstructElementAt(idx);
23203 } else {
23204 // Safe to do an infallible append here, because we did a
23205 // SetCapacity above to the right capacity.
23206 entry = recordEntries.AppendElement();
23207 }
23208 entry->mKey = propName;
23209 Record<nsString, JS::Value>& slot = entry->mValue;
23210 if (temp.isObject()) {
23211 auto& recordEntries = slot.Entries();
23212
23213 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23214 JS::RootedVector<jsid> ids(cx);
23215 if (!js::GetPropertyKeys(cx, recordObj,
23216 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23217 return false;
23218 }
23219 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23220 JS_ReportOutOfMemory(cx);
23221 return false;
23222 }
23223 JS::Rooted<JS::Value> propNameValue(cx);
23224 JS::Rooted<JS::Value> temp(cx);
23225 JS::Rooted<jsid> curId(cx);
23226 JS::Rooted<JS::Value> idVal(cx);
23227 // Use a hashset to keep track of ids seen, to avoid
23228 // introducing nasty O(N^2) behavior scanning for them all the
23229 // time. Ideally we'd use a data structure with O(1) lookup
23230 // _and_ ordering for the MozMap, but we don't have one lying
23231 // around.
23232 nsTHashtable<nsStringHashKey> idsSeen;
23233 for (size_t i = 0; i < ids.length(); ++i) {
23234 curId = ids[i];
23235
23236 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23237 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23238 &desc)) {
23239 return false;
23240 }
23241
23242 if (desc.isNothing() || !desc->enumerable()) {
23243 continue;
23244 }
23245
23246 idVal = js::IdToValue(curId);
23247 nsString propName;
23248 // This will just throw if idVal is a Symbol, like the spec says
23249 // to do.
23250 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23251 return false;
23252 }
23253
23254 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23255 return false;
23256 }
23257
23258 Record<nsString, JS::Value>::EntryType* entry;
23259 if (!idsSeen.EnsureInserted(propName)) {
23260 // Find the existing entry.
23261 auto idx = recordEntries.IndexOf(propName);
23262 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", 23263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23263); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23263 "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", 23263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23263); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23264 // Now blow it away to make it look like it was just added
23265 // to the array, because it's not obvious that it's
23266 // safe to write to its already-initialized mValue via our
23267 // normal codegen conversions. For example, the value
23268 // could be a union and this would change its type, but
23269 // codegen assumes we won't do that.
23270 entry = recordEntries.ReconstructElementAt(idx);
23271 } else {
23272 // Safe to do an infallible append here, because we did a
23273 // SetCapacity above to the right capacity.
23274 entry = recordEntries.AppendElement();
23275 }
23276 entry->mKey = propName;
23277 JS::Value& slot = entry->mValue;
23278#ifdef __clang__1
23279#pragma clang diagnostic push
23280#pragma clang diagnostic ignored "-Wunreachable-code"
23281#pragma clang diagnostic ignored "-Wunreachable-code-return"
23282#endif // __clang__
23283 if ((true) && !CallerSubsumes(temp)) {
23284 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23285 return false;
23286 }
23287#ifdef __clang__1
23288#pragma clang diagnostic pop
23289#endif // __clang__
23290 slot = temp;
23291 }
23292 } else {
23293 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23294 return false;
23295 }
23296 }
23297 } else {
23298 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23299 return false;
23300 }
23301 if (objIsXray) {
23302 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23303 // we know Xrays have no dynamic unwrap behavior.
23304 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23305 if (!unwrappedObj.ref()) {
23306 return false;
23307 }
23308 }
23309 FastErrorResult rv;
23310 // NOTE: This assert does NOT call the function.
23311 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");
23312 MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23313 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny"
)), 0))
) {
23314 return false;
23315 }
23316 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23316); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 23316); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
23317 args.rval().setUndefined();
23318 return true;
23319}
23320
23321static const JSJitInfo passRecordOfRecordOfAny_methodinfo = {
23322 { (JSJitGetterOp)passRecordOfRecordOfAny },
23323 { prototypes::id::TestJSImplInterface },
23324 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23325 JSJitInfo::Method,
23326 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23327 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23328 false, /* isInfallible. False in setters. */
23329 false, /* isMovable. Not relevant for setters. */
23330 false, /* isEliminatable. Not relevant for setters. */
23331 false, /* isAlwaysInSlot. Only relevant for getters. */
23332 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23333 false, /* isTypedMethod. Only relevant for methods. */
23334 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23335};
23336
23337MOZ_CAN_RUN_SCRIPT static bool
23338passRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23339{
23340 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableRecordOfAny");
23341 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23344( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23342 "TestJSImplInterface", "passRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23344( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23343 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23344( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23344 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23344( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23345
23346 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23347 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny", 1)) {
23348 return false;
23349 }
23350 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23351 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23352 if (objIsXray) {
23353 unwrappedObj.emplace(cx, obj);
23354 }
23355 Record<nsString, Nullable<Record<nsString, JS::Value>>> arg0;
23356 RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0);
23357 if (args[0].isObject()) {
23358 auto& recordEntries = arg0.Entries();
23359
23360 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23361 JS::RootedVector<jsid> ids(cx);
23362 if (!js::GetPropertyKeys(cx, recordObj,
23363 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23364 return false;
23365 }
23366 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23367 JS_ReportOutOfMemory(cx);
23368 return false;
23369 }
23370 JS::Rooted<JS::Value> propNameValue(cx);
23371 JS::Rooted<JS::Value> temp(cx);
23372 JS::Rooted<jsid> curId(cx);
23373 JS::Rooted<JS::Value> idVal(cx);
23374 // Use a hashset to keep track of ids seen, to avoid
23375 // introducing nasty O(N^2) behavior scanning for them all the
23376 // time. Ideally we'd use a data structure with O(1) lookup
23377 // _and_ ordering for the MozMap, but we don't have one lying
23378 // around.
23379 nsTHashtable<nsStringHashKey> idsSeen;
23380 for (size_t i = 0; i < ids.length(); ++i) {
23381 curId = ids[i];
23382
23383 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23384 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23385 &desc)) {
23386 return false;
23387 }
23388
23389 if (desc.isNothing() || !desc->enumerable()) {
23390 continue;
23391 }
23392
23393 idVal = js::IdToValue(curId);
23394 nsString propName;
23395 // This will just throw if idVal is a Symbol, like the spec says
23396 // to do.
23397 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23398 return false;
23399 }
23400
23401 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23402 return false;
23403 }
23404
23405 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23406 if (!idsSeen.EnsureInserted(propName)) {
23407 // Find the existing entry.
23408 auto idx = recordEntries.IndexOf(propName);
23409 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", 23410); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23410); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23410 "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", 23410); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23410); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23411 // Now blow it away to make it look like it was just added
23412 // to the array, because it's not obvious that it's
23413 // safe to write to its already-initialized mValue via our
23414 // normal codegen conversions. For example, the value
23415 // could be a union and this would change its type, but
23416 // codegen assumes we won't do that.
23417 entry = recordEntries.ReconstructElementAt(idx);
23418 } else {
23419 // Safe to do an infallible append here, because we did a
23420 // SetCapacity above to the right capacity.
23421 entry = recordEntries.AppendElement();
23422 }
23423 entry->mKey = propName;
23424 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23425 if (temp.isObject()) {
23426 auto& recordEntries = slot.SetValue().Entries();
23427
23428 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23429 JS::RootedVector<jsid> ids(cx);
23430 if (!js::GetPropertyKeys(cx, recordObj,
23431 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23432 return false;
23433 }
23434 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23435 JS_ReportOutOfMemory(cx);
23436 return false;
23437 }
23438 JS::Rooted<JS::Value> propNameValue(cx);
23439 JS::Rooted<JS::Value> temp(cx);
23440 JS::Rooted<jsid> curId(cx);
23441 JS::Rooted<JS::Value> idVal(cx);
23442 // Use a hashset to keep track of ids seen, to avoid
23443 // introducing nasty O(N^2) behavior scanning for them all the
23444 // time. Ideally we'd use a data structure with O(1) lookup
23445 // _and_ ordering for the MozMap, but we don't have one lying
23446 // around.
23447 nsTHashtable<nsStringHashKey> idsSeen;
23448 for (size_t i = 0; i < ids.length(); ++i) {
23449 curId = ids[i];
23450
23451 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23452 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23453 &desc)) {
23454 return false;
23455 }
23456
23457 if (desc.isNothing() || !desc->enumerable()) {
23458 continue;
23459 }
23460
23461 idVal = js::IdToValue(curId);
23462 nsString propName;
23463 // This will just throw if idVal is a Symbol, like the spec says
23464 // to do.
23465 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23466 return false;
23467 }
23468
23469 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23470 return false;
23471 }
23472
23473 Record<nsString, JS::Value>::EntryType* entry;
23474 if (!idsSeen.EnsureInserted(propName)) {
23475 // Find the existing entry.
23476 auto idx = recordEntries.IndexOf(propName);
23477 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", 23478); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23478); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23478 "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", 23478); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23478); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23479 // Now blow it away to make it look like it was just added
23480 // to the array, because it's not obvious that it's
23481 // safe to write to its already-initialized mValue via our
23482 // normal codegen conversions. For example, the value
23483 // could be a union and this would change its type, but
23484 // codegen assumes we won't do that.
23485 entry = recordEntries.ReconstructElementAt(idx);
23486 } else {
23487 // Safe to do an infallible append here, because we did a
23488 // SetCapacity above to the right capacity.
23489 entry = recordEntries.AppendElement();
23490 }
23491 entry->mKey = propName;
23492 JS::Value& slot = entry->mValue;
23493#ifdef __clang__1
23494#pragma clang diagnostic push
23495#pragma clang diagnostic ignored "-Wunreachable-code"
23496#pragma clang diagnostic ignored "-Wunreachable-code-return"
23497#endif // __clang__
23498 if ((true) && !CallerSubsumes(temp)) {
23499 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23500 return false;
23501 }
23502#ifdef __clang__1
23503#pragma clang diagnostic pop
23504#endif // __clang__
23505 slot = temp;
23506 }
23507 } else if (temp.isNullOrUndefined()) {
23508 slot.SetNull();
23509 } else {
23510 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23511 return false;
23512 }
23513 }
23514 } else {
23515 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23516 return false;
23517 }
23518 if (objIsXray) {
23519 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23520 // we know Xrays have no dynamic unwrap behavior.
23521 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23522 if (!unwrappedObj.ref()) {
23523 return false;
23524 }
23525 }
23526 FastErrorResult rv;
23527 // NOTE: This assert does NOT call the function.
23528 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");
23529 MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23530 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny"
)), 0))
) {
23531 return false;
23532 }
23533 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23533); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 23533); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
23534 args.rval().setUndefined();
23535 return true;
23536}
23537
23538static const JSJitInfo passRecordOfNullableRecordOfAny_methodinfo = {
23539 { (JSJitGetterOp)passRecordOfNullableRecordOfAny },
23540 { prototypes::id::TestJSImplInterface },
23541 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23542 JSJitInfo::Method,
23543 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23544 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23545 false, /* isInfallible. False in setters. */
23546 false, /* isMovable. Not relevant for setters. */
23547 false, /* isEliminatable. Not relevant for setters. */
23548 false, /* isAlwaysInSlot. Only relevant for getters. */
23549 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23550 false, /* isTypedMethod. Only relevant for methods. */
23551 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23552};
23553
23554MOZ_CAN_RUN_SCRIPT static bool
23555passNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23556{
23557 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny");
23558 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23561( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23559 "TestJSImplInterface", "passNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23561( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23560 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23561( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23561 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23561( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23562
23563 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23564 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", 1)) {
23565 return false;
23566 }
23567 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23568 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23569 if (objIsXray) {
23570 unwrappedObj.emplace(cx, obj);
23571 }
23572 Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>> arg0;
23573 RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0.SetValue());
23574 if (args[0].isObject()) {
23575 auto& recordEntries = arg0.SetValue().Entries();
23576
23577 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23578 JS::RootedVector<jsid> ids(cx);
23579 if (!js::GetPropertyKeys(cx, recordObj,
23580 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23581 return false;
23582 }
23583 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23584 JS_ReportOutOfMemory(cx);
23585 return false;
23586 }
23587 JS::Rooted<JS::Value> propNameValue(cx);
23588 JS::Rooted<JS::Value> temp(cx);
23589 JS::Rooted<jsid> curId(cx);
23590 JS::Rooted<JS::Value> idVal(cx);
23591 // Use a hashset to keep track of ids seen, to avoid
23592 // introducing nasty O(N^2) behavior scanning for them all the
23593 // time. Ideally we'd use a data structure with O(1) lookup
23594 // _and_ ordering for the MozMap, but we don't have one lying
23595 // around.
23596 nsTHashtable<nsStringHashKey> idsSeen;
23597 for (size_t i = 0; i < ids.length(); ++i) {
23598 curId = ids[i];
23599
23600 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23601 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23602 &desc)) {
23603 return false;
23604 }
23605
23606 if (desc.isNothing() || !desc->enumerable()) {
23607 continue;
23608 }
23609
23610 idVal = js::IdToValue(curId);
23611 nsString propName;
23612 // This will just throw if idVal is a Symbol, like the spec says
23613 // to do.
23614 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23615 return false;
23616 }
23617
23618 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23619 return false;
23620 }
23621
23622 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23623 if (!idsSeen.EnsureInserted(propName)) {
23624 // Find the existing entry.
23625 auto idx = recordEntries.IndexOf(propName);
23626 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", 23627); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23627); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23627 "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", 23627); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23627); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23628 // Now blow it away to make it look like it was just added
23629 // to the array, because it's not obvious that it's
23630 // safe to write to its already-initialized mValue via our
23631 // normal codegen conversions. For example, the value
23632 // could be a union and this would change its type, but
23633 // codegen assumes we won't do that.
23634 entry = recordEntries.ReconstructElementAt(idx);
23635 } else {
23636 // Safe to do an infallible append here, because we did a
23637 // SetCapacity above to the right capacity.
23638 entry = recordEntries.AppendElement();
23639 }
23640 entry->mKey = propName;
23641 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23642 if (temp.isObject()) {
23643 auto& recordEntries = slot.SetValue().Entries();
23644
23645 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23646 JS::RootedVector<jsid> ids(cx);
23647 if (!js::GetPropertyKeys(cx, recordObj,
23648 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23649 return false;
23650 }
23651 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23652 JS_ReportOutOfMemory(cx);
23653 return false;
23654 }
23655 JS::Rooted<JS::Value> propNameValue(cx);
23656 JS::Rooted<JS::Value> temp(cx);
23657 JS::Rooted<jsid> curId(cx);
23658 JS::Rooted<JS::Value> idVal(cx);
23659 // Use a hashset to keep track of ids seen, to avoid
23660 // introducing nasty O(N^2) behavior scanning for them all the
23661 // time. Ideally we'd use a data structure with O(1) lookup
23662 // _and_ ordering for the MozMap, but we don't have one lying
23663 // around.
23664 nsTHashtable<nsStringHashKey> idsSeen;
23665 for (size_t i = 0; i < ids.length(); ++i) {
23666 curId = ids[i];
23667
23668 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23669 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23670 &desc)) {
23671 return false;
23672 }
23673
23674 if (desc.isNothing() || !desc->enumerable()) {
23675 continue;
23676 }
23677
23678 idVal = js::IdToValue(curId);
23679 nsString propName;
23680 // This will just throw if idVal is a Symbol, like the spec says
23681 // to do.
23682 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23683 return false;
23684 }
23685
23686 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23687 return false;
23688 }
23689
23690 Record<nsString, JS::Value>::EntryType* entry;
23691 if (!idsSeen.EnsureInserted(propName)) {
23692 // Find the existing entry.
23693 auto idx = recordEntries.IndexOf(propName);
23694 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", 23695); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23695); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23695 "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", 23695); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23695); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23696 // Now blow it away to make it look like it was just added
23697 // to the array, because it's not obvious that it's
23698 // safe to write to its already-initialized mValue via our
23699 // normal codegen conversions. For example, the value
23700 // could be a union and this would change its type, but
23701 // codegen assumes we won't do that.
23702 entry = recordEntries.ReconstructElementAt(idx);
23703 } else {
23704 // Safe to do an infallible append here, because we did a
23705 // SetCapacity above to the right capacity.
23706 entry = recordEntries.AppendElement();
23707 }
23708 entry->mKey = propName;
23709 JS::Value& slot = entry->mValue;
23710#ifdef __clang__1
23711#pragma clang diagnostic push
23712#pragma clang diagnostic ignored "-Wunreachable-code"
23713#pragma clang diagnostic ignored "-Wunreachable-code-return"
23714#endif // __clang__
23715 if ((true) && !CallerSubsumes(temp)) {
23716 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23717 return false;
23718 }
23719#ifdef __clang__1
23720#pragma clang diagnostic pop
23721#endif // __clang__
23722 slot = temp;
23723 }
23724 } else if (temp.isNullOrUndefined()) {
23725 slot.SetNull();
23726 } else {
23727 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23728 return false;
23729 }
23730 }
23731 } else if (args[0].isNullOrUndefined()) {
23732 arg0.SetNull();
23733 } else {
23734 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23735 return false;
23736 }
23737 if (objIsXray) {
23738 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23739 // we know Xrays have no dynamic unwrap behavior.
23740 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23741 if (!unwrappedObj.ref()) {
23742 return false;
23743 }
23744 }
23745 FastErrorResult rv;
23746 // NOTE: This assert does NOT call the function.
23747 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");
23748 MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23749 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"
)), 0))
) {
23750 return false;
23751 }
23752 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23752); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 23752); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
23753 args.rval().setUndefined();
23754 return true;
23755}
23756
23757static const JSJitInfo passNullableRecordOfNullableRecordOfAny_methodinfo = {
23758 { (JSJitGetterOp)passNullableRecordOfNullableRecordOfAny },
23759 { prototypes::id::TestJSImplInterface },
23760 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23761 JSJitInfo::Method,
23762 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23763 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23764 false, /* isInfallible. False in setters. */
23765 false, /* isMovable. Not relevant for setters. */
23766 false, /* isEliminatable. Not relevant for setters. */
23767 false, /* isAlwaysInSlot. Only relevant for getters. */
23768 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23769 false, /* isTypedMethod. Only relevant for methods. */
23770 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23771};
23772
23773MOZ_CAN_RUN_SCRIPT static bool
23774passOptionalNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23775{
23776 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny");
23777 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23780( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23778 "TestJSImplInterface", "passOptionalNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23780( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23779 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23780( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23780 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23780( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23781
23782 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23783 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23784 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23785 if (objIsXray) {
23786 unwrappedObj.emplace(cx, obj);
23787 }
23788 Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>> arg0;
23789 Maybe<RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>>> arg0_holder;
23790 if (args.hasDefined(0)) {
23791 arg0.Construct();
23792 arg0_holder.emplace(cx, &arg0.Value().SetValue());
23793 if (args[0].isObject()) {
23794 auto& recordEntries = arg0.Value().SetValue().Entries();
23795
23796 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23797 JS::RootedVector<jsid> ids(cx);
23798 if (!js::GetPropertyKeys(cx, recordObj,
23799 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23800 return false;
23801 }
23802 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23803 JS_ReportOutOfMemory(cx);
23804 return false;
23805 }
23806 JS::Rooted<JS::Value> propNameValue(cx);
23807 JS::Rooted<JS::Value> temp(cx);
23808 JS::Rooted<jsid> curId(cx);
23809 JS::Rooted<JS::Value> idVal(cx);
23810 // Use a hashset to keep track of ids seen, to avoid
23811 // introducing nasty O(N^2) behavior scanning for them all the
23812 // time. Ideally we'd use a data structure with O(1) lookup
23813 // _and_ ordering for the MozMap, but we don't have one lying
23814 // around.
23815 nsTHashtable<nsStringHashKey> idsSeen;
23816 for (size_t i = 0; i < ids.length(); ++i) {
23817 curId = ids[i];
23818
23819 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23820 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23821 &desc)) {
23822 return false;
23823 }
23824
23825 if (desc.isNothing() || !desc->enumerable()) {
23826 continue;
23827 }
23828
23829 idVal = js::IdToValue(curId);
23830 nsString propName;
23831 // This will just throw if idVal is a Symbol, like the spec says
23832 // to do.
23833 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23834 return false;
23835 }
23836
23837 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23838 return false;
23839 }
23840
23841 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23842 if (!idsSeen.EnsureInserted(propName)) {
23843 // Find the existing entry.
23844 auto idx = recordEntries.IndexOf(propName);
23845 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", 23846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23846); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23846 "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", 23846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23846); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23847 // Now blow it away to make it look like it was just added
23848 // to the array, because it's not obvious that it's
23849 // safe to write to its already-initialized mValue via our
23850 // normal codegen conversions. For example, the value
23851 // could be a union and this would change its type, but
23852 // codegen assumes we won't do that.
23853 entry = recordEntries.ReconstructElementAt(idx);
23854 } else {
23855 // Safe to do an infallible append here, because we did a
23856 // SetCapacity above to the right capacity.
23857 entry = recordEntries.AppendElement();
23858 }
23859 entry->mKey = propName;
23860 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23861 if (temp.isObject()) {
23862 auto& recordEntries = slot.SetValue().Entries();
23863
23864 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23865 JS::RootedVector<jsid> ids(cx);
23866 if (!js::GetPropertyKeys(cx, recordObj,
23867 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23868 return false;
23869 }
23870 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23871 JS_ReportOutOfMemory(cx);
23872 return false;
23873 }
23874 JS::Rooted<JS::Value> propNameValue(cx);
23875 JS::Rooted<JS::Value> temp(cx);
23876 JS::Rooted<jsid> curId(cx);
23877 JS::Rooted<JS::Value> idVal(cx);
23878 // Use a hashset to keep track of ids seen, to avoid
23879 // introducing nasty O(N^2) behavior scanning for them all the
23880 // time. Ideally we'd use a data structure with O(1) lookup
23881 // _and_ ordering for the MozMap, but we don't have one lying
23882 // around.
23883 nsTHashtable<nsStringHashKey> idsSeen;
23884 for (size_t i = 0; i < ids.length(); ++i) {
23885 curId = ids[i];
23886
23887 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23888 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23889 &desc)) {
23890 return false;
23891 }
23892
23893 if (desc.isNothing() || !desc->enumerable()) {
23894 continue;
23895 }
23896
23897 idVal = js::IdToValue(curId);
23898 nsString propName;
23899 // This will just throw if idVal is a Symbol, like the spec says
23900 // to do.
23901 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23902 return false;
23903 }
23904
23905 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23906 return false;
23907 }
23908
23909 Record<nsString, JS::Value>::EntryType* entry;
23910 if (!idsSeen.EnsureInserted(propName)) {
23911 // Find the existing entry.
23912 auto idx = recordEntries.IndexOf(propName);
23913 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", 23914); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23914); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23914 "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", 23914); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 23914); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23915 // Now blow it away to make it look like it was just added
23916 // to the array, because it's not obvious that it's
23917 // safe to write to its already-initialized mValue via our
23918 // normal codegen conversions. For example, the value
23919 // could be a union and this would change its type, but
23920 // codegen assumes we won't do that.
23921 entry = recordEntries.ReconstructElementAt(idx);
23922 } else {
23923 // Safe to do an infallible append here, because we did a
23924 // SetCapacity above to the right capacity.
23925 entry = recordEntries.AppendElement();
23926 }
23927 entry->mKey = propName;
23928 JS::Value& slot = entry->mValue;
23929#ifdef __clang__1
23930#pragma clang diagnostic push
23931#pragma clang diagnostic ignored "-Wunreachable-code"
23932#pragma clang diagnostic ignored "-Wunreachable-code-return"
23933#endif // __clang__
23934 if ((true) && !CallerSubsumes(temp)) {
23935 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23936 return false;
23937 }
23938#ifdef __clang__1
23939#pragma clang diagnostic pop
23940#endif // __clang__
23941 slot = temp;
23942 }
23943 } else if (temp.isNullOrUndefined()) {
23944 slot.SetNull();
23945 } else {
23946 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23947 return false;
23948 }
23949 }
23950 } else if (args[0].isNullOrUndefined()) {
23951 arg0.Value().SetNull();
23952 } else {
23953 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23954 return false;
23955 }
23956 }
23957 if (objIsXray) {
23958 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23959 // we know Xrays have no dynamic unwrap behavior.
23960 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23961 if (!unwrappedObj.ref()) {
23962 return false;
23963 }
23964 }
23965 FastErrorResult rv;
23966 // NOTE: This assert does NOT call the function.
23967 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");
23968 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23969 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"
)), 0))
) {
23970 return false;
23971 }
23972 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 23972); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
23973 args.rval().setUndefined();
23974 return true;
23975}
23976
23977static const JSJitInfo passOptionalNullableRecordOfNullableRecordOfAny_methodinfo = {
23978 { (JSJitGetterOp)passOptionalNullableRecordOfNullableRecordOfAny },
23979 { prototypes::id::TestJSImplInterface },
23980 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23981 JSJitInfo::Method,
23982 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23983 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23984 false, /* isInfallible. False in setters. */
23985 false, /* isMovable. Not relevant for setters. */
23986 false, /* isEliminatable. Not relevant for setters. */
23987 false, /* isAlwaysInSlot. Only relevant for getters. */
23988 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23989 false, /* isTypedMethod. Only relevant for methods. */
23990 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23991};
23992
23993MOZ_CAN_RUN_SCRIPT static bool
23994passOptionalNullableRecordOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23995{
23996 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny");
23997 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24000( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23998 "TestJSImplInterface", "passOptionalNullableRecordOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24000( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23999 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24000( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24000 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24000( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24001
24002 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24003 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24004 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24005 if (objIsXray) {
24006 unwrappedObj.emplace(cx, obj);
24007 }
24008 Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>> arg0;
24009 Maybe<RecordRooter<nsString, Nullable<Sequence<JS::Value>>>> arg0_holder;
24010 if (args.hasDefined(0)) {
24011 arg0.Construct();
24012 arg0_holder.emplace(cx, &arg0.Value().SetValue());
24013 if (args[0].isObject()) {
24014 auto& recordEntries = arg0.Value().SetValue().Entries();
24015
24016 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
24017 JS::RootedVector<jsid> ids(cx);
24018 if (!js::GetPropertyKeys(cx, recordObj,
24019 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
24020 return false;
24021 }
24022 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
24023 JS_ReportOutOfMemory(cx);
24024 return false;
24025 }
24026 JS::Rooted<JS::Value> propNameValue(cx);
24027 JS::Rooted<JS::Value> temp(cx);
24028 JS::Rooted<jsid> curId(cx);
24029 JS::Rooted<JS::Value> idVal(cx);
24030 // Use a hashset to keep track of ids seen, to avoid
24031 // introducing nasty O(N^2) behavior scanning for them all the
24032 // time. Ideally we'd use a data structure with O(1) lookup
24033 // _and_ ordering for the MozMap, but we don't have one lying
24034 // around.
24035 nsTHashtable<nsStringHashKey> idsSeen;
24036 for (size_t i = 0; i < ids.length(); ++i) {
24037 curId = ids[i];
24038
24039 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
24040 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
24041 &desc)) {
24042 return false;
24043 }
24044
24045 if (desc.isNothing() || !desc->enumerable()) {
24046 continue;
24047 }
24048
24049 idVal = js::IdToValue(curId);
24050 nsString propName;
24051 // This will just throw if idVal is a Symbol, like the spec says
24052 // to do.
24053 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
24054 return false;
24055 }
24056
24057 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
24058 return false;
24059 }
24060
24061 Record<nsString, Nullable<Sequence<JS::Value>>>::EntryType* entry;
24062 if (!idsSeen.EnsureInserted(propName)) {
24063 // Find the existing entry.
24064 auto idx = recordEntries.IndexOf(propName);
24065 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", 24066); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 24066); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
24066 "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", 24066); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 24066); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
24067 // Now blow it away to make it look like it was just added
24068 // to the array, because it's not obvious that it's
24069 // safe to write to its already-initialized mValue via our
24070 // normal codegen conversions. For example, the value
24071 // could be a union and this would change its type, but
24072 // codegen assumes we won't do that.
24073 entry = recordEntries.ReconstructElementAt(idx);
24074 } else {
24075 // Safe to do an infallible append here, because we did a
24076 // SetCapacity above to the right capacity.
24077 entry = recordEntries.AppendElement();
24078 }
24079 entry->mKey = propName;
24080 Nullable<Sequence<JS::Value>>& slot = entry->mValue;
24081 if (temp.isObject()) {
24082 JS::ForOfIterator iter1(cx);
24083 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
24084 return false;
24085 }
24086 if (!iter1.valueIsIterable()) {
24087 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence");
24088 return false;
24089 }
24090 Sequence<JS::Value> &arr1 = slot.SetValue();
24091 JS::Rooted<JS::Value> temp1(cx);
24092 while (true) {
24093 bool done1;
24094 if (!iter1.next(&temp1, &done1)) {
24095 return false;
24096 }
24097 if (done1) {
24098 break;
24099 }
24100 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
24101 if (!slotPtr1) {
24102 JS_ReportOutOfMemory(cx);
24103 return false;
24104 }
24105 JS::Value& slot1 = *slotPtr1;
24106#ifdef __clang__1
24107#pragma clang diagnostic push
24108#pragma clang diagnostic ignored "-Wunreachable-code"
24109#pragma clang diagnostic ignored "-Wunreachable-code-return"
24110#endif // __clang__
24111 if ((true) && !CallerSubsumes(temp1)) {
24112 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of value in argument 1");
24113 return false;
24114 }
24115#ifdef __clang__1
24116#pragma clang diagnostic pop
24117#endif // __clang__
24118 slot1 = temp1;
24119 }
24120 } else if (temp.isNullOrUndefined()) {
24121 slot.SetNull();
24122 } else {
24123 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence");
24124 return false;
24125 }
24126 }
24127 } else if (args[0].isNullOrUndefined()) {
24128 arg0.Value().SetNull();
24129 } else {
24130 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24131 return false;
24132 }
24133 }
24134 if (objIsXray) {
24135 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24136 // we know Xrays have no dynamic unwrap behavior.
24137 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24138 if (!unwrappedObj.ref()) {
24139 return false;
24140 }
24141 }
24142 FastErrorResult rv;
24143 // NOTE: This assert does NOT call the function.
24144 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");
24145 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24146 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"
)), 0))
) {
24147 return false;
24148 }
24149 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24149); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24149); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24150 args.rval().setUndefined();
24151 return true;
24152}
24153
24154static const JSJitInfo passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo = {
24155 { (JSJitGetterOp)passOptionalNullableRecordOfNullableSequenceOfAny },
24156 { prototypes::id::TestJSImplInterface },
24157 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24158 JSJitInfo::Method,
24159 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24160 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24161 false, /* isInfallible. False in setters. */
24162 false, /* isMovable. Not relevant for setters. */
24163 false, /* isEliminatable. Not relevant for setters. */
24164 false, /* isAlwaysInSlot. Only relevant for getters. */
24165 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24166 false, /* isTypedMethod. Only relevant for methods. */
24167 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24168};
24169
24170MOZ_CAN_RUN_SCRIPT static bool
24171passOptionalNullableSequenceOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24172{
24173 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny");
24174 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24177( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24175 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24177( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24176 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24177( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24177 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24177( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24178
24179 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24180 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24181 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24182 if (objIsXray) {
24183 unwrappedObj.emplace(cx, obj);
24184 }
24185 Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>> arg0;
24186 Maybe<SequenceRooter<Nullable<Record<nsString, JS::Value>>>> arg0_holder;
24187 if (args.hasDefined(0)) {
24188 arg0.Construct();
24189 arg0_holder.emplace(cx, &arg0.Value().SetValue());
24190 if (args[0].isObject()) {
24191 JS::ForOfIterator iter(cx);
24192 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
24193 return false;
24194 }
24195 if (!iter.valueIsIterable()) {
24196 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24197 return false;
24198 }
24199 Sequence<Nullable<Record<nsString, JS::Value>>> &arr = arg0.Value().SetValue();
24200 JS::Rooted<JS::Value> temp(cx);
24201 while (true) {
24202 bool done;
24203 if (!iter.next(&temp, &done)) {
24204 return false;
24205 }
24206 if (done) {
24207 break;
24208 }
24209 Nullable<Record<nsString, JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
24210 if (!slotPtr) {
24211 JS_ReportOutOfMemory(cx);
24212 return false;
24213 }
24214 Nullable<Record<nsString, JS::Value>>& slot = *slotPtr;
24215 if (temp.isObject()) {
24216 auto& recordEntries = slot.SetValue().Entries();
24217
24218 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
24219 JS::RootedVector<jsid> ids(cx);
24220 if (!js::GetPropertyKeys(cx, recordObj,
24221 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
24222 return false;
24223 }
24224 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
24225 JS_ReportOutOfMemory(cx);
24226 return false;
24227 }
24228 JS::Rooted<JS::Value> propNameValue(cx);
24229 JS::Rooted<JS::Value> temp(cx);
24230 JS::Rooted<jsid> curId(cx);
24231 JS::Rooted<JS::Value> idVal(cx);
24232 // Use a hashset to keep track of ids seen, to avoid
24233 // introducing nasty O(N^2) behavior scanning for them all the
24234 // time. Ideally we'd use a data structure with O(1) lookup
24235 // _and_ ordering for the MozMap, but we don't have one lying
24236 // around.
24237 nsTHashtable<nsStringHashKey> idsSeen;
24238 for (size_t i = 0; i < ids.length(); ++i) {
24239 curId = ids[i];
24240
24241 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
24242 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
24243 &desc)) {
24244 return false;
24245 }
24246
24247 if (desc.isNothing() || !desc->enumerable()) {
24248 continue;
24249 }
24250
24251 idVal = js::IdToValue(curId);
24252 nsString propName;
24253 // This will just throw if idVal is a Symbol, like the spec says
24254 // to do.
24255 if (!ConvertJSValueToString(cx, idVal, "key of element of argument 1", propName)) {
24256 return false;
24257 }
24258
24259 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
24260 return false;
24261 }
24262
24263 Record<nsString, JS::Value>::EntryType* entry;
24264 if (!idsSeen.EnsureInserted(propName)) {
24265 // Find the existing entry.
24266 auto idx = recordEntries.IndexOf(propName);
24267 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", 24268); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 24268); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
24268 "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", 24268); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 24268); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
24269 // Now blow it away to make it look like it was just added
24270 // to the array, because it's not obvious that it's
24271 // safe to write to its already-initialized mValue via our
24272 // normal codegen conversions. For example, the value
24273 // could be a union and this would change its type, but
24274 // codegen assumes we won't do that.
24275 entry = recordEntries.ReconstructElementAt(idx);
24276 } else {
24277 // Safe to do an infallible append here, because we did a
24278 // SetCapacity above to the right capacity.
24279 entry = recordEntries.AppendElement();
24280 }
24281 entry->mKey = propName;
24282 JS::Value& slot = entry->mValue;
24283#ifdef __clang__1
24284#pragma clang diagnostic push
24285#pragma clang diagnostic ignored "-Wunreachable-code"
24286#pragma clang diagnostic ignored "-Wunreachable-code-return"
24287#endif // __clang__
24288 if ((true) && !CallerSubsumes(temp)) {
24289 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in element of argument 1");
24290 return false;
24291 }
24292#ifdef __clang__1
24293#pragma clang diagnostic pop
24294#endif // __clang__
24295 slot = temp;
24296 }
24297 } else if (temp.isNullOrUndefined()) {
24298 slot.SetNull();
24299 } else {
24300 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
24301 return false;
24302 }
24303 }
24304 } else if (args[0].isNullOrUndefined()) {
24305 arg0.Value().SetNull();
24306 } else {
24307 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24308 return false;
24309 }
24310 }
24311 if (objIsXray) {
24312 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24313 // we know Xrays have no dynamic unwrap behavior.
24314 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24315 if (!unwrappedObj.ref()) {
24316 return false;
24317 }
24318 }
24319 FastErrorResult rv;
24320 // NOTE: This assert does NOT call the function.
24321 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");
24322 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24323 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"
)), 0))
) {
24324 return false;
24325 }
24326 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24326); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24326); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24327 args.rval().setUndefined();
24328 return true;
24329}
24330
24331static const JSJitInfo passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo = {
24332 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableRecordOfAny },
24333 { prototypes::id::TestJSImplInterface },
24334 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24335 JSJitInfo::Method,
24336 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24337 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24338 false, /* isInfallible. False in setters. */
24339 false, /* isMovable. Not relevant for setters. */
24340 false, /* isEliminatable. Not relevant for setters. */
24341 false, /* isAlwaysInSlot. Only relevant for getters. */
24342 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24343 false, /* isTypedMethod. Only relevant for methods. */
24344 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24345};
24346
24347MOZ_CAN_RUN_SCRIPT static bool
24348receiveAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24349{
24350 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24353( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24351 "TestJSImplInterface", "receiveAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24353( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24352 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24353( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24353 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24353( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24354
24355 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24356 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24357 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24358 if (objIsXray) {
24359 unwrappedObj.emplace(cx, obj);
24360 }
24361 if (objIsXray) {
24362 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24363 // we know Xrays have no dynamic unwrap behavior.
24364 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24365 if (!unwrappedObj.ref()) {
24366 return false;
24367 }
24368 }
24369 FastErrorResult rv;
24370 JS::Rooted<JS::Value> result(cx);
24371 // NOTE: This assert does NOT call the function.
24372 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");
24373 MOZ_KnownLive(self)(self)->ReceiveAny(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24374 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny"
)), 0))
) {
24375 return false;
24376 }
24377 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24377); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24377); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24378 JS::ExposeValueToActiveJS(result);
24379 args.rval().set(result);
24380 if (!MaybeWrapValue(cx, args.rval())) {
24381 return false;
24382 }
24383 return true;
24384}
24385
24386static const JSJitInfo receiveAny_methodinfo = {
24387 { (JSJitGetterOp)receiveAny },
24388 { prototypes::id::TestJSImplInterface },
24389 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24390 JSJitInfo::Method,
24391 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24392 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
24393 false, /* isInfallible. False in setters. */
24394 false, /* isMovable. Not relevant for setters. */
24395 false, /* isEliminatable. Not relevant for setters. */
24396 false, /* isAlwaysInSlot. Only relevant for getters. */
24397 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24398 false, /* isTypedMethod. Only relevant for methods. */
24399 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24400};
24401
24402MOZ_CAN_RUN_SCRIPT static bool
24403passObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24404{
24405 BindingCallContext cx(cx_, "TestJSImplInterface.passObject");
24406 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24409( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24407 "TestJSImplInterface", "passObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24409( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24408 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24409( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24409 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24409( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24410
24411 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24412 if (!args.requireAtLeast(cx, "TestJSImplInterface.passObject", 1)) {
24413 return false;
24414 }
24415 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24416 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24417 if (objIsXray) {
24418 unwrappedObj.emplace(cx, obj);
24419 }
24420 JS::Rooted<JSObject*> arg0(cx);
24421 if (args[0].isObject()) {
24422#ifdef __clang__1
24423#pragma clang diagnostic push
24424#pragma clang diagnostic ignored "-Wunreachable-code"
24425#pragma clang diagnostic ignored "-Wunreachable-code-return"
24426#endif // __clang__
24427 if ((true) && !CallerSubsumes(args[0])) {
24428 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24429 return false;
24430 }
24431#ifdef __clang__1
24432#pragma clang diagnostic pop
24433#endif // __clang__
24434 arg0 = &args[0].toObject();
24435 } else {
24436 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24437 return false;
24438 }
24439 if (objIsXray) {
24440 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24441 // we know Xrays have no dynamic unwrap behavior.
24442 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24443 if (!unwrappedObj.ref()) {
24444 return false;
24445 }
24446 }
24447 FastErrorResult rv;
24448 // NOTE: This assert does NOT call the function.
24449 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");
24450 MOZ_KnownLive(self)(self)->PassObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24451 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject"
)), 0))
) {
24452 return false;
24453 }
24454 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24454); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24454); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24455 args.rval().setUndefined();
24456 return true;
24457}
24458
24459static const JSJitInfo passObject_methodinfo = {
24460 { (JSJitGetterOp)passObject },
24461 { prototypes::id::TestJSImplInterface },
24462 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24463 JSJitInfo::Method,
24464 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24465 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24466 false, /* isInfallible. False in setters. */
24467 false, /* isMovable. Not relevant for setters. */
24468 false, /* isEliminatable. Not relevant for setters. */
24469 false, /* isAlwaysInSlot. Only relevant for getters. */
24470 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24471 false, /* isTypedMethod. Only relevant for methods. */
24472 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24473};
24474
24475MOZ_CAN_RUN_SCRIPT static bool
24476passVariadicObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24477{
24478 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicObject");
24479 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24482( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24480 "TestJSImplInterface", "passVariadicObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24482( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24481 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24482( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24482 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24482( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24483
24484 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24485 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24486 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24487 if (objIsXray) {
24488 unwrappedObj.emplace(cx, obj);
24489 }
24490 AutoSequence<JSObject*> arg0;
24491 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24492 if (args.length() > 0) {
24493 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
24494 JS_ReportOutOfMemory(cx);
24495 return false;
24496 }
24497 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
24498 // OK to do infallible append here, since we ensured capacity already.
24499 JSObject*& slot = *arg0.AppendElement(nullptr);
24500 if (args[variadicArg].isObject()) {
24501#ifdef __clang__1
24502#pragma clang diagnostic push
24503#pragma clang diagnostic ignored "-Wunreachable-code"
24504#pragma clang diagnostic ignored "-Wunreachable-code-return"
24505#endif // __clang__
24506 if ((true) && !CallerSubsumes(args[variadicArg])) {
24507 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24508 return false;
24509 }
24510#ifdef __clang__1
24511#pragma clang diagnostic pop
24512#endif // __clang__
24513 slot = &args[variadicArg].toObject();
24514 } else {
24515 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24516 return false;
24517 }
24518 }
24519 }
24520 if (objIsXray) {
24521 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24522 // we know Xrays have no dynamic unwrap behavior.
24523 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24524 if (!unwrappedObj.ref()) {
24525 return false;
24526 }
24527 }
24528 FastErrorResult rv;
24529 // NOTE: This assert does NOT call the function.
24530 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");
24531 MOZ_KnownLive(self)(self)->PassVariadicObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24532 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject"
)), 0))
) {
24533 return false;
24534 }
24535 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24535); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24535); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24536 args.rval().setUndefined();
24537 return true;
24538}
24539
24540static const JSJitInfo passVariadicObject_methodinfo = {
24541 { (JSJitGetterOp)passVariadicObject },
24542 { prototypes::id::TestJSImplInterface },
24543 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24544 JSJitInfo::Method,
24545 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24546 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24547 false, /* isInfallible. False in setters. */
24548 false, /* isMovable. Not relevant for setters. */
24549 false, /* isEliminatable. Not relevant for setters. */
24550 false, /* isAlwaysInSlot. Only relevant for getters. */
24551 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24552 false, /* isTypedMethod. Only relevant for methods. */
24553 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24554};
24555
24556MOZ_CAN_RUN_SCRIPT static bool
24557passNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24558{
24559 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableObject");
24560 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24563( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24561 "TestJSImplInterface", "passNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24563( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24562 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24563( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24563 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24563( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24564
24565 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24566 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableObject", 1)) {
24567 return false;
24568 }
24569 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24570 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24571 if (objIsXray) {
24572 unwrappedObj.emplace(cx, obj);
24573 }
24574 JS::Rooted<JSObject*> arg0(cx);
24575 if (args[0].isObject()) {
24576#ifdef __clang__1
24577#pragma clang diagnostic push
24578#pragma clang diagnostic ignored "-Wunreachable-code"
24579#pragma clang diagnostic ignored "-Wunreachable-code-return"
24580#endif // __clang__
24581 if ((true) && !CallerSubsumes(args[0])) {
24582 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24583 return false;
24584 }
24585#ifdef __clang__1
24586#pragma clang diagnostic pop
24587#endif // __clang__
24588 arg0 = &args[0].toObject();
24589 } else if (args[0].isNullOrUndefined()) {
24590 arg0 = nullptr;
24591 } else {
24592 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24593 return false;
24594 }
24595 if (objIsXray) {
24596 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24597 // we know Xrays have no dynamic unwrap behavior.
24598 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24599 if (!unwrappedObj.ref()) {
24600 return false;
24601 }
24602 }
24603 FastErrorResult rv;
24604 // NOTE: This assert does NOT call the function.
24605 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");
24606 MOZ_KnownLive(self)(self)->PassNullableObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24607 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject"
)), 0))
) {
24608 return false;
24609 }
24610 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24610); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24610); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24611 args.rval().setUndefined();
24612 return true;
24613}
24614
24615static const JSJitInfo passNullableObject_methodinfo = {
24616 { (JSJitGetterOp)passNullableObject },
24617 { prototypes::id::TestJSImplInterface },
24618 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24619 JSJitInfo::Method,
24620 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24621 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24622 false, /* isInfallible. False in setters. */
24623 false, /* isMovable. Not relevant for setters. */
24624 false, /* isEliminatable. Not relevant for setters. */
24625 false, /* isAlwaysInSlot. Only relevant for getters. */
24626 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24627 false, /* isTypedMethod. Only relevant for methods. */
24628 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24629};
24630
24631MOZ_CAN_RUN_SCRIPT static bool
24632passVariadicNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24633{
24634 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableObject");
24635 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24638( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24636 "TestJSImplInterface", "passVariadicNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24638( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24637 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24638( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24638 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24638( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24639
24640 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24641 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24642 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24643 if (objIsXray) {
24644 unwrappedObj.emplace(cx, obj);
24645 }
24646 AutoSequence<JSObject*> arg0;
24647 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24648 if (args.length() > 0) {
24649 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
24650 JS_ReportOutOfMemory(cx);
24651 return false;
24652 }
24653 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
24654 // OK to do infallible append here, since we ensured capacity already.
24655 JSObject*& slot = *arg0.AppendElement(nullptr);
24656 if (args[variadicArg].isObject()) {
24657#ifdef __clang__1
24658#pragma clang diagnostic push
24659#pragma clang diagnostic ignored "-Wunreachable-code"
24660#pragma clang diagnostic ignored "-Wunreachable-code-return"
24661#endif // __clang__
24662 if ((true) && !CallerSubsumes(args[variadicArg])) {
24663 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24664 return false;
24665 }
24666#ifdef __clang__1
24667#pragma clang diagnostic pop
24668#endif // __clang__
24669 slot = &args[variadicArg].toObject();
24670 } else {
24671 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24672 return false;
24673 }
24674 }
24675 }
24676 if (objIsXray) {
24677 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24678 // we know Xrays have no dynamic unwrap behavior.
24679 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24680 if (!unwrappedObj.ref()) {
24681 return false;
24682 }
24683 }
24684 FastErrorResult rv;
24685 // NOTE: This assert does NOT call the function.
24686 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");
24687 MOZ_KnownLive(self)(self)->PassVariadicNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24688 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject"
)), 0))
) {
24689 return false;
24690 }
24691 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24691); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24691); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24692 args.rval().setUndefined();
24693 return true;
24694}
24695
24696static const JSJitInfo passVariadicNullableObject_methodinfo = {
24697 { (JSJitGetterOp)passVariadicNullableObject },
24698 { prototypes::id::TestJSImplInterface },
24699 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24700 JSJitInfo::Method,
24701 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24702 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24703 false, /* isInfallible. False in setters. */
24704 false, /* isMovable. Not relevant for setters. */
24705 false, /* isEliminatable. Not relevant for setters. */
24706 false, /* isAlwaysInSlot. Only relevant for getters. */
24707 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24708 false, /* isTypedMethod. Only relevant for methods. */
24709 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24710};
24711
24712MOZ_CAN_RUN_SCRIPT static bool
24713passOptionalObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24714{
24715 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObject");
24716 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24719( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24717 "TestJSImplInterface", "passOptionalObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24719( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24718 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24719( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24719 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24719( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24720
24721 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24722 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24723 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24724 if (objIsXray) {
24725 unwrappedObj.emplace(cx, obj);
24726 }
24727 Optional<JS::Handle<JSObject*>> arg0;
24728 if (args.hasDefined(0)) {
24729 arg0.Construct(cx);
24730 if (args[0].isObject()) {
24731#ifdef __clang__1
24732#pragma clang diagnostic push
24733#pragma clang diagnostic ignored "-Wunreachable-code"
24734#pragma clang diagnostic ignored "-Wunreachable-code-return"
24735#endif // __clang__
24736 if ((true) && !CallerSubsumes(args[0])) {
24737 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24738 return false;
24739 }
24740#ifdef __clang__1
24741#pragma clang diagnostic pop
24742#endif // __clang__
24743 arg0.Value() = &args[0].toObject();
24744 } else {
24745 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24746 return false;
24747 }
24748 }
24749 if (objIsXray) {
24750 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24751 // we know Xrays have no dynamic unwrap behavior.
24752 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24753 if (!unwrappedObj.ref()) {
24754 return false;
24755 }
24756 }
24757 FastErrorResult rv;
24758 // NOTE: This assert does NOT call the function.
24759 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");
24760 MOZ_KnownLive(self)(self)->PassOptionalObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24761 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject"
)), 0))
) {
24762 return false;
24763 }
24764 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24764); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24765 args.rval().setUndefined();
24766 return true;
24767}
24768
24769static const JSJitInfo passOptionalObject_methodinfo = {
24770 { (JSJitGetterOp)passOptionalObject },
24771 { prototypes::id::TestJSImplInterface },
24772 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24773 JSJitInfo::Method,
24774 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24775 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24776 false, /* isInfallible. False in setters. */
24777 false, /* isMovable. Not relevant for setters. */
24778 false, /* isEliminatable. Not relevant for setters. */
24779 false, /* isAlwaysInSlot. Only relevant for getters. */
24780 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24781 false, /* isTypedMethod. Only relevant for methods. */
24782 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24783};
24784
24785MOZ_CAN_RUN_SCRIPT static bool
24786passOptionalNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24787{
24788 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObject");
24789 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24792( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24790 "TestJSImplInterface", "passOptionalNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24792( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24791 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24792( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24792 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24792( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24793
24794 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24795 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24796 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24797 if (objIsXray) {
24798 unwrappedObj.emplace(cx, obj);
24799 }
24800 Optional<JS::Handle<JSObject*>> arg0;
24801 if (args.hasDefined(0)) {
24802 arg0.Construct(cx);
24803 if (args[0].isObject()) {
24804#ifdef __clang__1
24805#pragma clang diagnostic push
24806#pragma clang diagnostic ignored "-Wunreachable-code"
24807#pragma clang diagnostic ignored "-Wunreachable-code-return"
24808#endif // __clang__
24809 if ((true) && !CallerSubsumes(args[0])) {
24810 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24811 return false;
24812 }
24813#ifdef __clang__1
24814#pragma clang diagnostic pop
24815#endif // __clang__
24816 arg0.Value() = &args[0].toObject();
24817 } else if (args[0].isNullOrUndefined()) {
24818 arg0.Value() = nullptr;
24819 } else {
24820 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24821 return false;
24822 }
24823 }
24824 if (objIsXray) {
24825 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24826 // we know Xrays have no dynamic unwrap behavior.
24827 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24828 if (!unwrappedObj.ref()) {
24829 return false;
24830 }
24831 }
24832 FastErrorResult rv;
24833 // NOTE: This assert does NOT call the function.
24834 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");
24835 MOZ_KnownLive(self)(self)->PassOptionalNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24836 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject"
)), 0))
) {
24837 return false;
24838 }
24839 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24839); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24839); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24840 args.rval().setUndefined();
24841 return true;
24842}
24843
24844static const JSJitInfo passOptionalNullableObject_methodinfo = {
24845 { (JSJitGetterOp)passOptionalNullableObject },
24846 { prototypes::id::TestJSImplInterface },
24847 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24848 JSJitInfo::Method,
24849 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24850 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24851 false, /* isInfallible. False in setters. */
24852 false, /* isMovable. Not relevant for setters. */
24853 false, /* isEliminatable. Not relevant for setters. */
24854 false, /* isAlwaysInSlot. Only relevant for getters. */
24855 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24856 false, /* isTypedMethod. Only relevant for methods. */
24857 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24858};
24859
24860MOZ_CAN_RUN_SCRIPT static bool
24861passOptionalNullableObjectWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24862{
24863 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue");
24864 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24867( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24865 "TestJSImplInterface", "passOptionalNullableObjectWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24867( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24866 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24867( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24867 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24867( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24868
24869 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24870 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24871 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24872 if (objIsXray) {
24873 unwrappedObj.emplace(cx, obj);
24874 }
24875 JS::Rooted<JSObject*> arg0(cx);
24876 if (args.hasDefined(0)) {
24877 if (args[0].isObject()) {
24878#ifdef __clang__1
24879#pragma clang diagnostic push
24880#pragma clang diagnostic ignored "-Wunreachable-code"
24881#pragma clang diagnostic ignored "-Wunreachable-code-return"
24882#endif // __clang__
24883 if ((true) && !CallerSubsumes(args[0])) {
24884 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24885 return false;
24886 }
24887#ifdef __clang__1
24888#pragma clang diagnostic pop
24889#endif // __clang__
24890 arg0 = &args[0].toObject();
24891 } else if (args[0].isNullOrUndefined()) {
24892 arg0 = nullptr;
24893 } else {
24894 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24895 return false;
24896 }
24897 } else {
24898 arg0 = nullptr;
24899 }
24900 if (objIsXray) {
24901 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24902 // we know Xrays have no dynamic unwrap behavior.
24903 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24904 if (!unwrappedObj.ref()) {
24905 return false;
24906 }
24907 }
24908 FastErrorResult rv;
24909 // NOTE: This assert does NOT call the function.
24910 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");
24911 MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24912 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"
)), 0))
) {
24913 return false;
24914 }
24915 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24915); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 24915); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
24916 args.rval().setUndefined();
24917 return true;
24918}
24919
24920static const JSJitInfo passOptionalNullableObjectWithDefaultValue_methodinfo = {
24921 { (JSJitGetterOp)passOptionalNullableObjectWithDefaultValue },
24922 { prototypes::id::TestJSImplInterface },
24923 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24924 JSJitInfo::Method,
24925 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24926 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24927 false, /* isInfallible. False in setters. */
24928 false, /* isMovable. Not relevant for setters. */
24929 false, /* isEliminatable. Not relevant for setters. */
24930 false, /* isAlwaysInSlot. Only relevant for getters. */
24931 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24932 false, /* isTypedMethod. Only relevant for methods. */
24933 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24934};
24935
24936MOZ_CAN_RUN_SCRIPT static bool
24937passSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24938{
24939 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfObject");
24940 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24943( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24941 "TestJSImplInterface", "passSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24943( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24942 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24943( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24943 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24943( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24944
24945 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24946 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfObject", 1)) {
24947 return false;
24948 }
24949 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24950 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24951 if (objIsXray) {
24952 unwrappedObj.emplace(cx, obj);
24953 }
24954 binding_detail::AutoSequence<JSObject*> arg0;
24955 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24956 if (args[0].isObject()) {
24957 JS::ForOfIterator iter(cx);
24958 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
24959 return false;
24960 }
24961 if (!iter.valueIsIterable()) {
24962 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24963 return false;
24964 }
24965 binding_detail::AutoSequence<JSObject*> &arr = arg0;
24966 JS::Rooted<JS::Value> temp(cx);
24967 while (true) {
24968 bool done;
24969 if (!iter.next(&temp, &done)) {
24970 return false;
24971 }
24972 if (done) {
24973 break;
24974 }
24975 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
24976 if (!slotPtr) {
24977 JS_ReportOutOfMemory(cx);
24978 return false;
24979 }
24980 JSObject*& slot = *slotPtr;
24981 if (temp.isObject()) {
24982#ifdef __clang__1
24983#pragma clang diagnostic push
24984#pragma clang diagnostic ignored "-Wunreachable-code"
24985#pragma clang diagnostic ignored "-Wunreachable-code-return"
24986#endif // __clang__
24987 if ((true) && !CallerSubsumes(temp)) {
24988 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
24989 return false;
24990 }
24991#ifdef __clang__1
24992#pragma clang diagnostic pop
24993#endif // __clang__
24994 slot = &temp.toObject();
24995 } else {
24996 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
24997 return false;
24998 }
24999 }
25000 } else {
25001 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25002 return false;
25003 }
25004 if (objIsXray) {
25005 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25006 // we know Xrays have no dynamic unwrap behavior.
25007 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25008 if (!unwrappedObj.ref()) {
25009 return false;
25010 }
25011 }
25012 FastErrorResult rv;
25013 // NOTE: This assert does NOT call the function.
25014 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");
25015 MOZ_KnownLive(self)(self)->PassSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25016 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject"
)), 0))
) {
25017 return false;
25018 }
25019 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25019); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25019); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25020 args.rval().setUndefined();
25021 return true;
25022}
25023
25024static const JSJitInfo passSequenceOfObject_methodinfo = {
25025 { (JSJitGetterOp)passSequenceOfObject },
25026 { prototypes::id::TestJSImplInterface },
25027 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25028 JSJitInfo::Method,
25029 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25030 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25031 false, /* isInfallible. False in setters. */
25032 false, /* isMovable. Not relevant for setters. */
25033 false, /* isEliminatable. Not relevant for setters. */
25034 false, /* isAlwaysInSlot. Only relevant for getters. */
25035 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25036 false, /* isTypedMethod. Only relevant for methods. */
25037 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25038};
25039
25040MOZ_CAN_RUN_SCRIPT static bool
25041passSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25042{
25043 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableObject");
25044 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25047( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25045 "TestJSImplInterface", "passSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25047( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25046 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25047( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25047 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25047( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
25048
25049 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25050 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableObject", 1)) {
25051 return false;
25052 }
25053 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25054 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25055 if (objIsXray) {
25056 unwrappedObj.emplace(cx, obj);
25057 }
25058 binding_detail::AutoSequence<JSObject*> arg0;
25059 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
25060 if (args[0].isObject()) {
25061 JS::ForOfIterator iter(cx);
25062 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25063 return false;
25064 }
25065 if (!iter.valueIsIterable()) {
25066 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25067 return false;
25068 }
25069 binding_detail::AutoSequence<JSObject*> &arr = arg0;
25070 JS::Rooted<JS::Value> temp(cx);
25071 while (true) {
25072 bool done;
25073 if (!iter.next(&temp, &done)) {
25074 return false;
25075 }
25076 if (done) {
25077 break;
25078 }
25079 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
25080 if (!slotPtr) {
25081 JS_ReportOutOfMemory(cx);
25082 return false;
25083 }
25084 JSObject*& slot = *slotPtr;
25085 if (temp.isObject()) {
25086#ifdef __clang__1
25087#pragma clang diagnostic push
25088#pragma clang diagnostic ignored "-Wunreachable-code"
25089#pragma clang diagnostic ignored "-Wunreachable-code-return"
25090#endif // __clang__
25091 if ((true) && !CallerSubsumes(temp)) {
25092 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
25093 return false;
25094 }
25095#ifdef __clang__1
25096#pragma clang diagnostic pop
25097#endif // __clang__
25098 slot = &temp.toObject();
25099 } else if (temp.isNullOrUndefined()) {
25100 slot = nullptr;
25101 } else {
25102 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
25103 return false;
25104 }
25105 }
25106 } else {
25107 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25108 return false;
25109 }
25110 if (objIsXray) {
25111 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25112 // we know Xrays have no dynamic unwrap behavior.
25113 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25114 if (!unwrappedObj.ref()) {
25115 return false;
25116 }
25117 }
25118 FastErrorResult rv;
25119 // NOTE: This assert does NOT call the function.
25120 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");
25121 MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25122 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject"
)), 0))
) {
25123 return false;
25124 }
25125 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25125); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25125); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25126 args.rval().setUndefined();
25127 return true;
25128}
25129
25130static const JSJitInfo passSequenceOfNullableObject_methodinfo = {
25131 { (JSJitGetterOp)passSequenceOfNullableObject },
25132 { prototypes::id::TestJSImplInterface },
25133 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25134 JSJitInfo::Method,
25135 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25136 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25137 false, /* isInfallible. False in setters. */
25138 false, /* isMovable. Not relevant for setters. */
25139 false, /* isEliminatable. Not relevant for setters. */
25140 false, /* isAlwaysInSlot. Only relevant for getters. */
25141 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25142 false, /* isTypedMethod. Only relevant for methods. */
25143 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25144};
25145
25146MOZ_CAN_RUN_SCRIPT static bool
25147passNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25148{
25149 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfObject");
25150 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25153( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25151 "TestJSImplInterface", "passNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25153( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25152 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25153( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25153 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25153( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
25154
25155 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25156 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfObject", 1)) {
25157 return false;
25158 }
25159 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25160 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25161 if (objIsXray) {
25162 unwrappedObj.emplace(cx, obj);
25163 }
25164 Nullable<Sequence<JSObject*>> arg0;
25165 SequenceRooter<JSObject*> arg0_holder(cx, &arg0.SetValue());
25166 if (args[0].isObject()) {
25167 JS::ForOfIterator iter(cx);
25168 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25169 return false;
25170 }
25171 if (!iter.valueIsIterable()) {
25172 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25173 return false;
25174 }
25175 Sequence<JSObject*> &arr = arg0.SetValue();
25176 JS::Rooted<JS::Value> temp(cx);
25177 while (true) {
25178 bool done;
25179 if (!iter.next(&temp, &done)) {
25180 return false;
25181 }
25182 if (done) {
25183 break;
25184 }
25185 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
25186 if (!slotPtr) {
25187 JS_ReportOutOfMemory(cx);
25188 return false;
25189 }
25190 JSObject*& slot = *slotPtr;
25191 if (temp.isObject()) {
25192#ifdef __clang__1
25193#pragma clang diagnostic push
25194#pragma clang diagnostic ignored "-Wunreachable-code"
25195#pragma clang diagnostic ignored "-Wunreachable-code-return"
25196#endif // __clang__
25197 if ((true) && !CallerSubsumes(temp)) {
25198 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
25199 return false;
25200 }
25201#ifdef __clang__1
25202#pragma clang diagnostic pop
25203#endif // __clang__
25204 slot = &temp.toObject();
25205 } else {
25206 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
25207 return false;
25208 }
25209 }
25210 } else if (args[0].isNullOrUndefined()) {
25211 arg0.SetNull();
25212 } else {
25213 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25214 return false;
25215 }
25216 if (objIsXray) {
25217 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25218 // we know Xrays have no dynamic unwrap behavior.
25219 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25220 if (!unwrappedObj.ref()) {
25221 return false;
25222 }
25223 }
25224 FastErrorResult rv;
25225 // NOTE: This assert does NOT call the function.
25226 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");
25227 MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25228 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject"
)), 0))
) {
25229 return false;
25230 }
25231 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25231); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25232 args.rval().setUndefined();
25233 return true;
25234}
25235
25236static const JSJitInfo passNullableSequenceOfObject_methodinfo = {
25237 { (JSJitGetterOp)passNullableSequenceOfObject },
25238 { prototypes::id::TestJSImplInterface },
25239 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25240 JSJitInfo::Method,
25241 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25242 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25243 false, /* isInfallible. False in setters. */
25244 false, /* isMovable. Not relevant for setters. */
25245 false, /* isEliminatable. Not relevant for setters. */
25246 false, /* isAlwaysInSlot. Only relevant for getters. */
25247 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25248 false, /* isTypedMethod. Only relevant for methods. */
25249 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25250};
25251
25252MOZ_CAN_RUN_SCRIPT static bool
25253passOptionalNullableSequenceOfNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25254{
25255 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject");
25256 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25259( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25257 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25259( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25258 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25259( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25259 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25259( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25260
25261 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25262 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25263 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25264 if (objIsXray) {
25265 unwrappedObj.emplace(cx, obj);
25266 }
25267 Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0;
25268 Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder;
25269 if (args.hasDefined(0)) {
25270 arg0.Construct();
25271 arg0_holder.emplace(cx, &arg0.Value().SetValue());
25272 if (args[0].isObject()) {
25273 JS::ForOfIterator iter(cx);
25274 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25275 return false;
25276 }
25277 if (!iter.valueIsIterable()) {
25278 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25279 return false;
25280 }
25281 Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue();
25282 JS::Rooted<JS::Value> temp(cx);
25283 while (true) {
25284 bool done;
25285 if (!iter.next(&temp, &done)) {
25286 return false;
25287 }
25288 if (done) {
25289 break;
25290 }
25291 Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible);
25292 if (!slotPtr) {
25293 JS_ReportOutOfMemory(cx);
25294 return false;
25295 }
25296 Nullable<Sequence<JSObject*>>& slot = *slotPtr;
25297 if (temp.isObject()) {
25298 JS::ForOfIterator iter1(cx);
25299 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
25300 return false;
25301 }
25302 if (!iter1.valueIsIterable()) {
25303 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25304 return false;
25305 }
25306 Sequence<JSObject*> &arr1 = slot.SetValue();
25307 JS::Rooted<JS::Value> temp1(cx);
25308 while (true) {
25309 bool done1;
25310 if (!iter1.next(&temp1, &done1)) {
25311 return false;
25312 }
25313 if (done1) {
25314 break;
25315 }
25316 JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible);
25317 if (!slotPtr1) {
25318 JS_ReportOutOfMemory(cx);
25319 return false;
25320 }
25321 JSObject*& slot1 = *slotPtr1;
25322 if (temp1.isObject()) {
25323#ifdef __clang__1
25324#pragma clang diagnostic push
25325#pragma clang diagnostic ignored "-Wunreachable-code"
25326#pragma clang diagnostic ignored "-Wunreachable-code-return"
25327#endif // __clang__
25328 if ((true) && !CallerSubsumes(temp1)) {
25329 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
25330 return false;
25331 }
25332#ifdef __clang__1
25333#pragma clang diagnostic pop
25334#endif // __clang__
25335 slot1 = &temp1.toObject();
25336 } else {
25337 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1");
25338 return false;
25339 }
25340 }
25341 } else if (temp.isNullOrUndefined()) {
25342 slot.SetNull();
25343 } else {
25344 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25345 return false;
25346 }
25347 }
25348 } else if (args[0].isNullOrUndefined()) {
25349 arg0.Value().SetNull();
25350 } else {
25351 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25352 return false;
25353 }
25354 }
25355 if (objIsXray) {
25356 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25357 // we know Xrays have no dynamic unwrap behavior.
25358 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25359 if (!unwrappedObj.ref()) {
25360 return false;
25361 }
25362 }
25363 FastErrorResult rv;
25364 // NOTE: This assert does NOT call the function.
25365 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");
25366 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25367 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"
)), 0))
) {
25368 return false;
25369 }
25370 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25370); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25370); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25371 args.rval().setUndefined();
25372 return true;
25373}
25374
25375static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo = {
25376 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfObject },
25377 { prototypes::id::TestJSImplInterface },
25378 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25379 JSJitInfo::Method,
25380 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25381 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25382 false, /* isInfallible. False in setters. */
25383 false, /* isMovable. Not relevant for setters. */
25384 false, /* isEliminatable. Not relevant for setters. */
25385 false, /* isAlwaysInSlot. Only relevant for getters. */
25386 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25387 false, /* isTypedMethod. Only relevant for methods. */
25388 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25389};
25390
25391MOZ_CAN_RUN_SCRIPT static bool
25392passOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25393{
25394 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject");
25395 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25398( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25396 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25398( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25397 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25398( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25398 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25398( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25399
25400 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25401 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25402 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25403 if (objIsXray) {
25404 unwrappedObj.emplace(cx, obj);
25405 }
25406 Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0;
25407 Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder;
25408 if (args.hasDefined(0)) {
25409 arg0.Construct();
25410 arg0_holder.emplace(cx, &arg0.Value().SetValue());
25411 if (args[0].isObject()) {
25412 JS::ForOfIterator iter(cx);
25413 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25414 return false;
25415 }
25416 if (!iter.valueIsIterable()) {
25417 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25418 return false;
25419 }
25420 Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue();
25421 JS::Rooted<JS::Value> temp(cx);
25422 while (true) {
25423 bool done;
25424 if (!iter.next(&temp, &done)) {
25425 return false;
25426 }
25427 if (done) {
25428 break;
25429 }
25430 Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible);
25431 if (!slotPtr) {
25432 JS_ReportOutOfMemory(cx);
25433 return false;
25434 }
25435 Nullable<Sequence<JSObject*>>& slot = *slotPtr;
25436 if (temp.isObject()) {
25437 JS::ForOfIterator iter1(cx);
25438 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
25439 return false;
25440 }
25441 if (!iter1.valueIsIterable()) {
25442 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25443 return false;
25444 }
25445 Sequence<JSObject*> &arr1 = slot.SetValue();
25446 JS::Rooted<JS::Value> temp1(cx);
25447 while (true) {
25448 bool done1;
25449 if (!iter1.next(&temp1, &done1)) {
25450 return false;
25451 }
25452 if (done1) {
25453 break;
25454 }
25455 JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible);
25456 if (!slotPtr1) {
25457 JS_ReportOutOfMemory(cx);
25458 return false;
25459 }
25460 JSObject*& slot1 = *slotPtr1;
25461 if (temp1.isObject()) {
25462#ifdef __clang__1
25463#pragma clang diagnostic push
25464#pragma clang diagnostic ignored "-Wunreachable-code"
25465#pragma clang diagnostic ignored "-Wunreachable-code-return"
25466#endif // __clang__
25467 if ((true) && !CallerSubsumes(temp1)) {
25468 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
25469 return false;
25470 }
25471#ifdef __clang__1
25472#pragma clang diagnostic pop
25473#endif // __clang__
25474 slot1 = &temp1.toObject();
25475 } else if (temp1.isNullOrUndefined()) {
25476 slot1 = nullptr;
25477 } else {
25478 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1");
25479 return false;
25480 }
25481 }
25482 } else if (temp.isNullOrUndefined()) {
25483 slot.SetNull();
25484 } else {
25485 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25486 return false;
25487 }
25488 }
25489 } else if (args[0].isNullOrUndefined()) {
25490 arg0.Value().SetNull();
25491 } else {
25492 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25493 return false;
25494 }
25495 }
25496 if (objIsXray) {
25497 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25498 // we know Xrays have no dynamic unwrap behavior.
25499 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25500 if (!unwrappedObj.ref()) {
25501 return false;
25502 }
25503 }
25504 FastErrorResult rv;
25505 // NOTE: This assert does NOT call the function.
25506 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");
25507 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25508 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
)), 0))
) {
25509 return false;
25510 }
25511 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25511); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25511); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25512 args.rval().setUndefined();
25513 return true;
25514}
25515
25516static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo = {
25517 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfNullableObject },
25518 { prototypes::id::TestJSImplInterface },
25519 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25520 JSJitInfo::Method,
25521 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25522 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25523 false, /* isInfallible. False in setters. */
25524 false, /* isMovable. Not relevant for setters. */
25525 false, /* isEliminatable. Not relevant for setters. */
25526 false, /* isAlwaysInSlot. Only relevant for getters. */
25527 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25528 false, /* isTypedMethod. Only relevant for methods. */
25529 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25530};
25531
25532MOZ_CAN_RUN_SCRIPT static bool
25533passRecordOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25534{
25535 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfObject");
25536 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25539( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25537 "TestJSImplInterface", "passRecordOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25539( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25538 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25539( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25539 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25539( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25540
25541 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25542 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfObject", 1)) {
25543 return false;
25544 }
25545 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25546 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25547 if (objIsXray) {
25548 unwrappedObj.emplace(cx, obj);
25549 }
25550 Record<nsString, JSObject*> arg0;
25551 RecordRooter<nsString, JSObject*> arg0_holder(cx, &arg0);
25552 if (args[0].isObject()) {
25553 auto& recordEntries = arg0.Entries();
25554
25555 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
25556 JS::RootedVector<jsid> ids(cx);
25557 if (!js::GetPropertyKeys(cx, recordObj,
25558 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
25559 return false;
25560 }
25561 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
25562 JS_ReportOutOfMemory(cx);
25563 return false;
25564 }
25565 JS::Rooted<JS::Value> propNameValue(cx);
25566 JS::Rooted<JS::Value> temp(cx);
25567 JS::Rooted<jsid> curId(cx);
25568 JS::Rooted<JS::Value> idVal(cx);
25569 // Use a hashset to keep track of ids seen, to avoid
25570 // introducing nasty O(N^2) behavior scanning for them all the
25571 // time. Ideally we'd use a data structure with O(1) lookup
25572 // _and_ ordering for the MozMap, but we don't have one lying
25573 // around.
25574 nsTHashtable<nsStringHashKey> idsSeen;
25575 for (size_t i = 0; i < ids.length(); ++i) {
25576 curId = ids[i];
25577
25578 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
25579 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
25580 &desc)) {
25581 return false;
25582 }
25583
25584 if (desc.isNothing() || !desc->enumerable()) {
25585 continue;
25586 }
25587
25588 idVal = js::IdToValue(curId);
25589 nsString propName;
25590 // This will just throw if idVal is a Symbol, like the spec says
25591 // to do.
25592 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
25593 return false;
25594 }
25595
25596 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
25597 return false;
25598 }
25599
25600 Record<nsString, JSObject*>::EntryType* entry;
25601 if (!idsSeen.EnsureInserted(propName)) {
25602 // Find the existing entry.
25603 auto idx = recordEntries.IndexOf(propName);
25604 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", 25605); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 25605); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
25605 "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", 25605); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 25605); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
25606 // Now blow it away to make it look like it was just added
25607 // to the array, because it's not obvious that it's
25608 // safe to write to its already-initialized mValue via our
25609 // normal codegen conversions. For example, the value
25610 // could be a union and this would change its type, but
25611 // codegen assumes we won't do that.
25612 entry = recordEntries.ReconstructElementAt(idx);
25613 } else {
25614 // Safe to do an infallible append here, because we did a
25615 // SetCapacity above to the right capacity.
25616 entry = recordEntries.AppendElement();
25617 }
25618 entry->mKey = propName;
25619 JSObject*& slot = entry->mValue;
25620 if (temp.isObject()) {
25621#ifdef __clang__1
25622#pragma clang diagnostic push
25623#pragma clang diagnostic ignored "-Wunreachable-code"
25624#pragma clang diagnostic ignored "-Wunreachable-code-return"
25625#endif // __clang__
25626 if ((true) && !CallerSubsumes(temp)) {
25627 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
25628 return false;
25629 }
25630#ifdef __clang__1
25631#pragma clang diagnostic pop
25632#endif // __clang__
25633 slot = &temp.toObject();
25634 } else {
25635 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
25636 return false;
25637 }
25638 }
25639 } else {
25640 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
25641 return false;
25642 }
25643 if (objIsXray) {
25644 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25645 // we know Xrays have no dynamic unwrap behavior.
25646 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25647 if (!unwrappedObj.ref()) {
25648 return false;
25649 }
25650 }
25651 FastErrorResult rv;
25652 // NOTE: This assert does NOT call the function.
25653 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");
25654 MOZ_KnownLive(self)(self)->PassRecordOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25655 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject"
)), 0))
) {
25656 return false;
25657 }
25658 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25658); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25658); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25659 args.rval().setUndefined();
25660 return true;
25661}
25662
25663static const JSJitInfo passRecordOfObject_methodinfo = {
25664 { (JSJitGetterOp)passRecordOfObject },
25665 { prototypes::id::TestJSImplInterface },
25666 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25667 JSJitInfo::Method,
25668 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25669 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25670 false, /* isInfallible. False in setters. */
25671 false, /* isMovable. Not relevant for setters. */
25672 false, /* isEliminatable. Not relevant for setters. */
25673 false, /* isAlwaysInSlot. Only relevant for getters. */
25674 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25675 false, /* isTypedMethod. Only relevant for methods. */
25676 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25677};
25678
25679MOZ_CAN_RUN_SCRIPT static bool
25680receiveObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25681{
25682 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25685( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25683 "TestJSImplInterface", "receiveObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25685( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25684 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25685( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25685 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25685( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25686
25687 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25688 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25689 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25690 if (objIsXray) {
25691 unwrappedObj.emplace(cx, obj);
25692 }
25693 if (objIsXray) {
25694 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25695 // we know Xrays have no dynamic unwrap behavior.
25696 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25697 if (!unwrappedObj.ref()) {
25698 return false;
25699 }
25700 }
25701 FastErrorResult rv;
25702 JS::Rooted<JSObject*> result(cx);
25703 // NOTE: This assert does NOT call the function.
25704 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");
25705 MOZ_KnownLive(self)(self)->ReceiveObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25706 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject"
)), 0))
) {
25707 return false;
25708 }
25709 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25709); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25709); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25710 JS::ExposeObjectToActiveJS(result);
25711 args.rval().setObject(*result);
25712 if (!MaybeWrapObjectValue(cx, args.rval())) {
25713 return false;
25714 }
25715 return true;
25716}
25717
25718static const JSJitInfo receiveObject_methodinfo = {
25719 { (JSJitGetterOp)receiveObject },
25720 { prototypes::id::TestJSImplInterface },
25721 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25722 JSJitInfo::Method,
25723 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25724 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
25725 false, /* isInfallible. False in setters. */
25726 false, /* isMovable. Not relevant for setters. */
25727 false, /* isEliminatable. Not relevant for setters. */
25728 false, /* isAlwaysInSlot. Only relevant for getters. */
25729 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25730 false, /* isTypedMethod. Only relevant for methods. */
25731 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25732};
25733
25734MOZ_CAN_RUN_SCRIPT static bool
25735receiveNullableObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25736{
25737 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25740( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25738 "TestJSImplInterface", "receiveNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25740( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25739 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25740( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25740 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25740( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25741
25742 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25743 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25744 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25745 if (objIsXray) {
25746 unwrappedObj.emplace(cx, obj);
25747 }
25748 if (objIsXray) {
25749 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25750 // we know Xrays have no dynamic unwrap behavior.
25751 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25752 if (!unwrappedObj.ref()) {
25753 return false;
25754 }
25755 }
25756 FastErrorResult rv;
25757 JS::Rooted<JSObject*> result(cx);
25758 // NOTE: This assert does NOT call the function.
25759 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");
25760 MOZ_KnownLive(self)(self)->ReceiveNullableObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25761 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject"
)), 0))
) {
25762 return false;
25763 }
25764 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25764); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25765 if (result) {
25766 JS::ExposeObjectToActiveJS(result);
25767 }
25768 args.rval().setObjectOrNull(result);
25769 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
25770 return false;
25771 }
25772 return true;
25773}
25774
25775static const JSJitInfo receiveNullableObject_methodinfo = {
25776 { (JSJitGetterOp)receiveNullableObject },
25777 { prototypes::id::TestJSImplInterface },
25778 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25779 JSJitInfo::Method,
25780 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25781 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
25782 false, /* isInfallible. False in setters. */
25783 false, /* isMovable. Not relevant for setters. */
25784 false, /* isEliminatable. Not relevant for setters. */
25785 false, /* isAlwaysInSlot. Only relevant for getters. */
25786 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25787 false, /* isTypedMethod. Only relevant for methods. */
25788 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25789};
25790
25791MOZ_CAN_RUN_SCRIPT static bool
25792passUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25793{
25794 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion");
25795 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25798( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25796 "TestJSImplInterface", "passUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25798( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25797 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25798( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25798 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25798( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25799
25800 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25801 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion", 1)) {
25802 return false;
25803 }
25804 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25805 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25806 if (objIsXray) {
25807 unwrappedObj.emplace(cx, obj);
25808 }
25809 ObjectOrLong arg0;
25810 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25811 return false;
25812 }
25813 if (objIsXray) {
25814 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25815 // we know Xrays have no dynamic unwrap behavior.
25816 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25817 if (!unwrappedObj.ref()) {
25818 return false;
25819 }
25820 }
25821 FastErrorResult rv;
25822 // NOTE: This assert does NOT call the function.
25823 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");
25824 MOZ_KnownLive(self)(self)->PassUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25825 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion"
)), 0))
) {
25826 return false;
25827 }
25828 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25828); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25828); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25829 args.rval().setUndefined();
25830 return true;
25831}
25832
25833static const JSJitInfo passUnion_methodinfo = {
25834 { (JSJitGetterOp)passUnion },
25835 { prototypes::id::TestJSImplInterface },
25836 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25837 JSJitInfo::Method,
25838 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25839 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25840 false, /* isInfallible. False in setters. */
25841 false, /* isMovable. Not relevant for setters. */
25842 false, /* isEliminatable. Not relevant for setters. */
25843 false, /* isAlwaysInSlot. Only relevant for getters. */
25844 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25845 false, /* isTypedMethod. Only relevant for methods. */
25846 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25847};
25848
25849MOZ_CAN_RUN_SCRIPT static bool
25850passUnion2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25851{
25852 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion2");
25853 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25856( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25854 "TestJSImplInterface", "passUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25856( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25855 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25856( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25856 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25856( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25857
25858 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25859 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion2", 1)) {
25860 return false;
25861 }
25862 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25863 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25864 if (objIsXray) {
25865 unwrappedObj.emplace(cx, obj);
25866 }
25867 LongOrBoolean arg0;
25868 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25869 return false;
25870 }
25871 if (objIsXray) {
25872 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25873 // we know Xrays have no dynamic unwrap behavior.
25874 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25875 if (!unwrappedObj.ref()) {
25876 return false;
25877 }
25878 }
25879 FastErrorResult rv;
25880 // NOTE: This assert does NOT call the function.
25881 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");
25882 MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25883 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2"
)), 0))
) {
25884 return false;
25885 }
25886 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25886); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25886); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25887 args.rval().setUndefined();
25888 return true;
25889}
25890
25891static const JSJitInfo passUnion2_methodinfo = {
25892 { (JSJitGetterOp)passUnion2 },
25893 { prototypes::id::TestJSImplInterface },
25894 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25895 JSJitInfo::Method,
25896 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25897 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25898 false, /* isInfallible. False in setters. */
25899 false, /* isMovable. Not relevant for setters. */
25900 false, /* isEliminatable. Not relevant for setters. */
25901 false, /* isAlwaysInSlot. Only relevant for getters. */
25902 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25903 false, /* isTypedMethod. Only relevant for methods. */
25904 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25905};
25906
25907MOZ_CAN_RUN_SCRIPT static bool
25908passUnion3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25909{
25910 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion3");
25911 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25914( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25912 "TestJSImplInterface", "passUnion3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25914( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25913 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25914( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25914 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25914( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25915
25916 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25917 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion3", 1)) {
25918 return false;
25919 }
25920 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25921 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25922 if (objIsXray) {
25923 unwrappedObj.emplace(cx, obj);
25924 }
25925 ObjectOrLongOrBoolean arg0;
25926 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25927 return false;
25928 }
25929 if (objIsXray) {
25930 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25931 // we know Xrays have no dynamic unwrap behavior.
25932 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25933 if (!unwrappedObj.ref()) {
25934 return false;
25935 }
25936 }
25937 FastErrorResult rv;
25938 // NOTE: This assert does NOT call the function.
25939 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");
25940 MOZ_KnownLive(self)(self)->PassUnion3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25941 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3"
)), 0))
) {
25942 return false;
25943 }
25944 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25944); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 25944); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
25945 args.rval().setUndefined();
25946 return true;
25947}
25948
25949static const JSJitInfo passUnion3_methodinfo = {
25950 { (JSJitGetterOp)passUnion3 },
25951 { prototypes::id::TestJSImplInterface },
25952 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25953 JSJitInfo::Method,
25954 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25955 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25956 false, /* isInfallible. False in setters. */
25957 false, /* isMovable. Not relevant for setters. */
25958 false, /* isEliminatable. Not relevant for setters. */
25959 false, /* isAlwaysInSlot. Only relevant for getters. */
25960 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25961 false, /* isTypedMethod. Only relevant for methods. */
25962 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25963};
25964
25965MOZ_CAN_RUN_SCRIPT static bool
25966passUnion4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25967{
25968 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion4");
25969 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25972( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25970 "TestJSImplInterface", "passUnion4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25972( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25971 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25972( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25972 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25972( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25973
25974 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25975 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion4", 1)) {
25976 return false;
25977 }
25978 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25979 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25980 if (objIsXray) {
25981 unwrappedObj.emplace(cx, obj);
25982 }
25983 NodeOrLongOrBoolean arg0;
25984 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25985 return false;
25986 }
25987 if (objIsXray) {
25988 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25989 // we know Xrays have no dynamic unwrap behavior.
25990 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25991 if (!unwrappedObj.ref()) {
25992 return false;
25993 }
25994 }
25995 FastErrorResult rv;
25996 // NOTE: This assert does NOT call the function.
25997 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");
25998 MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25999 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4"
)), 0))
) {
26000 return false;
26001 }
26002 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26002); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26002); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26003 args.rval().setUndefined();
26004 return true;
26005}
26006
26007static const JSJitInfo passUnion4_methodinfo = {
26008 { (JSJitGetterOp)passUnion4 },
26009 { prototypes::id::TestJSImplInterface },
26010 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26011 JSJitInfo::Method,
26012 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26013 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26014 false, /* isInfallible. False in setters. */
26015 false, /* isMovable. Not relevant for setters. */
26016 false, /* isEliminatable. Not relevant for setters. */
26017 false, /* isAlwaysInSlot. Only relevant for getters. */
26018 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26019 false, /* isTypedMethod. Only relevant for methods. */
26020 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26021};
26022
26023MOZ_CAN_RUN_SCRIPT static bool
26024passUnion5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26025{
26026 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion5");
26027 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26030( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26028 "TestJSImplInterface", "passUnion5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26030( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26029 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26030( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26030 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26030( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26031
26032 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26033 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion5", 1)) {
26034 return false;
26035 }
26036 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26037 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26038 if (objIsXray) {
26039 unwrappedObj.emplace(cx, obj);
26040 }
26041 ObjectOrBoolean arg0;
26042 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26043 return false;
26044 }
26045 if (objIsXray) {
26046 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26047 // we know Xrays have no dynamic unwrap behavior.
26048 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26049 if (!unwrappedObj.ref()) {
26050 return false;
26051 }
26052 }
26053 FastErrorResult rv;
26054 // NOTE: This assert does NOT call the function.
26055 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");
26056 MOZ_KnownLive(self)(self)->PassUnion5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26057 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5"
)), 0))
) {
26058 return false;
26059 }
26060 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26060); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26060); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26061 args.rval().setUndefined();
26062 return true;
26063}
26064
26065static const JSJitInfo passUnion5_methodinfo = {
26066 { (JSJitGetterOp)passUnion5 },
26067 { prototypes::id::TestJSImplInterface },
26068 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26069 JSJitInfo::Method,
26070 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26071 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26072 false, /* isInfallible. False in setters. */
26073 false, /* isMovable. Not relevant for setters. */
26074 false, /* isEliminatable. Not relevant for setters. */
26075 false, /* isAlwaysInSlot. Only relevant for getters. */
26076 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26077 false, /* isTypedMethod. Only relevant for methods. */
26078 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26079};
26080
26081MOZ_CAN_RUN_SCRIPT static bool
26082passUnion6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26083{
26084 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion6");
26085 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26088( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26086 "TestJSImplInterface", "passUnion6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26088( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26087 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26088( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26088 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26088( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26089
26090 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26091 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion6", 1)) {
26092 return false;
26093 }
26094 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26095 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26096 if (objIsXray) {
26097 unwrappedObj.emplace(cx, obj);
26098 }
26099 ObjectOrString arg0;
26100 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26101 return false;
26102 }
26103 if (objIsXray) {
26104 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26105 // we know Xrays have no dynamic unwrap behavior.
26106 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26107 if (!unwrappedObj.ref()) {
26108 return false;
26109 }
26110 }
26111 FastErrorResult rv;
26112 // NOTE: This assert does NOT call the function.
26113 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");
26114 MOZ_KnownLive(self)(self)->PassUnion6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26115 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6"
)), 0))
) {
26116 return false;
26117 }
26118 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26118); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26118); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26119 args.rval().setUndefined();
26120 return true;
26121}
26122
26123static const JSJitInfo passUnion6_methodinfo = {
26124 { (JSJitGetterOp)passUnion6 },
26125 { prototypes::id::TestJSImplInterface },
26126 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26127 JSJitInfo::Method,
26128 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26129 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26130 false, /* isInfallible. False in setters. */
26131 false, /* isMovable. Not relevant for setters. */
26132 false, /* isEliminatable. Not relevant for setters. */
26133 false, /* isAlwaysInSlot. Only relevant for getters. */
26134 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26135 false, /* isTypedMethod. Only relevant for methods. */
26136 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26137};
26138
26139MOZ_CAN_RUN_SCRIPT static bool
26140passUnion7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26141{
26142 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion7");
26143 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26146( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26144 "TestJSImplInterface", "passUnion7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26146( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26145 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26146( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26146 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26146( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26147
26148 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26149 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion7", 1)) {
26150 return false;
26151 }
26152 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26153 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26154 if (objIsXray) {
26155 unwrappedObj.emplace(cx, obj);
26156 }
26157 ObjectOrStringOrLong arg0;
26158 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26159 return false;
26160 }
26161 if (objIsXray) {
26162 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26163 // we know Xrays have no dynamic unwrap behavior.
26164 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26165 if (!unwrappedObj.ref()) {
26166 return false;
26167 }
26168 }
26169 FastErrorResult rv;
26170 // NOTE: This assert does NOT call the function.
26171 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");
26172 MOZ_KnownLive(self)(self)->PassUnion7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26173 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7"
)), 0))
) {
26174 return false;
26175 }
26176 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26176); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26177 args.rval().setUndefined();
26178 return true;
26179}
26180
26181static const JSJitInfo passUnion7_methodinfo = {
26182 { (JSJitGetterOp)passUnion7 },
26183 { prototypes::id::TestJSImplInterface },
26184 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26185 JSJitInfo::Method,
26186 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26187 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26188 false, /* isInfallible. False in setters. */
26189 false, /* isMovable. Not relevant for setters. */
26190 false, /* isEliminatable. Not relevant for setters. */
26191 false, /* isAlwaysInSlot. Only relevant for getters. */
26192 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26193 false, /* isTypedMethod. Only relevant for methods. */
26194 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26195};
26196
26197MOZ_CAN_RUN_SCRIPT static bool
26198passUnion8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26199{
26200 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion8");
26201 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26204( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26202 "TestJSImplInterface", "passUnion8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26204( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26203 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26204( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26204 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26204( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26205
26206 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26207 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion8", 1)) {
26208 return false;
26209 }
26210 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26211 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26212 if (objIsXray) {
26213 unwrappedObj.emplace(cx, obj);
26214 }
26215 ObjectOrStringOrBoolean arg0;
26216 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26217 return false;
26218 }
26219 if (objIsXray) {
26220 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26221 // we know Xrays have no dynamic unwrap behavior.
26222 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26223 if (!unwrappedObj.ref()) {
26224 return false;
26225 }
26226 }
26227 FastErrorResult rv;
26228 // NOTE: This assert does NOT call the function.
26229 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");
26230 MOZ_KnownLive(self)(self)->PassUnion8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26231 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8"
)), 0))
) {
26232 return false;
26233 }
26234 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26234); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26234); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26235 args.rval().setUndefined();
26236 return true;
26237}
26238
26239static const JSJitInfo passUnion8_methodinfo = {
26240 { (JSJitGetterOp)passUnion8 },
26241 { prototypes::id::TestJSImplInterface },
26242 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26243 JSJitInfo::Method,
26244 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26245 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26246 false, /* isInfallible. False in setters. */
26247 false, /* isMovable. Not relevant for setters. */
26248 false, /* isEliminatable. Not relevant for setters. */
26249 false, /* isAlwaysInSlot. Only relevant for getters. */
26250 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26251 false, /* isTypedMethod. Only relevant for methods. */
26252 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26253};
26254
26255MOZ_CAN_RUN_SCRIPT static bool
26256passUnion9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26257{
26258 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion9");
26259 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26262( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26260 "TestJSImplInterface", "passUnion9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26262( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26261 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26262( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26262 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26262( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26263
26264 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26265 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion9", 1)) {
26266 return false;
26267 }
26268 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26269 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26270 if (objIsXray) {
26271 unwrappedObj.emplace(cx, obj);
26272 }
26273 ObjectOrStringOrLongOrBoolean arg0;
26274 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26275 return false;
26276 }
26277 if (objIsXray) {
26278 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26279 // we know Xrays have no dynamic unwrap behavior.
26280 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26281 if (!unwrappedObj.ref()) {
26282 return false;
26283 }
26284 }
26285 FastErrorResult rv;
26286 // NOTE: This assert does NOT call the function.
26287 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");
26288 MOZ_KnownLive(self)(self)->PassUnion9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26289 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9"
)), 0))
) {
26290 return false;
26291 }
26292 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26292); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26292); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26293 args.rval().setUndefined();
26294 return true;
26295}
26296
26297static const JSJitInfo passUnion9_methodinfo = {
26298 { (JSJitGetterOp)passUnion9 },
26299 { prototypes::id::TestJSImplInterface },
26300 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26301 JSJitInfo::Method,
26302 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26303 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26304 false, /* isInfallible. False in setters. */
26305 false, /* isMovable. Not relevant for setters. */
26306 false, /* isEliminatable. Not relevant for setters. */
26307 false, /* isAlwaysInSlot. Only relevant for getters. */
26308 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26309 false, /* isTypedMethod. Only relevant for methods. */
26310 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26311};
26312
26313MOZ_CAN_RUN_SCRIPT static bool
26314passUnion10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26315{
26316 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion10");
26317 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26320( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26318 "TestJSImplInterface", "passUnion10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26320( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26319 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26320( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26320 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26320( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26321
26322 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26323 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26324 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26325 if (objIsXray) {
26326 unwrappedObj.emplace(cx, obj);
26327 }
26328 EventInitOrLong arg0;
26329 if (!(args.hasDefined(0))) {
26330 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or long)")) {
26331 return false;
26332 }
26333 } else {
26334 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26335 return false;
26336 }
26337 }
26338 if (objIsXray) {
26339 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26340 // we know Xrays have no dynamic unwrap behavior.
26341 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26342 if (!unwrappedObj.ref()) {
26343 return false;
26344 }
26345 }
26346 FastErrorResult rv;
26347 // NOTE: This assert does NOT call the function.
26348 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");
26349 MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26350 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10"
)), 0))
) {
26351 return false;
26352 }
26353 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26353); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26353); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26354 args.rval().setUndefined();
26355 return true;
26356}
26357
26358static const JSJitInfo passUnion10_methodinfo = {
26359 { (JSJitGetterOp)passUnion10 },
26360 { prototypes::id::TestJSImplInterface },
26361 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26362 JSJitInfo::Method,
26363 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26364 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26365 false, /* isInfallible. False in setters. */
26366 false, /* isMovable. Not relevant for setters. */
26367 false, /* isEliminatable. Not relevant for setters. */
26368 false, /* isAlwaysInSlot. Only relevant for getters. */
26369 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26370 false, /* isTypedMethod. Only relevant for methods. */
26371 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26372};
26373
26374MOZ_CAN_RUN_SCRIPT static bool
26375passUnion11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26376{
26377 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion11");
26378 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26381( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26379 "TestJSImplInterface", "passUnion11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26381( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26380 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26381( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26381 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26381( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26382
26383 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26384 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26385 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26386 if (objIsXray) {
26387 unwrappedObj.emplace(cx, obj);
26388 }
26389 CustomEventInitOrLong arg0;
26390 if (!(args.hasDefined(0))) {
26391 if (!arg0.RawSetAsCustomEventInit(cx).Init(cx, JS::NullHandleValue, "Member of (CustomEventInit or long)")) {
26392 return false;
26393 }
26394 } else {
26395 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26396 return false;
26397 }
26398 }
26399 if (objIsXray) {
26400 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26401 // we know Xrays have no dynamic unwrap behavior.
26402 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26403 if (!unwrappedObj.ref()) {
26404 return false;
26405 }
26406 }
26407 FastErrorResult rv;
26408 // NOTE: This assert does NOT call the function.
26409 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");
26410 MOZ_KnownLive(self)(self)->PassUnion11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26411 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11"
)), 0))
) {
26412 return false;
26413 }
26414 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26414); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26414); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26415 args.rval().setUndefined();
26416 return true;
26417}
26418
26419static const JSJitInfo passUnion11_methodinfo = {
26420 { (JSJitGetterOp)passUnion11 },
26421 { prototypes::id::TestJSImplInterface },
26422 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26423 JSJitInfo::Method,
26424 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26425 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26426 false, /* isInfallible. False in setters. */
26427 false, /* isMovable. Not relevant for setters. */
26428 false, /* isEliminatable. Not relevant for setters. */
26429 false, /* isAlwaysInSlot. Only relevant for getters. */
26430 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26431 false, /* isTypedMethod. Only relevant for methods. */
26432 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26433};
26434
26435MOZ_CAN_RUN_SCRIPT static bool
26436passUnion12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26437{
26438 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion12");
26439 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26442( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26440 "TestJSImplInterface", "passUnion12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26442( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26441 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26442( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26442 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26442( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26443
26444 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26445 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26446 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26447 if (objIsXray) {
26448 unwrappedObj.emplace(cx, obj);
26449 }
26450 EventInitOrLong arg0;
26451 if (!(args.hasDefined(0))) {
26452 arg0.RawSetAsLong() = 5;
26453 } else {
26454 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26455 return false;
26456 }
26457 }
26458 if (objIsXray) {
26459 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26460 // we know Xrays have no dynamic unwrap behavior.
26461 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26462 if (!unwrappedObj.ref()) {
26463 return false;
26464 }
26465 }
26466 FastErrorResult rv;
26467 // NOTE: This assert does NOT call the function.
26468 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");
26469 MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12"
)), 0))
) {
26471 return false;
26472 }
26473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26473); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26474 args.rval().setUndefined();
26475 return true;
26476}
26477
26478static const JSJitInfo passUnion12_methodinfo = {
26479 { (JSJitGetterOp)passUnion12 },
26480 { prototypes::id::TestJSImplInterface },
26481 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26482 JSJitInfo::Method,
26483 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26484 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26485 false, /* isInfallible. False in setters. */
26486 false, /* isMovable. Not relevant for setters. */
26487 false, /* isEliminatable. Not relevant for setters. */
26488 false, /* isAlwaysInSlot. Only relevant for getters. */
26489 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26490 false, /* isTypedMethod. Only relevant for methods. */
26491 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26492};
26493
26494MOZ_CAN_RUN_SCRIPT static bool
26495passUnion13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26496{
26497 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion13");
26498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26501( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26499 "TestJSImplInterface", "passUnion13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26501( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26501( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26501( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26502
26503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26504 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26505 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26506 if (objIsXray) {
26507 unwrappedObj.emplace(cx, obj);
26508 }
26509 ObjectOrLongOrNull arg0;
26510 if (!(args.hasDefined(0))) {
26511 arg0.SetNull();
26512 } else {
26513 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26514 return false;
26515 }
26516 }
26517 if (objIsXray) {
26518 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26519 // we know Xrays have no dynamic unwrap behavior.
26520 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26521 if (!unwrappedObj.ref()) {
26522 return false;
26523 }
26524 }
26525 FastErrorResult rv;
26526 // NOTE: This assert does NOT call the function.
26527 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");
26528 MOZ_KnownLive(self)(self)->PassUnion13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26529 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13"
)), 0))
) {
26530 return false;
26531 }
26532 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26532); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26532); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26533 args.rval().setUndefined();
26534 return true;
26535}
26536
26537static const JSJitInfo passUnion13_methodinfo = {
26538 { (JSJitGetterOp)passUnion13 },
26539 { prototypes::id::TestJSImplInterface },
26540 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26541 JSJitInfo::Method,
26542 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26543 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26544 false, /* isInfallible. False in setters. */
26545 false, /* isMovable. Not relevant for setters. */
26546 false, /* isEliminatable. Not relevant for setters. */
26547 false, /* isAlwaysInSlot. Only relevant for getters. */
26548 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26549 false, /* isTypedMethod. Only relevant for methods. */
26550 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26551};
26552
26553MOZ_CAN_RUN_SCRIPT static bool
26554passUnion14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26555{
26556 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion14");
26557 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26560( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26558 "TestJSImplInterface", "passUnion14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26560( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26559 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26560( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26560 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26560( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26561
26562 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26563 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26564 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26565 if (objIsXray) {
26566 unwrappedObj.emplace(cx, obj);
26567 }
26568 ObjectOrLongOrNull arg0;
26569 if (!(args.hasDefined(0))) {
26570 arg0.RawSetAsLong() = 5;
26571 } else {
26572 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26573 return false;
26574 }
26575 }
26576 if (objIsXray) {
26577 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26578 // we know Xrays have no dynamic unwrap behavior.
26579 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26580 if (!unwrappedObj.ref()) {
26581 return false;
26582 }
26583 }
26584 FastErrorResult rv;
26585 // NOTE: This assert does NOT call the function.
26586 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");
26587 MOZ_KnownLive(self)(self)->PassUnion14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26588 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14"
)), 0))
) {
26589 return false;
26590 }
26591 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26591); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26591); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26592 args.rval().setUndefined();
26593 return true;
26594}
26595
26596static const JSJitInfo passUnion14_methodinfo = {
26597 { (JSJitGetterOp)passUnion14 },
26598 { prototypes::id::TestJSImplInterface },
26599 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26600 JSJitInfo::Method,
26601 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26602 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26603 false, /* isInfallible. False in setters. */
26604 false, /* isMovable. Not relevant for setters. */
26605 false, /* isEliminatable. Not relevant for setters. */
26606 false, /* isAlwaysInSlot. Only relevant for getters. */
26607 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26608 false, /* isTypedMethod. Only relevant for methods. */
26609 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26610};
26611
26612MOZ_CAN_RUN_SCRIPT static bool
26613passUnion15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26614{
26615 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion15");
26616 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26619( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26617 "TestJSImplInterface", "passUnion15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26619( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26618 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26619( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26619 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26619( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26620
26621 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26622 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion15", 1)) {
26623 return false;
26624 }
26625 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26626 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26627 if (objIsXray) {
26628 unwrappedObj.emplace(cx, obj);
26629 }
26630 LongSequenceOrLong arg0;
26631 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26632 return false;
26633 }
26634 if (objIsXray) {
26635 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26636 // we know Xrays have no dynamic unwrap behavior.
26637 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26638 if (!unwrappedObj.ref()) {
26639 return false;
26640 }
26641 }
26642 FastErrorResult rv;
26643 // NOTE: This assert does NOT call the function.
26644 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");
26645 MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26646 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15"
)), 0))
) {
26647 return false;
26648 }
26649 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26649); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26649); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26650 args.rval().setUndefined();
26651 return true;
26652}
26653
26654static const JSJitInfo passUnion15_methodinfo = {
26655 { (JSJitGetterOp)passUnion15 },
26656 { prototypes::id::TestJSImplInterface },
26657 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26658 JSJitInfo::Method,
26659 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26660 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26661 false, /* isInfallible. False in setters. */
26662 false, /* isMovable. Not relevant for setters. */
26663 false, /* isEliminatable. Not relevant for setters. */
26664 false, /* isAlwaysInSlot. Only relevant for getters. */
26665 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26666 false, /* isTypedMethod. Only relevant for methods. */
26667 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26668};
26669
26670MOZ_CAN_RUN_SCRIPT static bool
26671passUnion16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26672{
26673 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion16");
26674 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26677( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26675 "TestJSImplInterface", "passUnion16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26677( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26676 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26677( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26677 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26677( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26678
26679 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26680 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26681 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26682 if (objIsXray) {
26683 unwrappedObj.emplace(cx, obj);
26684 }
26685 Optional<LongSequenceOrLong> arg0;
26686 if (args.hasDefined(0)) {
26687 arg0.Construct();
26688 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
26689 return false;
26690 }
26691 }
26692 if (objIsXray) {
26693 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26694 // we know Xrays have no dynamic unwrap behavior.
26695 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26696 if (!unwrappedObj.ref()) {
26697 return false;
26698 }
26699 }
26700 FastErrorResult rv;
26701 // NOTE: This assert does NOT call the function.
26702 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");
26703 MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26704 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16"
)), 0))
) {
26705 return false;
26706 }
26707 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26707); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26707); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26708 args.rval().setUndefined();
26709 return true;
26710}
26711
26712static const JSJitInfo passUnion16_methodinfo = {
26713 { (JSJitGetterOp)passUnion16 },
26714 { prototypes::id::TestJSImplInterface },
26715 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26716 JSJitInfo::Method,
26717 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26718 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26719 false, /* isInfallible. False in setters. */
26720 false, /* isMovable. Not relevant for setters. */
26721 false, /* isEliminatable. Not relevant for setters. */
26722 false, /* isAlwaysInSlot. Only relevant for getters. */
26723 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26724 false, /* isTypedMethod. Only relevant for methods. */
26725 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26726};
26727
26728MOZ_CAN_RUN_SCRIPT static bool
26729passUnion17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26730{
26731 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion17");
26732 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26735( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26733 "TestJSImplInterface", "passUnion17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26735( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26734 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26735( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26735 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26735( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26736
26737 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26738 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26739 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26740 if (objIsXray) {
26741 unwrappedObj.emplace(cx, obj);
26742 }
26743 LongSequenceOrNullOrLong arg0;
26744 if (!(args.hasDefined(0))) {
26745 arg0.RawSetAsLong() = 5;
26746 } else {
26747 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26748 return false;
26749 }
26750 }
26751 if (objIsXray) {
26752 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26753 // we know Xrays have no dynamic unwrap behavior.
26754 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26755 if (!unwrappedObj.ref()) {
26756 return false;
26757 }
26758 }
26759 FastErrorResult rv;
26760 // NOTE: This assert does NOT call the function.
26761 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");
26762 MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26763 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17"
)), 0))
) {
26764 return false;
26765 }
26766 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26766); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26766); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26767 args.rval().setUndefined();
26768 return true;
26769}
26770
26771static const JSJitInfo passUnion17_methodinfo = {
26772 { (JSJitGetterOp)passUnion17 },
26773 { prototypes::id::TestJSImplInterface },
26774 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26775 JSJitInfo::Method,
26776 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26777 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26778 false, /* isInfallible. False in setters. */
26779 false, /* isMovable. Not relevant for setters. */
26780 false, /* isEliminatable. Not relevant for setters. */
26781 false, /* isAlwaysInSlot. Only relevant for getters. */
26782 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26783 false, /* isTypedMethod. Only relevant for methods. */
26784 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26785};
26786
26787MOZ_CAN_RUN_SCRIPT static bool
26788passUnion18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26789{
26790 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion18");
26791 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26794( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26792 "TestJSImplInterface", "passUnion18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26794( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26793 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26794( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26794 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26794( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26795
26796 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26797 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion18", 1)) {
26798 return false;
26799 }
26800 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26801 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26802 if (objIsXray) {
26803 unwrappedObj.emplace(cx, obj);
26804 }
26805 ObjectSequenceOrLong arg0;
26806 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26807 return false;
26808 }
26809 if (objIsXray) {
26810 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26811 // we know Xrays have no dynamic unwrap behavior.
26812 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26813 if (!unwrappedObj.ref()) {
26814 return false;
26815 }
26816 }
26817 FastErrorResult rv;
26818 // NOTE: This assert does NOT call the function.
26819 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");
26820 MOZ_KnownLive(self)(self)->PassUnion18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26821 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18"
)), 0))
) {
26822 return false;
26823 }
26824 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26824); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26824); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26825 args.rval().setUndefined();
26826 return true;
26827}
26828
26829static const JSJitInfo passUnion18_methodinfo = {
26830 { (JSJitGetterOp)passUnion18 },
26831 { prototypes::id::TestJSImplInterface },
26832 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26833 JSJitInfo::Method,
26834 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26835 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26836 false, /* isInfallible. False in setters. */
26837 false, /* isMovable. Not relevant for setters. */
26838 false, /* isEliminatable. Not relevant for setters. */
26839 false, /* isAlwaysInSlot. Only relevant for getters. */
26840 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26841 false, /* isTypedMethod. Only relevant for methods. */
26842 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26843};
26844
26845MOZ_CAN_RUN_SCRIPT static bool
26846passUnion19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26847{
26848 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion19");
26849 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26852( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26850 "TestJSImplInterface", "passUnion19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26852( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26851 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26852( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26852 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26852( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26853
26854 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26855 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26856 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26857 if (objIsXray) {
26858 unwrappedObj.emplace(cx, obj);
26859 }
26860 Optional<ObjectSequenceOrLong> arg0;
26861 if (args.hasDefined(0)) {
26862 arg0.Construct();
26863 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
26864 return false;
26865 }
26866 }
26867 if (objIsXray) {
26868 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26869 // we know Xrays have no dynamic unwrap behavior.
26870 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26871 if (!unwrappedObj.ref()) {
26872 return false;
26873 }
26874 }
26875 FastErrorResult rv;
26876 // NOTE: This assert does NOT call the function.
26877 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");
26878 MOZ_KnownLive(self)(self)->PassUnion19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26879 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19"
)), 0))
) {
26880 return false;
26881 }
26882 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26882); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26882); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26883 args.rval().setUndefined();
26884 return true;
26885}
26886
26887static const JSJitInfo passUnion19_methodinfo = {
26888 { (JSJitGetterOp)passUnion19 },
26889 { prototypes::id::TestJSImplInterface },
26890 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26891 JSJitInfo::Method,
26892 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26893 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26894 false, /* isInfallible. False in setters. */
26895 false, /* isMovable. Not relevant for setters. */
26896 false, /* isEliminatable. Not relevant for setters. */
26897 false, /* isAlwaysInSlot. Only relevant for getters. */
26898 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26899 false, /* isTypedMethod. Only relevant for methods. */
26900 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26901};
26902
26903MOZ_CAN_RUN_SCRIPT static bool
26904passUnion20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26905{
26906 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion20");
26907 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26910( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26908 "TestJSImplInterface", "passUnion20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26910( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26909 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26910( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26910 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26910( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26911
26912 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26913 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26914 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26915 if (objIsXray) {
26916 unwrappedObj.emplace(cx, obj);
26917 }
26918 ObjectSequenceOrLong arg0;
26919 if (!(args.hasDefined(0))) {
26920 Unused << arg0.RawSetAsObjectSequence(cx);
26921 } else {
26922 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26923 return false;
26924 }
26925 }
26926 if (objIsXray) {
26927 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26928 // we know Xrays have no dynamic unwrap behavior.
26929 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26930 if (!unwrappedObj.ref()) {
26931 return false;
26932 }
26933 }
26934 FastErrorResult rv;
26935 // NOTE: This assert does NOT call the function.
26936 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");
26937 MOZ_KnownLive(self)(self)->PassUnion20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26938 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20"
)), 0))
) {
26939 return false;
26940 }
26941 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26941); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26941); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
26942 args.rval().setUndefined();
26943 return true;
26944}
26945
26946static const JSJitInfo passUnion20_methodinfo = {
26947 { (JSJitGetterOp)passUnion20 },
26948 { prototypes::id::TestJSImplInterface },
26949 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26950 JSJitInfo::Method,
26951 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26952 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26953 false, /* isInfallible. False in setters. */
26954 false, /* isMovable. Not relevant for setters. */
26955 false, /* isEliminatable. Not relevant for setters. */
26956 false, /* isAlwaysInSlot. Only relevant for getters. */
26957 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26958 false, /* isTypedMethod. Only relevant for methods. */
26959 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26960};
26961
26962MOZ_CAN_RUN_SCRIPT static bool
26963passUnion21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26964{
26965 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion21");
26966 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26969( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26967 "TestJSImplInterface", "passUnion21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26969( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26968 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26969( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26969 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26969( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26970
26971 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26972 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion21", 1)) {
26973 return false;
26974 }
26975 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26976 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26977 if (objIsXray) {
26978 unwrappedObj.emplace(cx, obj);
26979 }
26980 StringLongRecordOrLong arg0;
26981 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26982 return false;
26983 }
26984 if (objIsXray) {
26985 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26986 // we know Xrays have no dynamic unwrap behavior.
26987 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26988 if (!unwrappedObj.ref()) {
26989 return false;
26990 }
26991 }
26992 FastErrorResult rv;
26993 // NOTE: This assert does NOT call the function.
26994 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");
26995 MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26996 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21"
)), 0))
) {
26997 return false;
26998 }
26999 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26999); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 26999); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27000 args.rval().setUndefined();
27001 return true;
27002}
27003
27004static const JSJitInfo passUnion21_methodinfo = {
27005 { (JSJitGetterOp)passUnion21 },
27006 { prototypes::id::TestJSImplInterface },
27007 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27008 JSJitInfo::Method,
27009 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27010 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27011 false, /* isInfallible. False in setters. */
27012 false, /* isMovable. Not relevant for setters. */
27013 false, /* isEliminatable. Not relevant for setters. */
27014 false, /* isAlwaysInSlot. Only relevant for getters. */
27015 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27016 false, /* isTypedMethod. Only relevant for methods. */
27017 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27018};
27019
27020MOZ_CAN_RUN_SCRIPT static bool
27021passUnion22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27022{
27023 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion22");
27024 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27027( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27025 "TestJSImplInterface", "passUnion22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27027( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27026 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27027( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27027 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27027( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27028
27029 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27030 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion22", 1)) {
27031 return false;
27032 }
27033 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27034 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27035 if (objIsXray) {
27036 unwrappedObj.emplace(cx, obj);
27037 }
27038 StringObjectRecordOrLong arg0;
27039 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27040 return false;
27041 }
27042 if (objIsXray) {
27043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27044 // we know Xrays have no dynamic unwrap behavior.
27045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27046 if (!unwrappedObj.ref()) {
27047 return false;
27048 }
27049 }
27050 FastErrorResult rv;
27051 // NOTE: This assert does NOT call the function.
27052 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");
27053 MOZ_KnownLive(self)(self)->PassUnion22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22"
)), 0))
) {
27055 return false;
27056 }
27057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27057); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27058 args.rval().setUndefined();
27059 return true;
27060}
27061
27062static const JSJitInfo passUnion22_methodinfo = {
27063 { (JSJitGetterOp)passUnion22 },
27064 { prototypes::id::TestJSImplInterface },
27065 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27066 JSJitInfo::Method,
27067 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27068 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27069 false, /* isInfallible. False in setters. */
27070 false, /* isMovable. Not relevant for setters. */
27071 false, /* isEliminatable. Not relevant for setters. */
27072 false, /* isAlwaysInSlot. Only relevant for getters. */
27073 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27074 false, /* isTypedMethod. Only relevant for methods. */
27075 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27076};
27077
27078MOZ_CAN_RUN_SCRIPT static bool
27079passUnion23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27080{
27081 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion23");
27082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27085( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27083 "TestJSImplInterface", "passUnion23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27085( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27085( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27085( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27086
27087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27088 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion23", 1)) {
27089 return false;
27090 }
27091 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27092 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27093 if (objIsXray) {
27094 unwrappedObj.emplace(cx, obj);
27095 }
27096 ImageDataSequenceOrLong arg0;
27097 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27098 return false;
27099 }
27100 if (objIsXray) {
27101 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27102 // we know Xrays have no dynamic unwrap behavior.
27103 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27104 if (!unwrappedObj.ref()) {
27105 return false;
27106 }
27107 }
27108 FastErrorResult rv;
27109 // NOTE: This assert does NOT call the function.
27110 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");
27111 MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27112 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23"
)), 0))
) {
27113 return false;
27114 }
27115 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27115); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27115); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27116 args.rval().setUndefined();
27117 return true;
27118}
27119
27120static const JSJitInfo passUnion23_methodinfo = {
27121 { (JSJitGetterOp)passUnion23 },
27122 { prototypes::id::TestJSImplInterface },
27123 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27124 JSJitInfo::Method,
27125 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27126 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27127 false, /* isInfallible. False in setters. */
27128 false, /* isMovable. Not relevant for setters. */
27129 false, /* isEliminatable. Not relevant for setters. */
27130 false, /* isAlwaysInSlot. Only relevant for getters. */
27131 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27132 false, /* isTypedMethod. Only relevant for methods. */
27133 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27134};
27135
27136MOZ_CAN_RUN_SCRIPT static bool
27137passUnion24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27138{
27139 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion24");
27140 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27143( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27141 "TestJSImplInterface", "passUnion24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27143( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27142 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27143( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27143 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27143( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27144
27145 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27146 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion24", 1)) {
27147 return false;
27148 }
27149 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27150 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27151 if (objIsXray) {
27152 unwrappedObj.emplace(cx, obj);
27153 }
27154 ImageDataOrNullSequenceOrLong arg0;
27155 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27156 return false;
27157 }
27158 if (objIsXray) {
27159 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27160 // we know Xrays have no dynamic unwrap behavior.
27161 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27162 if (!unwrappedObj.ref()) {
27163 return false;
27164 }
27165 }
27166 FastErrorResult rv;
27167 // NOTE: This assert does NOT call the function.
27168 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");
27169 MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27170 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24"
)), 0))
) {
27171 return false;
27172 }
27173 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27173); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27173); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27174 args.rval().setUndefined();
27175 return true;
27176}
27177
27178static const JSJitInfo passUnion24_methodinfo = {
27179 { (JSJitGetterOp)passUnion24 },
27180 { prototypes::id::TestJSImplInterface },
27181 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27182 JSJitInfo::Method,
27183 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27184 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27185 false, /* isInfallible. False in setters. */
27186 false, /* isMovable. Not relevant for setters. */
27187 false, /* isEliminatable. Not relevant for setters. */
27188 false, /* isAlwaysInSlot. Only relevant for getters. */
27189 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27190 false, /* isTypedMethod. Only relevant for methods. */
27191 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27192};
27193
27194MOZ_CAN_RUN_SCRIPT static bool
27195passUnion25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27196{
27197 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion25");
27198 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27201( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27199 "TestJSImplInterface", "passUnion25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27201( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27200 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27201( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27201 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27201( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27202
27203 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27204 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion25", 1)) {
27205 return false;
27206 }
27207 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27208 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27209 if (objIsXray) {
27210 unwrappedObj.emplace(cx, obj);
27211 }
27212 ImageDataSequenceSequenceOrLong arg0;
27213 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27214 return false;
27215 }
27216 if (objIsXray) {
27217 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27218 // we know Xrays have no dynamic unwrap behavior.
27219 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27220 if (!unwrappedObj.ref()) {
27221 return false;
27222 }
27223 }
27224 FastErrorResult rv;
27225 // NOTE: This assert does NOT call the function.
27226 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");
27227 MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27228 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25"
)), 0))
) {
27229 return false;
27230 }
27231 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27231); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27232 args.rval().setUndefined();
27233 return true;
27234}
27235
27236static const JSJitInfo passUnion25_methodinfo = {
27237 { (JSJitGetterOp)passUnion25 },
27238 { prototypes::id::TestJSImplInterface },
27239 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27240 JSJitInfo::Method,
27241 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27242 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27243 false, /* isInfallible. False in setters. */
27244 false, /* isMovable. Not relevant for setters. */
27245 false, /* isEliminatable. Not relevant for setters. */
27246 false, /* isAlwaysInSlot. Only relevant for getters. */
27247 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27248 false, /* isTypedMethod. Only relevant for methods. */
27249 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27250};
27251
27252MOZ_CAN_RUN_SCRIPT static bool
27253passUnion26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27254{
27255 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion26");
27256 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27259( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27257 "TestJSImplInterface", "passUnion26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27259( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27258 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27259( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27259 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27259( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27260
27261 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27262 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion26", 1)) {
27263 return false;
27264 }
27265 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27266 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27267 if (objIsXray) {
27268 unwrappedObj.emplace(cx, obj);
27269 }
27270 ImageDataOrNullSequenceSequenceOrLong arg0;
27271 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27272 return false;
27273 }
27274 if (objIsXray) {
27275 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27276 // we know Xrays have no dynamic unwrap behavior.
27277 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27278 if (!unwrappedObj.ref()) {
27279 return false;
27280 }
27281 }
27282 FastErrorResult rv;
27283 // NOTE: This assert does NOT call the function.
27284 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");
27285 MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27286 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26"
)), 0))
) {
27287 return false;
27288 }
27289 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27289); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27289); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27290 args.rval().setUndefined();
27291 return true;
27292}
27293
27294static const JSJitInfo passUnion26_methodinfo = {
27295 { (JSJitGetterOp)passUnion26 },
27296 { prototypes::id::TestJSImplInterface },
27297 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27298 JSJitInfo::Method,
27299 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27300 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27301 false, /* isInfallible. False in setters. */
27302 false, /* isMovable. Not relevant for setters. */
27303 false, /* isEliminatable. Not relevant for setters. */
27304 false, /* isAlwaysInSlot. Only relevant for getters. */
27305 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27306 false, /* isTypedMethod. Only relevant for methods. */
27307 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27308};
27309
27310MOZ_CAN_RUN_SCRIPT static bool
27311passUnion27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27312{
27313 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion27");
27314 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27317( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27315 "TestJSImplInterface", "passUnion27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27317( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27316 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27317( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27317 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27317( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27318
27319 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27320 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27321 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27322 if (objIsXray) {
27323 unwrappedObj.emplace(cx, obj);
27324 }
27325 StringSequenceOrEventInit arg0;
27326 if (!(args.hasDefined(0))) {
27327 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (sequence<DOMString> or EventInit)")) {
27328 return false;
27329 }
27330 } else {
27331 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27332 return false;
27333 }
27334 }
27335 if (objIsXray) {
27336 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27337 // we know Xrays have no dynamic unwrap behavior.
27338 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27339 if (!unwrappedObj.ref()) {
27340 return false;
27341 }
27342 }
27343 FastErrorResult rv;
27344 // NOTE: This assert does NOT call the function.
27345 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");
27346 MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27347 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27"
)), 0))
) {
27348 return false;
27349 }
27350 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27350); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27350); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27351 args.rval().setUndefined();
27352 return true;
27353}
27354
27355static const JSJitInfo passUnion27_methodinfo = {
27356 { (JSJitGetterOp)passUnion27 },
27357 { prototypes::id::TestJSImplInterface },
27358 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27359 JSJitInfo::Method,
27360 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27361 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27362 false, /* isInfallible. False in setters. */
27363 false, /* isMovable. Not relevant for setters. */
27364 false, /* isEliminatable. Not relevant for setters. */
27365 false, /* isAlwaysInSlot. Only relevant for getters. */
27366 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27367 false, /* isTypedMethod. Only relevant for methods. */
27368 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27369};
27370
27371MOZ_CAN_RUN_SCRIPT static bool
27372passUnion28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27373{
27374 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion28");
27375 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27378( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27376 "TestJSImplInterface", "passUnion28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27378( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27377 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27378( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27378 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27378( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27379
27380 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27381 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27382 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27383 if (objIsXray) {
27384 unwrappedObj.emplace(cx, obj);
27385 }
27386 EventInitOrStringSequence arg0;
27387 if (!(args.hasDefined(0))) {
27388 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or sequence<DOMString>)")) {
27389 return false;
27390 }
27391 } else {
27392 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27393 return false;
27394 }
27395 }
27396 if (objIsXray) {
27397 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27398 // we know Xrays have no dynamic unwrap behavior.
27399 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27400 if (!unwrappedObj.ref()) {
27401 return false;
27402 }
27403 }
27404 FastErrorResult rv;
27405 // NOTE: This assert does NOT call the function.
27406 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");
27407 MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27408 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28"
)), 0))
) {
27409 return false;
27410 }
27411 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27411); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27411); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27412 args.rval().setUndefined();
27413 return true;
27414}
27415
27416static const JSJitInfo passUnion28_methodinfo = {
27417 { (JSJitGetterOp)passUnion28 },
27418 { prototypes::id::TestJSImplInterface },
27419 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27420 JSJitInfo::Method,
27421 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27422 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27423 false, /* isInfallible. False in setters. */
27424 false, /* isMovable. Not relevant for setters. */
27425 false, /* isEliminatable. Not relevant for setters. */
27426 false, /* isAlwaysInSlot. Only relevant for getters. */
27427 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27428 false, /* isTypedMethod. Only relevant for methods. */
27429 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27430};
27431
27432MOZ_CAN_RUN_SCRIPT static bool
27433passUnionWithCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27434{
27435 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithCallback");
27436 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27439( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27437 "TestJSImplInterface", "passUnionWithCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27439( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27438 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27439( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27439 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27439( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27440
27441 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27442 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithCallback", 1)) {
27443 return false;
27444 }
27445 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27446 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27447 if (objIsXray) {
27448 unwrappedObj.emplace(cx, obj);
27449 }
27450 EventHandlerNonNullOrNullOrLong arg0;
27451 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27452 return false;
27453 }
27454 if (objIsXray) {
27455 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27456 // we know Xrays have no dynamic unwrap behavior.
27457 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27458 if (!unwrappedObj.ref()) {
27459 return false;
27460 }
27461 }
27462 FastErrorResult rv;
27463 // NOTE: This assert does NOT call the function.
27464 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");
27465 MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27466 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback"
)), 0))
) {
27467 return false;
27468 }
27469 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27469); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27470 args.rval().setUndefined();
27471 return true;
27472}
27473
27474static const JSJitInfo passUnionWithCallback_methodinfo = {
27475 { (JSJitGetterOp)passUnionWithCallback },
27476 { prototypes::id::TestJSImplInterface },
27477 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27478 JSJitInfo::Method,
27479 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27480 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27481 false, /* isInfallible. False in setters. */
27482 false, /* isMovable. Not relevant for setters. */
27483 false, /* isEliminatable. Not relevant for setters. */
27484 false, /* isAlwaysInSlot. Only relevant for getters. */
27485 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27486 false, /* isTypedMethod. Only relevant for methods. */
27487 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27488};
27489
27490MOZ_CAN_RUN_SCRIPT static bool
27491passUnionWithByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27492{
27493 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithByteString");
27494 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27497( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27495 "TestJSImplInterface", "passUnionWithByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27497( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27496 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27497( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27497 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27497( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27498
27499 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27500 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithByteString", 1)) {
27501 return false;
27502 }
27503 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27504 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27505 if (objIsXray) {
27506 unwrappedObj.emplace(cx, obj);
27507 }
27508 ByteStringOrLong arg0;
27509 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27510 return false;
27511 }
27512 if (objIsXray) {
27513 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27514 // we know Xrays have no dynamic unwrap behavior.
27515 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27516 if (!unwrappedObj.ref()) {
27517 return false;
27518 }
27519 }
27520 FastErrorResult rv;
27521 // NOTE: This assert does NOT call the function.
27522 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");
27523 MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27524 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString"
)), 0))
) {
27525 return false;
27526 }
27527 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27527); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27527); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27528 args.rval().setUndefined();
27529 return true;
27530}
27531
27532static const JSJitInfo passUnionWithByteString_methodinfo = {
27533 { (JSJitGetterOp)passUnionWithByteString },
27534 { prototypes::id::TestJSImplInterface },
27535 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27536 JSJitInfo::Method,
27537 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27538 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27539 false, /* isInfallible. False in setters. */
27540 false, /* isMovable. Not relevant for setters. */
27541 false, /* isEliminatable. Not relevant for setters. */
27542 false, /* isAlwaysInSlot. Only relevant for getters. */
27543 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27544 false, /* isTypedMethod. Only relevant for methods. */
27545 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27546};
27547
27548MOZ_CAN_RUN_SCRIPT static bool
27549passUnionWithUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27550{
27551 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithUTF8String");
27552 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27555( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27553 "TestJSImplInterface", "passUnionWithUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27555( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27554 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27555( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27555 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27555( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27556
27557 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27558 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithUTF8String", 1)) {
27559 return false;
27560 }
27561 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27562 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27563 if (objIsXray) {
27564 unwrappedObj.emplace(cx, obj);
27565 }
27566 UTF8StringOrLong arg0;
27567 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27568 return false;
27569 }
27570 if (objIsXray) {
27571 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27572 // we know Xrays have no dynamic unwrap behavior.
27573 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27574 if (!unwrappedObj.ref()) {
27575 return false;
27576 }
27577 }
27578 FastErrorResult rv;
27579 // NOTE: This assert does NOT call the function.
27580 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");
27581 MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27582 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String"
)), 0))
) {
27583 return false;
27584 }
27585 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27585); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27585); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27586 args.rval().setUndefined();
27587 return true;
27588}
27589
27590static const JSJitInfo passUnionWithUTF8String_methodinfo = {
27591 { (JSJitGetterOp)passUnionWithUTF8String },
27592 { prototypes::id::TestJSImplInterface },
27593 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27594 JSJitInfo::Method,
27595 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27596 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27597 false, /* isInfallible. False in setters. */
27598 false, /* isMovable. Not relevant for setters. */
27599 false, /* isEliminatable. Not relevant for setters. */
27600 false, /* isAlwaysInSlot. Only relevant for getters. */
27601 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27602 false, /* isTypedMethod. Only relevant for methods. */
27603 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27604};
27605
27606MOZ_CAN_RUN_SCRIPT static bool
27607passUnionWithRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27608{
27609 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecord");
27610 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27613( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27611 "TestJSImplInterface", "passUnionWithRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27613( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27612 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27613( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27613 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27613( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27614
27615 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27616 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecord", 1)) {
27617 return false;
27618 }
27619 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27620 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27621 if (objIsXray) {
27622 unwrappedObj.emplace(cx, obj);
27623 }
27624 StringStringRecordOrString arg0;
27625 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27626 return false;
27627 }
27628 if (objIsXray) {
27629 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27630 // we know Xrays have no dynamic unwrap behavior.
27631 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27632 if (!unwrappedObj.ref()) {
27633 return false;
27634 }
27635 }
27636 FastErrorResult rv;
27637 // NOTE: This assert does NOT call the function.
27638 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");
27639 MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27640 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord"
)), 0))
) {
27641 return false;
27642 }
27643 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27643); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27643); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27644 args.rval().setUndefined();
27645 return true;
27646}
27647
27648static const JSJitInfo passUnionWithRecord_methodinfo = {
27649 { (JSJitGetterOp)passUnionWithRecord },
27650 { prototypes::id::TestJSImplInterface },
27651 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27652 JSJitInfo::Method,
27653 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27654 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27655 false, /* isInfallible. False in setters. */
27656 false, /* isMovable. Not relevant for setters. */
27657 false, /* isEliminatable. Not relevant for setters. */
27658 false, /* isAlwaysInSlot. Only relevant for getters. */
27659 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27660 false, /* isTypedMethod. Only relevant for methods. */
27661 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27662};
27663
27664MOZ_CAN_RUN_SCRIPT static bool
27665passUnionWithRecordAndSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27666{
27667 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecordAndSequence");
27668 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27671( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27669 "TestJSImplInterface", "passUnionWithRecordAndSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27671( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27670 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27671( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27671 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27671( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27672
27673 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27674 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecordAndSequence", 1)) {
27675 return false;
27676 }
27677 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27678 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27679 if (objIsXray) {
27680 unwrappedObj.emplace(cx, obj);
27681 }
27682 StringStringRecordOrStringSequence arg0;
27683 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27684 return false;
27685 }
27686 if (objIsXray) {
27687 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27688 // we know Xrays have no dynamic unwrap behavior.
27689 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27690 if (!unwrappedObj.ref()) {
27691 return false;
27692 }
27693 }
27694 FastErrorResult rv;
27695 // NOTE: This assert does NOT call the function.
27696 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");
27697 MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27698 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence"
)), 0))
) {
27699 return false;
27700 }
27701 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27701); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27701); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27702 args.rval().setUndefined();
27703 return true;
27704}
27705
27706static const JSJitInfo passUnionWithRecordAndSequence_methodinfo = {
27707 { (JSJitGetterOp)passUnionWithRecordAndSequence },
27708 { prototypes::id::TestJSImplInterface },
27709 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27710 JSJitInfo::Method,
27711 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27712 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27713 false, /* isInfallible. False in setters. */
27714 false, /* isMovable. Not relevant for setters. */
27715 false, /* isEliminatable. Not relevant for setters. */
27716 false, /* isAlwaysInSlot. Only relevant for getters. */
27717 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27718 false, /* isTypedMethod. Only relevant for methods. */
27719 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27720};
27721
27722MOZ_CAN_RUN_SCRIPT static bool
27723passUnionWithSequenceAndRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27724{
27725 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSequenceAndRecord");
27726 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27729( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27727 "TestJSImplInterface", "passUnionWithSequenceAndRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27729( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27728 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27729( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27729 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27729( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27730
27731 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27732 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord", 1)) {
27733 return false;
27734 }
27735 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27736 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27737 if (objIsXray) {
27738 unwrappedObj.emplace(cx, obj);
27739 }
27740 StringSequenceOrStringStringRecord arg0;
27741 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27742 return false;
27743 }
27744 if (objIsXray) {
27745 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27746 // we know Xrays have no dynamic unwrap behavior.
27747 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27748 if (!unwrappedObj.ref()) {
27749 return false;
27750 }
27751 }
27752 FastErrorResult rv;
27753 // NOTE: This assert does NOT call the function.
27754 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");
27755 MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27756 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord"
)), 0))
) {
27757 return false;
27758 }
27759 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27759); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27759); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27760 args.rval().setUndefined();
27761 return true;
27762}
27763
27764static const JSJitInfo passUnionWithSequenceAndRecord_methodinfo = {
27765 { (JSJitGetterOp)passUnionWithSequenceAndRecord },
27766 { prototypes::id::TestJSImplInterface },
27767 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27768 JSJitInfo::Method,
27769 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27770 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27771 false, /* isInfallible. False in setters. */
27772 false, /* isMovable. Not relevant for setters. */
27773 false, /* isEliminatable. Not relevant for setters. */
27774 false, /* isAlwaysInSlot. Only relevant for getters. */
27775 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27776 false, /* isTypedMethod. Only relevant for methods. */
27777 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27778};
27779
27780MOZ_CAN_RUN_SCRIPT static bool
27781passUnionWithSVS(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27782{
27783 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSVS");
27784 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27787( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27785 "TestJSImplInterface", "passUnionWithSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27787( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27786 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27787( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27787 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27787( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27788
27789 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27790 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSVS", 1)) {
27791 return false;
27792 }
27793 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27794 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27795 if (objIsXray) {
27796 unwrappedObj.emplace(cx, obj);
27797 }
27798 USVStringOrLong arg0;
27799 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27800 return false;
27801 }
27802 if (objIsXray) {
27803 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27804 // we know Xrays have no dynamic unwrap behavior.
27805 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27806 if (!unwrappedObj.ref()) {
27807 return false;
27808 }
27809 }
27810 FastErrorResult rv;
27811 // NOTE: This assert does NOT call the function.
27812 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");
27813 MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27814 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS"
)), 0))
) {
27815 return false;
27816 }
27817 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27817); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27817); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27818 args.rval().setUndefined();
27819 return true;
27820}
27821
27822static const JSJitInfo passUnionWithSVS_methodinfo = {
27823 { (JSJitGetterOp)passUnionWithSVS },
27824 { prototypes::id::TestJSImplInterface },
27825 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27826 JSJitInfo::Method,
27827 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27828 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27829 false, /* isInfallible. False in setters. */
27830 false, /* isMovable. Not relevant for setters. */
27831 false, /* isEliminatable. Not relevant for setters. */
27832 false, /* isAlwaysInSlot. Only relevant for getters. */
27833 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27834 false, /* isTypedMethod. Only relevant for methods. */
27835 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27836};
27837
27838MOZ_CAN_RUN_SCRIPT static bool
27839passUnionWithNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27840{
27841 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithNullable");
27842 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27845( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27843 "TestJSImplInterface", "passUnionWithNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27845( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27844 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27845( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27845 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27845( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27846
27847 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27848 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithNullable", 1)) {
27849 return false;
27850 }
27851 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27852 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27853 if (objIsXray) {
27854 unwrappedObj.emplace(cx, obj);
27855 }
27856 ObjectOrNullOrLong arg0;
27857 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27858 return false;
27859 }
27860 if (objIsXray) {
27861 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27862 // we know Xrays have no dynamic unwrap behavior.
27863 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27864 if (!unwrappedObj.ref()) {
27865 return false;
27866 }
27867 }
27868 FastErrorResult rv;
27869 // NOTE: This assert does NOT call the function.
27870 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");
27871 MOZ_KnownLive(self)(self)->PassUnionWithNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27872 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable"
)), 0))
) {
27873 return false;
27874 }
27875 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27875); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27875); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27876 args.rval().setUndefined();
27877 return true;
27878}
27879
27880static const JSJitInfo passUnionWithNullable_methodinfo = {
27881 { (JSJitGetterOp)passUnionWithNullable },
27882 { prototypes::id::TestJSImplInterface },
27883 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27884 JSJitInfo::Method,
27885 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27886 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27887 false, /* isInfallible. False in setters. */
27888 false, /* isMovable. Not relevant for setters. */
27889 false, /* isEliminatable. Not relevant for setters. */
27890 false, /* isAlwaysInSlot. Only relevant for getters. */
27891 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27892 false, /* isTypedMethod. Only relevant for methods. */
27893 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27894};
27895
27896MOZ_CAN_RUN_SCRIPT static bool
27897passNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27898{
27899 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnion");
27900 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27903( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27901 "TestJSImplInterface", "passNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27903( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27902 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27903( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27903 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27903( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27904
27905 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27906 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUnion", 1)) {
27907 return false;
27908 }
27909 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27910 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27911 if (objIsXray) {
27912 unwrappedObj.emplace(cx, obj);
27913 }
27914 Nullable<ObjectOrLong > arg0;
27915 if (args[0].isNullOrUndefined()) {
27916 arg0.SetNull();
27917 } else {
27918 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
27919 return false;
27920 }
27921 }
27922 if (objIsXray) {
27923 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27924 // we know Xrays have no dynamic unwrap behavior.
27925 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27926 if (!unwrappedObj.ref()) {
27927 return false;
27928 }
27929 }
27930 FastErrorResult rv;
27931 // NOTE: This assert does NOT call the function.
27932 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");
27933 MOZ_KnownLive(self)(self)->PassNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27934 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion"
)), 0))
) {
27935 return false;
27936 }
27937 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27937); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27937); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27938 args.rval().setUndefined();
27939 return true;
27940}
27941
27942static const JSJitInfo passNullableUnion_methodinfo = {
27943 { (JSJitGetterOp)passNullableUnion },
27944 { prototypes::id::TestJSImplInterface },
27945 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27946 JSJitInfo::Method,
27947 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27948 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27949 false, /* isInfallible. False in setters. */
27950 false, /* isMovable. Not relevant for setters. */
27951 false, /* isEliminatable. Not relevant for setters. */
27952 false, /* isAlwaysInSlot. Only relevant for getters. */
27953 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27954 false, /* isTypedMethod. Only relevant for methods. */
27955 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27956};
27957
27958MOZ_CAN_RUN_SCRIPT static bool
27959passOptionalUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27960{
27961 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnion");
27962 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27965( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27963 "TestJSImplInterface", "passOptionalUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27965( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27964 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27965( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27965 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27965( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27966
27967 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27968 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27969 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27970 if (objIsXray) {
27971 unwrappedObj.emplace(cx, obj);
27972 }
27973 Optional<ObjectOrLong> arg0;
27974 if (args.hasDefined(0)) {
27975 arg0.Construct();
27976 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
27977 return false;
27978 }
27979 }
27980 if (objIsXray) {
27981 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27982 // we know Xrays have no dynamic unwrap behavior.
27983 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27984 if (!unwrappedObj.ref()) {
27985 return false;
27986 }
27987 }
27988 FastErrorResult rv;
27989 // NOTE: This assert does NOT call the function.
27990 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");
27991 MOZ_KnownLive(self)(self)->PassOptionalUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27992 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion"
)), 0))
) {
27993 return false;
27994 }
27995 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 27995); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
27996 args.rval().setUndefined();
27997 return true;
27998}
27999
28000static const JSJitInfo passOptionalUnion_methodinfo = {
28001 { (JSJitGetterOp)passOptionalUnion },
28002 { prototypes::id::TestJSImplInterface },
28003 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28004 JSJitInfo::Method,
28005 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28006 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28007 false, /* isInfallible. False in setters. */
28008 false, /* isMovable. Not relevant for setters. */
28009 false, /* isEliminatable. Not relevant for setters. */
28010 false, /* isAlwaysInSlot. Only relevant for getters. */
28011 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28012 false, /* isTypedMethod. Only relevant for methods. */
28013 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28014};
28015
28016MOZ_CAN_RUN_SCRIPT static bool
28017passOptionalNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28018{
28019 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnion");
28020 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28023( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28021 "TestJSImplInterface", "passOptionalNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28023( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28022 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28023( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28023 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28023( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28024
28025 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28026 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28027 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28028 if (objIsXray) {
28029 unwrappedObj.emplace(cx, obj);
28030 }
28031 Optional<Nullable<ObjectOrLong >> arg0;
28032 if (args.hasDefined(0)) {
28033 arg0.Construct();
28034 if (args[0].isNullOrUndefined()) {
28035 arg0.Value().SetNull();
28036 } else {
28037 if (!arg0.Value().SetValue().Init(cx, args[0], "Argument 1", true)) {
28038 return false;
28039 }
28040 }
28041 }
28042 if (objIsXray) {
28043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28044 // we know Xrays have no dynamic unwrap behavior.
28045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28046 if (!unwrappedObj.ref()) {
28047 return false;
28048 }
28049 }
28050 FastErrorResult rv;
28051 // NOTE: This assert does NOT call the function.
28052 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");
28053 MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion"
)), 0))
) {
28055 return false;
28056 }
28057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28057); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28058 args.rval().setUndefined();
28059 return true;
28060}
28061
28062static const JSJitInfo passOptionalNullableUnion_methodinfo = {
28063 { (JSJitGetterOp)passOptionalNullableUnion },
28064 { prototypes::id::TestJSImplInterface },
28065 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28066 JSJitInfo::Method,
28067 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28068 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28069 false, /* isInfallible. False in setters. */
28070 false, /* isMovable. Not relevant for setters. */
28071 false, /* isEliminatable. Not relevant for setters. */
28072 false, /* isAlwaysInSlot. Only relevant for getters. */
28073 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28074 false, /* isTypedMethod. Only relevant for methods. */
28075 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28076};
28077
28078MOZ_CAN_RUN_SCRIPT static bool
28079passOptionalNullableUnionWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28080{
28081 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue");
28082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28085( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28083 "TestJSImplInterface", "passOptionalNullableUnionWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28085( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28085( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28085( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28086
28087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28088 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28089 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28090 if (objIsXray) {
28091 unwrappedObj.emplace(cx, obj);
28092 }
28093 Nullable<ObjectOrLong > arg0;
28094 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
28095 arg0.SetNull();
28096 } else {
28097 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
28098 return false;
28099 }
28100 }
28101 if (objIsXray) {
28102 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28103 // we know Xrays have no dynamic unwrap behavior.
28104 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28105 if (!unwrappedObj.ref()) {
28106 return false;
28107 }
28108 }
28109 FastErrorResult rv;
28110 // NOTE: This assert does NOT call the function.
28111 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");
28112 MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28113 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"
)), 0))
) {
28114 return false;
28115 }
28116 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28116); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28116); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28117 args.rval().setUndefined();
28118 return true;
28119}
28120
28121static const JSJitInfo passOptionalNullableUnionWithDefaultValue_methodinfo = {
28122 { (JSJitGetterOp)passOptionalNullableUnionWithDefaultValue },
28123 { prototypes::id::TestJSImplInterface },
28124 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28125 JSJitInfo::Method,
28126 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28127 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28128 false, /* isInfallible. False in setters. */
28129 false, /* isMovable. Not relevant for setters. */
28130 false, /* isEliminatable. Not relevant for setters. */
28131 false, /* isAlwaysInSlot. Only relevant for getters. */
28132 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28133 false, /* isTypedMethod. Only relevant for methods. */
28134 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28135};
28136
28137MOZ_CAN_RUN_SCRIPT static bool
28138passUnionWithArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28139{
28140 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBuffer");
28141 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28144( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28142 "TestJSImplInterface", "passUnionWithArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28144( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28143 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28144( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28144 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28144( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28145
28146 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28147 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBuffer", 1)) {
28148 return false;
28149 }
28150 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28151 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28152 if (objIsXray) {
28153 unwrappedObj.emplace(cx, obj);
28154 }
28155 UTF8StringOrArrayBuffer arg0;
28156 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28157 return false;
28158 }
28159 if (objIsXray) {
28160 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28161 // we know Xrays have no dynamic unwrap behavior.
28162 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28163 if (!unwrappedObj.ref()) {
28164 return false;
28165 }
28166 }
28167 FastErrorResult rv;
28168 // NOTE: This assert does NOT call the function.
28169 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");
28170 MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28171 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer"
)), 0))
) {
28172 return false;
28173 }
28174 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28174); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28174); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28175 args.rval().setUndefined();
28176 return true;
28177}
28178
28179static const JSJitInfo passUnionWithArrayBuffer_methodinfo = {
28180 { (JSJitGetterOp)passUnionWithArrayBuffer },
28181 { prototypes::id::TestJSImplInterface },
28182 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28183 JSJitInfo::Method,
28184 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28185 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28186 false, /* isInfallible. False in setters. */
28187 false, /* isMovable. Not relevant for setters. */
28188 false, /* isEliminatable. Not relevant for setters. */
28189 false, /* isAlwaysInSlot. Only relevant for getters. */
28190 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28191 false, /* isTypedMethod. Only relevant for methods. */
28192 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28193};
28194
28195MOZ_CAN_RUN_SCRIPT static bool
28196passUnionWithArrayBufferOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28197{
28198 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBufferOrNull");
28199 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28202( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28200 "TestJSImplInterface", "passUnionWithArrayBufferOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28202( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28201 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28202( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28202 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28202( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28203
28204 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28205 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull", 1)) {
28206 return false;
28207 }
28208 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28209 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28210 if (objIsXray) {
28211 unwrappedObj.emplace(cx, obj);
28212 }
28213 UTF8StringOrArrayBufferOrNull arg0;
28214 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28215 return false;
28216 }
28217 if (objIsXray) {
28218 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28219 // we know Xrays have no dynamic unwrap behavior.
28220 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28221 if (!unwrappedObj.ref()) {
28222 return false;
28223 }
28224 }
28225 FastErrorResult rv;
28226 // NOTE: This assert does NOT call the function.
28227 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");
28228 MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28229 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull"
)), 0))
) {
28230 return false;
28231 }
28232 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28232); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28232); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28233 args.rval().setUndefined();
28234 return true;
28235}
28236
28237static const JSJitInfo passUnionWithArrayBufferOrNull_methodinfo = {
28238 { (JSJitGetterOp)passUnionWithArrayBufferOrNull },
28239 { prototypes::id::TestJSImplInterface },
28240 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28241 JSJitInfo::Method,
28242 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28243 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28244 false, /* isInfallible. False in setters. */
28245 false, /* isMovable. Not relevant for setters. */
28246 false, /* isEliminatable. Not relevant for setters. */
28247 false, /* isAlwaysInSlot. Only relevant for getters. */
28248 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28249 false, /* isTypedMethod. Only relevant for methods. */
28250 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28251};
28252
28253MOZ_CAN_RUN_SCRIPT static bool
28254passUnionWithTypedArrays(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28255{
28256 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArrays");
28257 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28260( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28258 "TestJSImplInterface", "passUnionWithTypedArrays", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28260( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28259 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28260( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28260 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28260( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28261
28262 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28263 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArrays", 1)) {
28264 return false;
28265 }
28266 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28267 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28268 if (objIsXray) {
28269 unwrappedObj.emplace(cx, obj);
28270 }
28271 ArrayBufferViewOrArrayBuffer arg0;
28272 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28273 return false;
28274 }
28275 if (objIsXray) {
28276 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28277 // we know Xrays have no dynamic unwrap behavior.
28278 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28279 if (!unwrappedObj.ref()) {
28280 return false;
28281 }
28282 }
28283 FastErrorResult rv;
28284 // NOTE: This assert does NOT call the function.
28285 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");
28286 MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28287 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays"
)), 0))
) {
28288 return false;
28289 }
28290 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28290); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28290); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28291 args.rval().setUndefined();
28292 return true;
28293}
28294
28295static const JSJitInfo passUnionWithTypedArrays_methodinfo = {
28296 { (JSJitGetterOp)passUnionWithTypedArrays },
28297 { prototypes::id::TestJSImplInterface },
28298 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28299 JSJitInfo::Method,
28300 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28301 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28302 false, /* isInfallible. False in setters. */
28303 false, /* isMovable. Not relevant for setters. */
28304 false, /* isEliminatable. Not relevant for setters. */
28305 false, /* isAlwaysInSlot. Only relevant for getters. */
28306 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28307 false, /* isTypedMethod. Only relevant for methods. */
28308 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28309};
28310
28311MOZ_CAN_RUN_SCRIPT static bool
28312passUnionWithTypedArraysOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28313{
28314 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArraysOrNull");
28315 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28318( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28316 "TestJSImplInterface", "passUnionWithTypedArraysOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28318( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28317 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28318( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28318 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28318( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28319
28320 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28321 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull", 1)) {
28322 return false;
28323 }
28324 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28325 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28326 if (objIsXray) {
28327 unwrappedObj.emplace(cx, obj);
28328 }
28329 ArrayBufferViewOrArrayBufferOrNull arg0;
28330 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28331 return false;
28332 }
28333 if (objIsXray) {
28334 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28335 // we know Xrays have no dynamic unwrap behavior.
28336 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28337 if (!unwrappedObj.ref()) {
28338 return false;
28339 }
28340 }
28341 FastErrorResult rv;
28342 // NOTE: This assert does NOT call the function.
28343 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");
28344 MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28345 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull"
)), 0))
) {
28346 return false;
28347 }
28348 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28348); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28348); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28349 args.rval().setUndefined();
28350 return true;
28351}
28352
28353static const JSJitInfo passUnionWithTypedArraysOrNull_methodinfo = {
28354 { (JSJitGetterOp)passUnionWithTypedArraysOrNull },
28355 { prototypes::id::TestJSImplInterface },
28356 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28357 JSJitInfo::Method,
28358 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28359 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28360 false, /* isInfallible. False in setters. */
28361 false, /* isMovable. Not relevant for setters. */
28362 false, /* isEliminatable. Not relevant for setters. */
28363 false, /* isAlwaysInSlot. Only relevant for getters. */
28364 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28365 false, /* isTypedMethod. Only relevant for methods. */
28366 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28367};
28368
28369MOZ_CAN_RUN_SCRIPT static bool
28370passUnionWithString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28371{
28372 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithString");
28373 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28376( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28374 "TestJSImplInterface", "passUnionWithString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28376( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28375 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28376( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28376 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28376( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28377
28378 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28379 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithString", 1)) {
28380 return false;
28381 }
28382 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28383 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28384 if (objIsXray) {
28385 unwrappedObj.emplace(cx, obj);
28386 }
28387 StringOrObject arg0;
28388 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28389 return false;
28390 }
28391 if (objIsXray) {
28392 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28393 // we know Xrays have no dynamic unwrap behavior.
28394 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28395 if (!unwrappedObj.ref()) {
28396 return false;
28397 }
28398 }
28399 FastErrorResult rv;
28400 // NOTE: This assert does NOT call the function.
28401 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");
28402 MOZ_KnownLive(self)(self)->PassUnionWithString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28403 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString"
)), 0))
) {
28404 return false;
28405 }
28406 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28406); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28406); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28407 args.rval().setUndefined();
28408 return true;
28409}
28410
28411static const JSJitInfo passUnionWithString_methodinfo = {
28412 { (JSJitGetterOp)passUnionWithString },
28413 { prototypes::id::TestJSImplInterface },
28414 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28415 JSJitInfo::Method,
28416 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28417 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28418 false, /* isInfallible. False in setters. */
28419 false, /* isMovable. Not relevant for setters. */
28420 false, /* isEliminatable. Not relevant for setters. */
28421 false, /* isAlwaysInSlot. Only relevant for getters. */
28422 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28423 false, /* isTypedMethod. Only relevant for methods. */
28424 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28425};
28426
28427MOZ_CAN_RUN_SCRIPT static bool
28428passUnionWithEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28429{
28430 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithEnum");
28431 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28434( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28432 "TestJSImplInterface", "passUnionWithEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28434( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28433 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28434( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28434 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28434( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28435
28436 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28437 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithEnum", 1)) {
28438 return false;
28439 }
28440 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28441 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28442 if (objIsXray) {
28443 unwrappedObj.emplace(cx, obj);
28444 }
28445 SupportedTypeOrObject arg0;
28446 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28447 return false;
28448 }
28449 if (objIsXray) {
28450 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28451 // we know Xrays have no dynamic unwrap behavior.
28452 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28453 if (!unwrappedObj.ref()) {
28454 return false;
28455 }
28456 }
28457 FastErrorResult rv;
28458 // NOTE: This assert does NOT call the function.
28459 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");
28460 MOZ_KnownLive(self)(self)->PassUnionWithEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28461 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum"
)), 0))
) {
28462 return false;
28463 }
28464 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28464); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28464); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28465 args.rval().setUndefined();
28466 return true;
28467}
28468
28469static const JSJitInfo passUnionWithEnum_methodinfo = {
28470 { (JSJitGetterOp)passUnionWithEnum },
28471 { prototypes::id::TestJSImplInterface },
28472 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28473 JSJitInfo::Method,
28474 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28475 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28476 false, /* isInfallible. False in setters. */
28477 false, /* isMovable. Not relevant for setters. */
28478 false, /* isEliminatable. Not relevant for setters. */
28479 false, /* isAlwaysInSlot. Only relevant for getters. */
28480 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28481 false, /* isTypedMethod. Only relevant for methods. */
28482 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28483};
28484
28485MOZ_CAN_RUN_SCRIPT static bool
28486passUnionWithObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28487{
28488 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithObject");
28489 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28492( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28490 "TestJSImplInterface", "passUnionWithObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28492( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28491 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28492( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28492 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28492( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28493
28494 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28495 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithObject", 1)) {
28496 return false;
28497 }
28498 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28499 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28500 if (objIsXray) {
28501 unwrappedObj.emplace(cx, obj);
28502 }
28503 ObjectOrLong arg0;
28504 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28505 return false;
28506 }
28507 if (objIsXray) {
28508 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28509 // we know Xrays have no dynamic unwrap behavior.
28510 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28511 if (!unwrappedObj.ref()) {
28512 return false;
28513 }
28514 }
28515 FastErrorResult rv;
28516 // NOTE: This assert does NOT call the function.
28517 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");
28518 MOZ_KnownLive(self)(self)->PassUnionWithObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28519 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject"
)), 0))
) {
28520 return false;
28521 }
28522 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28522); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28522); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28523 args.rval().setUndefined();
28524 return true;
28525}
28526
28527static const JSJitInfo passUnionWithObject_methodinfo = {
28528 { (JSJitGetterOp)passUnionWithObject },
28529 { prototypes::id::TestJSImplInterface },
28530 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28531 JSJitInfo::Method,
28532 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28533 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28534 false, /* isInfallible. False in setters. */
28535 false, /* isMovable. Not relevant for setters. */
28536 false, /* isEliminatable. Not relevant for setters. */
28537 false, /* isAlwaysInSlot. Only relevant for getters. */
28538 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28539 false, /* isTypedMethod. Only relevant for methods. */
28540 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28541};
28542
28543MOZ_CAN_RUN_SCRIPT static bool
28544passUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28545{
28546 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue1");
28547 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28550( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28548 "TestJSImplInterface", "passUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28550( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28549 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28550( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28550 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28550( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28551
28552 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28553 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28554 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28555 if (objIsXray) {
28556 unwrappedObj.emplace(cx, obj);
28557 }
28558 DoubleOrString arg0;
28559 if (!(args.hasDefined(0))) {
28560 arg0.SetStringLiteral(u"");
28561 } else {
28562 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28563 return false;
28564 }
28565 }
28566 if (objIsXray) {
28567 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28568 // we know Xrays have no dynamic unwrap behavior.
28569 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28570 if (!unwrappedObj.ref()) {
28571 return false;
28572 }
28573 }
28574 FastErrorResult rv;
28575 // NOTE: This assert does NOT call the function.
28576 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");
28577 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28578 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1"
)), 0))
) {
28579 return false;
28580 }
28581 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28581); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28581); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28582 args.rval().setUndefined();
28583 return true;
28584}
28585
28586static const JSJitInfo passUnionWithDefaultValue1_methodinfo = {
28587 { (JSJitGetterOp)passUnionWithDefaultValue1 },
28588 { prototypes::id::TestJSImplInterface },
28589 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28590 JSJitInfo::Method,
28591 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28592 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28593 false, /* isInfallible. False in setters. */
28594 false, /* isMovable. Not relevant for setters. */
28595 false, /* isEliminatable. Not relevant for setters. */
28596 false, /* isAlwaysInSlot. Only relevant for getters. */
28597 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28598 false, /* isTypedMethod. Only relevant for methods. */
28599 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28600};
28601
28602MOZ_CAN_RUN_SCRIPT static bool
28603passUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28604{
28605 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue2");
28606 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28609( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28607 "TestJSImplInterface", "passUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28609( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28608 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28609( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28609 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28609( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28610
28611 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28612 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28613 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28614 if (objIsXray) {
28615 unwrappedObj.emplace(cx, obj);
28616 }
28617 DoubleOrString arg0;
28618 if (!(args.hasDefined(0))) {
28619 arg0.RawSetAsDouble() = 1.0;
28620 } else {
28621 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28622 return false;
28623 }
28624 }
28625 if (objIsXray) {
28626 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28627 // we know Xrays have no dynamic unwrap behavior.
28628 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28629 if (!unwrappedObj.ref()) {
28630 return false;
28631 }
28632 }
28633 FastErrorResult rv;
28634 // NOTE: This assert does NOT call the function.
28635 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");
28636 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28637 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2"
)), 0))
) {
28638 return false;
28639 }
28640 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28640); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28640); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28641 args.rval().setUndefined();
28642 return true;
28643}
28644
28645static const JSJitInfo passUnionWithDefaultValue2_methodinfo = {
28646 { (JSJitGetterOp)passUnionWithDefaultValue2 },
28647 { prototypes::id::TestJSImplInterface },
28648 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28649 JSJitInfo::Method,
28650 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28651 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28652 false, /* isInfallible. False in setters. */
28653 false, /* isMovable. Not relevant for setters. */
28654 false, /* isEliminatable. Not relevant for setters. */
28655 false, /* isAlwaysInSlot. Only relevant for getters. */
28656 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28657 false, /* isTypedMethod. Only relevant for methods. */
28658 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28659};
28660
28661MOZ_CAN_RUN_SCRIPT static bool
28662passUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28663{
28664 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue3");
28665 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28668( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28666 "TestJSImplInterface", "passUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28668( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28667 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28668( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28668 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28668( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28669
28670 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28671 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28672 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28673 if (objIsXray) {
28674 unwrappedObj.emplace(cx, obj);
28675 }
28676 DoubleOrString arg0;
28677 if (!(args.hasDefined(0))) {
28678 arg0.RawSetAsDouble() = 1.5;
28679 } else {
28680 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28681 return false;
28682 }
28683 }
28684 if (objIsXray) {
28685 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28686 // we know Xrays have no dynamic unwrap behavior.
28687 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28688 if (!unwrappedObj.ref()) {
28689 return false;
28690 }
28691 }
28692 FastErrorResult rv;
28693 // NOTE: This assert does NOT call the function.
28694 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");
28695 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28696 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3"
)), 0))
) {
28697 return false;
28698 }
28699 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28699); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28699); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28700 args.rval().setUndefined();
28701 return true;
28702}
28703
28704static const JSJitInfo passUnionWithDefaultValue3_methodinfo = {
28705 { (JSJitGetterOp)passUnionWithDefaultValue3 },
28706 { prototypes::id::TestJSImplInterface },
28707 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28708 JSJitInfo::Method,
28709 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28710 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28711 false, /* isInfallible. False in setters. */
28712 false, /* isMovable. Not relevant for setters. */
28713 false, /* isEliminatable. Not relevant for setters. */
28714 false, /* isAlwaysInSlot. Only relevant for getters. */
28715 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28716 false, /* isTypedMethod. Only relevant for methods. */
28717 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28718};
28719
28720MOZ_CAN_RUN_SCRIPT static bool
28721passUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28722{
28723 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue4");
28724 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28727( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28725 "TestJSImplInterface", "passUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28727( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28726 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28727( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28727 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28727( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28728
28729 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28730 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28731 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28732 if (objIsXray) {
28733 unwrappedObj.emplace(cx, obj);
28734 }
28735 FloatOrString arg0;
28736 if (!(args.hasDefined(0))) {
28737 arg0.SetStringLiteral(u"");
28738 } else {
28739 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28740 return false;
28741 }
28742 }
28743 if (objIsXray) {
28744 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28745 // we know Xrays have no dynamic unwrap behavior.
28746 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28747 if (!unwrappedObj.ref()) {
28748 return false;
28749 }
28750 }
28751 FastErrorResult rv;
28752 // NOTE: This assert does NOT call the function.
28753 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");
28754 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28755 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4"
)), 0))
) {
28756 return false;
28757 }
28758 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28758); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28758); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28759 args.rval().setUndefined();
28760 return true;
28761}
28762
28763static const JSJitInfo passUnionWithDefaultValue4_methodinfo = {
28764 { (JSJitGetterOp)passUnionWithDefaultValue4 },
28765 { prototypes::id::TestJSImplInterface },
28766 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28767 JSJitInfo::Method,
28768 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28769 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28770 false, /* isInfallible. False in setters. */
28771 false, /* isMovable. Not relevant for setters. */
28772 false, /* isEliminatable. Not relevant for setters. */
28773 false, /* isAlwaysInSlot. Only relevant for getters. */
28774 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28775 false, /* isTypedMethod. Only relevant for methods. */
28776 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28777};
28778
28779MOZ_CAN_RUN_SCRIPT static bool
28780passUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28781{
28782 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue5");
28783 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28786( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28784 "TestJSImplInterface", "passUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28786( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28785 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28786( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28786 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28786( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28787
28788 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28789 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28790 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28791 if (objIsXray) {
28792 unwrappedObj.emplace(cx, obj);
28793 }
28794 FloatOrString arg0;
28795 if (!(args.hasDefined(0))) {
28796 arg0.RawSetAsFloat() = 1.0F;
28797 } else {
28798 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28799 return false;
28800 }
28801 }
28802 if (objIsXray) {
28803 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28804 // we know Xrays have no dynamic unwrap behavior.
28805 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28806 if (!unwrappedObj.ref()) {
28807 return false;
28808 }
28809 }
28810 FastErrorResult rv;
28811 // NOTE: This assert does NOT call the function.
28812 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");
28813 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28814 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5"
)), 0))
) {
28815 return false;
28816 }
28817 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28817); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28817); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28818 args.rval().setUndefined();
28819 return true;
28820}
28821
28822static const JSJitInfo passUnionWithDefaultValue5_methodinfo = {
28823 { (JSJitGetterOp)passUnionWithDefaultValue5 },
28824 { prototypes::id::TestJSImplInterface },
28825 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28826 JSJitInfo::Method,
28827 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28828 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28829 false, /* isInfallible. False in setters. */
28830 false, /* isMovable. Not relevant for setters. */
28831 false, /* isEliminatable. Not relevant for setters. */
28832 false, /* isAlwaysInSlot. Only relevant for getters. */
28833 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28834 false, /* isTypedMethod. Only relevant for methods. */
28835 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28836};
28837
28838MOZ_CAN_RUN_SCRIPT static bool
28839passUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28840{
28841 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue6");
28842 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28845( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28843 "TestJSImplInterface", "passUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28845( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28844 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28845( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28845 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28845( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28846
28847 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28848 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28849 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28850 if (objIsXray) {
28851 unwrappedObj.emplace(cx, obj);
28852 }
28853 FloatOrString arg0;
28854 if (!(args.hasDefined(0))) {
28855 arg0.RawSetAsFloat() = 1.5F;
28856 } else {
28857 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28858 return false;
28859 }
28860 }
28861 if (objIsXray) {
28862 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28863 // we know Xrays have no dynamic unwrap behavior.
28864 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28865 if (!unwrappedObj.ref()) {
28866 return false;
28867 }
28868 }
28869 FastErrorResult rv;
28870 // NOTE: This assert does NOT call the function.
28871 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");
28872 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28873 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6"
)), 0))
) {
28874 return false;
28875 }
28876 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28876); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28876); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28877 args.rval().setUndefined();
28878 return true;
28879}
28880
28881static const JSJitInfo passUnionWithDefaultValue6_methodinfo = {
28882 { (JSJitGetterOp)passUnionWithDefaultValue6 },
28883 { prototypes::id::TestJSImplInterface },
28884 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28885 JSJitInfo::Method,
28886 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28887 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28888 false, /* isInfallible. False in setters. */
28889 false, /* isMovable. Not relevant for setters. */
28890 false, /* isEliminatable. Not relevant for setters. */
28891 false, /* isAlwaysInSlot. Only relevant for getters. */
28892 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28893 false, /* isTypedMethod. Only relevant for methods. */
28894 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28895};
28896
28897MOZ_CAN_RUN_SCRIPT static bool
28898passUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28899{
28900 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue7");
28901 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28904( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28902 "TestJSImplInterface", "passUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28904( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28903 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28904( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28904 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28904( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28905
28906 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28907 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28908 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28909 if (objIsXray) {
28910 unwrappedObj.emplace(cx, obj);
28911 }
28912 UnrestrictedDoubleOrString arg0;
28913 if (!(args.hasDefined(0))) {
28914 arg0.SetStringLiteral(u"");
28915 } else {
28916 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28917 return false;
28918 }
28919 }
28920 if (objIsXray) {
28921 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28922 // we know Xrays have no dynamic unwrap behavior.
28923 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28924 if (!unwrappedObj.ref()) {
28925 return false;
28926 }
28927 }
28928 FastErrorResult rv;
28929 // NOTE: This assert does NOT call the function.
28930 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");
28931 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28932 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7"
)), 0))
) {
28933 return false;
28934 }
28935 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28935); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28935); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28936 args.rval().setUndefined();
28937 return true;
28938}
28939
28940static const JSJitInfo passUnionWithDefaultValue7_methodinfo = {
28941 { (JSJitGetterOp)passUnionWithDefaultValue7 },
28942 { prototypes::id::TestJSImplInterface },
28943 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28944 JSJitInfo::Method,
28945 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28946 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28947 false, /* isInfallible. False in setters. */
28948 false, /* isMovable. Not relevant for setters. */
28949 false, /* isEliminatable. Not relevant for setters. */
28950 false, /* isAlwaysInSlot. Only relevant for getters. */
28951 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28952 false, /* isTypedMethod. Only relevant for methods. */
28953 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28954};
28955
28956MOZ_CAN_RUN_SCRIPT static bool
28957passUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28958{
28959 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue8");
28960 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28963( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28961 "TestJSImplInterface", "passUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28963( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28962 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28963( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28963 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28963( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28964
28965 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28966 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28967 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28968 if (objIsXray) {
28969 unwrappedObj.emplace(cx, obj);
28970 }
28971 UnrestrictedDoubleOrString arg0;
28972 if (!(args.hasDefined(0))) {
28973 arg0.RawSetAsUnrestrictedDouble() = 1.0;
28974 } else {
28975 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28976 return false;
28977 }
28978 }
28979 if (objIsXray) {
28980 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28981 // we know Xrays have no dynamic unwrap behavior.
28982 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28983 if (!unwrappedObj.ref()) {
28984 return false;
28985 }
28986 }
28987 FastErrorResult rv;
28988 // NOTE: This assert does NOT call the function.
28989 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");
28990 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28991 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8"
)), 0))
) {
28992 return false;
28993 }
28994 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28994); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 28994); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
28995 args.rval().setUndefined();
28996 return true;
28997}
28998
28999static const JSJitInfo passUnionWithDefaultValue8_methodinfo = {
29000 { (JSJitGetterOp)passUnionWithDefaultValue8 },
29001 { prototypes::id::TestJSImplInterface },
29002 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29003 JSJitInfo::Method,
29004 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29005 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29006 false, /* isInfallible. False in setters. */
29007 false, /* isMovable. Not relevant for setters. */
29008 false, /* isEliminatable. Not relevant for setters. */
29009 false, /* isAlwaysInSlot. Only relevant for getters. */
29010 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29011 false, /* isTypedMethod. Only relevant for methods. */
29012 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29013};
29014
29015MOZ_CAN_RUN_SCRIPT static bool
29016passUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29017{
29018 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue9");
29019 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29022( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29020 "TestJSImplInterface", "passUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29022( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29021 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29022( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29022 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29022( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29023
29024 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29025 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29026 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29027 if (objIsXray) {
29028 unwrappedObj.emplace(cx, obj);
29029 }
29030 UnrestrictedDoubleOrString arg0;
29031 if (!(args.hasDefined(0))) {
29032 arg0.RawSetAsUnrestrictedDouble() = 1.5;
29033 } else {
29034 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29035 return false;
29036 }
29037 }
29038 if (objIsXray) {
29039 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29040 // we know Xrays have no dynamic unwrap behavior.
29041 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29042 if (!unwrappedObj.ref()) {
29043 return false;
29044 }
29045 }
29046 FastErrorResult rv;
29047 // NOTE: This assert does NOT call the function.
29048 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");
29049 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29050 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9"
)), 0))
) {
29051 return false;
29052 }
29053 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29053); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29053); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29054 args.rval().setUndefined();
29055 return true;
29056}
29057
29058static const JSJitInfo passUnionWithDefaultValue9_methodinfo = {
29059 { (JSJitGetterOp)passUnionWithDefaultValue9 },
29060 { prototypes::id::TestJSImplInterface },
29061 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29062 JSJitInfo::Method,
29063 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29064 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29065 false, /* isInfallible. False in setters. */
29066 false, /* isMovable. Not relevant for setters. */
29067 false, /* isEliminatable. Not relevant for setters. */
29068 false, /* isAlwaysInSlot. Only relevant for getters. */
29069 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29070 false, /* isTypedMethod. Only relevant for methods. */
29071 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29072};
29073
29074MOZ_CAN_RUN_SCRIPT static bool
29075passUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29076{
29077 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue10");
29078 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29081( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29079 "TestJSImplInterface", "passUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29081( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29080 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29081( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29081 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29081( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29082
29083 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29084 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29085 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29086 if (objIsXray) {
29087 unwrappedObj.emplace(cx, obj);
29088 }
29089 UnrestrictedDoubleOrString arg0;
29090 if (!(args.hasDefined(0))) {
29091 arg0.RawSetAsUnrestrictedDouble() = mozilla::PositiveInfinity<double>();
29092 } else {
29093 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29094 return false;
29095 }
29096 }
29097 if (objIsXray) {
29098 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29099 // we know Xrays have no dynamic unwrap behavior.
29100 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29101 if (!unwrappedObj.ref()) {
29102 return false;
29103 }
29104 }
29105 FastErrorResult rv;
29106 // NOTE: This assert does NOT call the function.
29107 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");
29108 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29109 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10"
)), 0))
) {
29110 return false;
29111 }
29112 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29112); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29112); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29113 args.rval().setUndefined();
29114 return true;
29115}
29116
29117static const JSJitInfo passUnionWithDefaultValue10_methodinfo = {
29118 { (JSJitGetterOp)passUnionWithDefaultValue10 },
29119 { prototypes::id::TestJSImplInterface },
29120 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29121 JSJitInfo::Method,
29122 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29123 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29124 false, /* isInfallible. False in setters. */
29125 false, /* isMovable. Not relevant for setters. */
29126 false, /* isEliminatable. Not relevant for setters. */
29127 false, /* isAlwaysInSlot. Only relevant for getters. */
29128 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29129 false, /* isTypedMethod. Only relevant for methods. */
29130 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29131};
29132
29133MOZ_CAN_RUN_SCRIPT static bool
29134passUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29135{
29136 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue11");
29137 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29140( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29138 "TestJSImplInterface", "passUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29140( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29139 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29140( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29140 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29140( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29141
29142 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29143 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29144 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29145 if (objIsXray) {
29146 unwrappedObj.emplace(cx, obj);
29147 }
29148 UnrestrictedFloatOrString arg0;
29149 if (!(args.hasDefined(0))) {
29150 arg0.SetStringLiteral(u"");
29151 } else {
29152 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29153 return false;
29154 }
29155 }
29156 if (objIsXray) {
29157 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29158 // we know Xrays have no dynamic unwrap behavior.
29159 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29160 if (!unwrappedObj.ref()) {
29161 return false;
29162 }
29163 }
29164 FastErrorResult rv;
29165 // NOTE: This assert does NOT call the function.
29166 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");
29167 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29168 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11"
)), 0))
) {
29169 return false;
29170 }
29171 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29171); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29172 args.rval().setUndefined();
29173 return true;
29174}
29175
29176static const JSJitInfo passUnionWithDefaultValue11_methodinfo = {
29177 { (JSJitGetterOp)passUnionWithDefaultValue11 },
29178 { prototypes::id::TestJSImplInterface },
29179 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29180 JSJitInfo::Method,
29181 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29182 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29183 false, /* isInfallible. False in setters. */
29184 false, /* isMovable. Not relevant for setters. */
29185 false, /* isEliminatable. Not relevant for setters. */
29186 false, /* isAlwaysInSlot. Only relevant for getters. */
29187 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29188 false, /* isTypedMethod. Only relevant for methods. */
29189 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29190};
29191
29192MOZ_CAN_RUN_SCRIPT static bool
29193passUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29194{
29195 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue12");
29196 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29199( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29197 "TestJSImplInterface", "passUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29199( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29198 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29199( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29199 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29199( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29200
29201 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29202 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29203 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29204 if (objIsXray) {
29205 unwrappedObj.emplace(cx, obj);
29206 }
29207 UnrestrictedFloatOrString arg0;
29208 if (!(args.hasDefined(0))) {
29209 arg0.RawSetAsUnrestrictedFloat() = 1.0F;
29210 } else {
29211 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29212 return false;
29213 }
29214 }
29215 if (objIsXray) {
29216 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29217 // we know Xrays have no dynamic unwrap behavior.
29218 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29219 if (!unwrappedObj.ref()) {
29220 return false;
29221 }
29222 }
29223 FastErrorResult rv;
29224 // NOTE: This assert does NOT call the function.
29225 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");
29226 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29227 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12"
)), 0))
) {
29228 return false;
29229 }
29230 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29230); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29230); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29231 args.rval().setUndefined();
29232 return true;
29233}
29234
29235static const JSJitInfo passUnionWithDefaultValue12_methodinfo = {
29236 { (JSJitGetterOp)passUnionWithDefaultValue12 },
29237 { prototypes::id::TestJSImplInterface },
29238 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29239 JSJitInfo::Method,
29240 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29241 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29242 false, /* isInfallible. False in setters. */
29243 false, /* isMovable. Not relevant for setters. */
29244 false, /* isEliminatable. Not relevant for setters. */
29245 false, /* isAlwaysInSlot. Only relevant for getters. */
29246 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29247 false, /* isTypedMethod. Only relevant for methods. */
29248 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29249};
29250
29251MOZ_CAN_RUN_SCRIPT static bool
29252passUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29253{
29254 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue13");
29255 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29258( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29256 "TestJSImplInterface", "passUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29258( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29257 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29258( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29258 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29258( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29259
29260 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29261 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29262 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29263 if (objIsXray) {
29264 unwrappedObj.emplace(cx, obj);
29265 }
29266 UnrestrictedFloatOrString arg0;
29267 if (!(args.hasDefined(0))) {
29268 arg0.RawSetAsUnrestrictedFloat() = mozilla::PositiveInfinity<float>();
29269 } else {
29270 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29271 return false;
29272 }
29273 }
29274 if (objIsXray) {
29275 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29276 // we know Xrays have no dynamic unwrap behavior.
29277 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29278 if (!unwrappedObj.ref()) {
29279 return false;
29280 }
29281 }
29282 FastErrorResult rv;
29283 // NOTE: This assert does NOT call the function.
29284 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");
29285 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29286 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13"
)), 0))
) {
29287 return false;
29288 }
29289 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29289); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29289); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29290 args.rval().setUndefined();
29291 return true;
29292}
29293
29294static const JSJitInfo passUnionWithDefaultValue13_methodinfo = {
29295 { (JSJitGetterOp)passUnionWithDefaultValue13 },
29296 { prototypes::id::TestJSImplInterface },
29297 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29298 JSJitInfo::Method,
29299 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29300 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29301 false, /* isInfallible. False in setters. */
29302 false, /* isMovable. Not relevant for setters. */
29303 false, /* isEliminatable. Not relevant for setters. */
29304 false, /* isAlwaysInSlot. Only relevant for getters. */
29305 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29306 false, /* isTypedMethod. Only relevant for methods. */
29307 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29308};
29309
29310MOZ_CAN_RUN_SCRIPT static bool
29311passUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29312{
29313 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue14");
29314 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29317( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29315 "TestJSImplInterface", "passUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29317( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29316 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29317( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29317 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29317( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29318
29319 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29320 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29321 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29322 if (objIsXray) {
29323 unwrappedObj.emplace(cx, obj);
29324 }
29325 DoubleOrByteString arg0;
29326 if (!(args.hasDefined(0))) {
29327 arg0.SetStringLiteral("");
29328 } else {
29329 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29330 return false;
29331 }
29332 }
29333 if (objIsXray) {
29334 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29335 // we know Xrays have no dynamic unwrap behavior.
29336 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29337 if (!unwrappedObj.ref()) {
29338 return false;
29339 }
29340 }
29341 FastErrorResult rv;
29342 // NOTE: This assert does NOT call the function.
29343 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");
29344 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29345 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14"
)), 0))
) {
29346 return false;
29347 }
29348 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29348); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29348); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29349 args.rval().setUndefined();
29350 return true;
29351}
29352
29353static const JSJitInfo passUnionWithDefaultValue14_methodinfo = {
29354 { (JSJitGetterOp)passUnionWithDefaultValue14 },
29355 { prototypes::id::TestJSImplInterface },
29356 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29357 JSJitInfo::Method,
29358 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29359 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29360 false, /* isInfallible. False in setters. */
29361 false, /* isMovable. Not relevant for setters. */
29362 false, /* isEliminatable. Not relevant for setters. */
29363 false, /* isAlwaysInSlot. Only relevant for getters. */
29364 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29365 false, /* isTypedMethod. Only relevant for methods. */
29366 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29367};
29368
29369MOZ_CAN_RUN_SCRIPT static bool
29370passUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29371{
29372 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue15");
29373 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29376( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29374 "TestJSImplInterface", "passUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29376( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29375 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29376( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29376 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29376( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29377
29378 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29379 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29380 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29381 if (objIsXray) {
29382 unwrappedObj.emplace(cx, obj);
29383 }
29384 DoubleOrByteString arg0;
29385 if (!(args.hasDefined(0))) {
29386 arg0.RawSetAsDouble() = 1.0;
29387 } else {
29388 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29389 return false;
29390 }
29391 }
29392 if (objIsXray) {
29393 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29394 // we know Xrays have no dynamic unwrap behavior.
29395 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29396 if (!unwrappedObj.ref()) {
29397 return false;
29398 }
29399 }
29400 FastErrorResult rv;
29401 // NOTE: This assert does NOT call the function.
29402 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");
29403 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29404 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15"
)), 0))
) {
29405 return false;
29406 }
29407 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29407); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29407); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29408 args.rval().setUndefined();
29409 return true;
29410}
29411
29412static const JSJitInfo passUnionWithDefaultValue15_methodinfo = {
29413 { (JSJitGetterOp)passUnionWithDefaultValue15 },
29414 { prototypes::id::TestJSImplInterface },
29415 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29416 JSJitInfo::Method,
29417 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29418 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29419 false, /* isInfallible. False in setters. */
29420 false, /* isMovable. Not relevant for setters. */
29421 false, /* isEliminatable. Not relevant for setters. */
29422 false, /* isAlwaysInSlot. Only relevant for getters. */
29423 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29424 false, /* isTypedMethod. Only relevant for methods. */
29425 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29426};
29427
29428MOZ_CAN_RUN_SCRIPT static bool
29429passUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29430{
29431 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue16");
29432 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29435( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29433 "TestJSImplInterface", "passUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29435( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29434 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29435( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29435 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29435( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29436
29437 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29438 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29439 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29440 if (objIsXray) {
29441 unwrappedObj.emplace(cx, obj);
29442 }
29443 DoubleOrByteString arg0;
29444 if (!(args.hasDefined(0))) {
29445 arg0.RawSetAsDouble() = 1.5;
29446 } else {
29447 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29448 return false;
29449 }
29450 }
29451 if (objIsXray) {
29452 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29453 // we know Xrays have no dynamic unwrap behavior.
29454 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29455 if (!unwrappedObj.ref()) {
29456 return false;
29457 }
29458 }
29459 FastErrorResult rv;
29460 // NOTE: This assert does NOT call the function.
29461 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");
29462 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29463 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16"
)), 0))
) {
29464 return false;
29465 }
29466 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29466); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29466); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29467 args.rval().setUndefined();
29468 return true;
29469}
29470
29471static const JSJitInfo passUnionWithDefaultValue16_methodinfo = {
29472 { (JSJitGetterOp)passUnionWithDefaultValue16 },
29473 { prototypes::id::TestJSImplInterface },
29474 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29475 JSJitInfo::Method,
29476 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29477 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29478 false, /* isInfallible. False in setters. */
29479 false, /* isMovable. Not relevant for setters. */
29480 false, /* isEliminatable. Not relevant for setters. */
29481 false, /* isAlwaysInSlot. Only relevant for getters. */
29482 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29483 false, /* isTypedMethod. Only relevant for methods. */
29484 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29485};
29486
29487MOZ_CAN_RUN_SCRIPT static bool
29488passUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29489{
29490 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue17");
29491 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29494( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29492 "TestJSImplInterface", "passUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29494( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29493 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29494( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29494 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29494( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29495
29496 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29497 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29498 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29499 if (objIsXray) {
29500 unwrappedObj.emplace(cx, obj);
29501 }
29502 DoubleOrSupportedType arg0;
29503 if (!(args.hasDefined(0))) {
29504 arg0.RawSetAsSupportedType() = SupportedType::Text_html;
29505 } else {
29506 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29507 return false;
29508 }
29509 }
29510 if (objIsXray) {
29511 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29512 // we know Xrays have no dynamic unwrap behavior.
29513 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29514 if (!unwrappedObj.ref()) {
29515 return false;
29516 }
29517 }
29518 FastErrorResult rv;
29519 // NOTE: This assert does NOT call the function.
29520 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");
29521 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29522 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17"
)), 0))
) {
29523 return false;
29524 }
29525 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29525); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29526 args.rval().setUndefined();
29527 return true;
29528}
29529
29530static const JSJitInfo passUnionWithDefaultValue17_methodinfo = {
29531 { (JSJitGetterOp)passUnionWithDefaultValue17 },
29532 { prototypes::id::TestJSImplInterface },
29533 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29534 JSJitInfo::Method,
29535 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29536 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29537 false, /* isInfallible. False in setters. */
29538 false, /* isMovable. Not relevant for setters. */
29539 false, /* isEliminatable. Not relevant for setters. */
29540 false, /* isAlwaysInSlot. Only relevant for getters. */
29541 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29542 false, /* isTypedMethod. Only relevant for methods. */
29543 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29544};
29545
29546MOZ_CAN_RUN_SCRIPT static bool
29547passUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29548{
29549 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue18");
29550 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29553( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29551 "TestJSImplInterface", "passUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29553( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29552 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29553( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29553 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29553( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29554
29555 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29556 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29557 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29558 if (objIsXray) {
29559 unwrappedObj.emplace(cx, obj);
29560 }
29561 DoubleOrSupportedType arg0;
29562 if (!(args.hasDefined(0))) {
29563 arg0.RawSetAsDouble() = 1.0;
29564 } else {
29565 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29566 return false;
29567 }
29568 }
29569 if (objIsXray) {
29570 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29571 // we know Xrays have no dynamic unwrap behavior.
29572 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29573 if (!unwrappedObj.ref()) {
29574 return false;
29575 }
29576 }
29577 FastErrorResult rv;
29578 // NOTE: This assert does NOT call the function.
29579 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");
29580 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29581 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18"
)), 0))
) {
29582 return false;
29583 }
29584 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29584); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29584); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29585 args.rval().setUndefined();
29586 return true;
29587}
29588
29589static const JSJitInfo passUnionWithDefaultValue18_methodinfo = {
29590 { (JSJitGetterOp)passUnionWithDefaultValue18 },
29591 { prototypes::id::TestJSImplInterface },
29592 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29593 JSJitInfo::Method,
29594 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29595 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29596 false, /* isInfallible. False in setters. */
29597 false, /* isMovable. Not relevant for setters. */
29598 false, /* isEliminatable. Not relevant for setters. */
29599 false, /* isAlwaysInSlot. Only relevant for getters. */
29600 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29601 false, /* isTypedMethod. Only relevant for methods. */
29602 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29603};
29604
29605MOZ_CAN_RUN_SCRIPT static bool
29606passUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29607{
29608 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue19");
29609 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29612( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29610 "TestJSImplInterface", "passUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29612( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29611 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29612( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29612 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29612( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29613
29614 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29615 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29616 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29617 if (objIsXray) {
29618 unwrappedObj.emplace(cx, obj);
29619 }
29620 DoubleOrSupportedType arg0;
29621 if (!(args.hasDefined(0))) {
29622 arg0.RawSetAsDouble() = 1.5;
29623 } else {
29624 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29625 return false;
29626 }
29627 }
29628 if (objIsXray) {
29629 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29630 // we know Xrays have no dynamic unwrap behavior.
29631 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29632 if (!unwrappedObj.ref()) {
29633 return false;
29634 }
29635 }
29636 FastErrorResult rv;
29637 // NOTE: This assert does NOT call the function.
29638 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");
29639 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29640 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19"
)), 0))
) {
29641 return false;
29642 }
29643 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29643); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29643); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29644 args.rval().setUndefined();
29645 return true;
29646}
29647
29648static const JSJitInfo passUnionWithDefaultValue19_methodinfo = {
29649 { (JSJitGetterOp)passUnionWithDefaultValue19 },
29650 { prototypes::id::TestJSImplInterface },
29651 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29652 JSJitInfo::Method,
29653 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29654 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29655 false, /* isInfallible. False in setters. */
29656 false, /* isMovable. Not relevant for setters. */
29657 false, /* isEliminatable. Not relevant for setters. */
29658 false, /* isAlwaysInSlot. Only relevant for getters. */
29659 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29660 false, /* isTypedMethod. Only relevant for methods. */
29661 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29662};
29663
29664MOZ_CAN_RUN_SCRIPT static bool
29665passUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29666{
29667 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue20");
29668 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29671( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29669 "TestJSImplInterface", "passUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29671( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29670 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29671( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29671 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29671( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29672
29673 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29674 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29675 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29676 if (objIsXray) {
29677 unwrappedObj.emplace(cx, obj);
29678 }
29679 DoubleOrUSVString arg0;
29680 if (!(args.hasDefined(0))) {
29681 arg0.SetStringLiteral(u"abc");
29682 } else {
29683 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29684 return false;
29685 }
29686 }
29687 if (objIsXray) {
29688 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29689 // we know Xrays have no dynamic unwrap behavior.
29690 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29691 if (!unwrappedObj.ref()) {
29692 return false;
29693 }
29694 }
29695 FastErrorResult rv;
29696 // NOTE: This assert does NOT call the function.
29697 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");
29698 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29699 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20"
)), 0))
) {
29700 return false;
29701 }
29702 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29702); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29702); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29703 args.rval().setUndefined();
29704 return true;
29705}
29706
29707static const JSJitInfo passUnionWithDefaultValue20_methodinfo = {
29708 { (JSJitGetterOp)passUnionWithDefaultValue20 },
29709 { prototypes::id::TestJSImplInterface },
29710 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29711 JSJitInfo::Method,
29712 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29713 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29714 false, /* isInfallible. False in setters. */
29715 false, /* isMovable. Not relevant for setters. */
29716 false, /* isEliminatable. Not relevant for setters. */
29717 false, /* isAlwaysInSlot. Only relevant for getters. */
29718 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29719 false, /* isTypedMethod. Only relevant for methods. */
29720 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29721};
29722
29723MOZ_CAN_RUN_SCRIPT static bool
29724passUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29725{
29726 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue21");
29727 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29730( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29728 "TestJSImplInterface", "passUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29730( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29729 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29730( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29730 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29730( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29731
29732 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29733 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29734 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29735 if (objIsXray) {
29736 unwrappedObj.emplace(cx, obj);
29737 }
29738 DoubleOrUSVString arg0;
29739 if (!(args.hasDefined(0))) {
29740 arg0.RawSetAsDouble() = 1.0;
29741 } else {
29742 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29743 return false;
29744 }
29745 }
29746 if (objIsXray) {
29747 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29748 // we know Xrays have no dynamic unwrap behavior.
29749 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29750 if (!unwrappedObj.ref()) {
29751 return false;
29752 }
29753 }
29754 FastErrorResult rv;
29755 // NOTE: This assert does NOT call the function.
29756 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");
29757 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29758 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21"
)), 0))
) {
29759 return false;
29760 }
29761 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29761); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29761); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29762 args.rval().setUndefined();
29763 return true;
29764}
29765
29766static const JSJitInfo passUnionWithDefaultValue21_methodinfo = {
29767 { (JSJitGetterOp)passUnionWithDefaultValue21 },
29768 { prototypes::id::TestJSImplInterface },
29769 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29770 JSJitInfo::Method,
29771 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29772 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29773 false, /* isInfallible. False in setters. */
29774 false, /* isMovable. Not relevant for setters. */
29775 false, /* isEliminatable. Not relevant for setters. */
29776 false, /* isAlwaysInSlot. Only relevant for getters. */
29777 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29778 false, /* isTypedMethod. Only relevant for methods. */
29779 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29780};
29781
29782MOZ_CAN_RUN_SCRIPT static bool
29783passUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29784{
29785 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue22");
29786 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29789( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29787 "TestJSImplInterface", "passUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29789( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29788 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29789( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29789 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29789( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29790
29791 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29792 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29793 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29794 if (objIsXray) {
29795 unwrappedObj.emplace(cx, obj);
29796 }
29797 DoubleOrUSVString arg0;
29798 if (!(args.hasDefined(0))) {
29799 arg0.RawSetAsDouble() = 1.5;
29800 } else {
29801 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29802 return false;
29803 }
29804 }
29805 if (objIsXray) {
29806 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29807 // we know Xrays have no dynamic unwrap behavior.
29808 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29809 if (!unwrappedObj.ref()) {
29810 return false;
29811 }
29812 }
29813 FastErrorResult rv;
29814 // NOTE: This assert does NOT call the function.
29815 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");
29816 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29817 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22"
)), 0))
) {
29818 return false;
29819 }
29820 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29820); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29820); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29821 args.rval().setUndefined();
29822 return true;
29823}
29824
29825static const JSJitInfo passUnionWithDefaultValue22_methodinfo = {
29826 { (JSJitGetterOp)passUnionWithDefaultValue22 },
29827 { prototypes::id::TestJSImplInterface },
29828 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29829 JSJitInfo::Method,
29830 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29831 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29832 false, /* isInfallible. False in setters. */
29833 false, /* isMovable. Not relevant for setters. */
29834 false, /* isEliminatable. Not relevant for setters. */
29835 false, /* isAlwaysInSlot. Only relevant for getters. */
29836 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29837 false, /* isTypedMethod. Only relevant for methods. */
29838 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29839};
29840
29841MOZ_CAN_RUN_SCRIPT static bool
29842passUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29843{
29844 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue23");
29845 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29848( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29846 "TestJSImplInterface", "passUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29848( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29847 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29848( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29848 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29848( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29849
29850 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29851 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29852 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29853 if (objIsXray) {
29854 unwrappedObj.emplace(cx, obj);
29855 }
29856 DoubleOrUTF8String arg0;
29857 if (!(args.hasDefined(0))) {
29858 arg0.SetStringLiteral("");
29859 } else {
29860 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29861 return false;
29862 }
29863 }
29864 if (objIsXray) {
29865 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29866 // we know Xrays have no dynamic unwrap behavior.
29867 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29868 if (!unwrappedObj.ref()) {
29869 return false;
29870 }
29871 }
29872 FastErrorResult rv;
29873 // NOTE: This assert does NOT call the function.
29874 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");
29875 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29876 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23"
)), 0))
) {
29877 return false;
29878 }
29879 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29879); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29880 args.rval().setUndefined();
29881 return true;
29882}
29883
29884static const JSJitInfo passUnionWithDefaultValue23_methodinfo = {
29885 { (JSJitGetterOp)passUnionWithDefaultValue23 },
29886 { prototypes::id::TestJSImplInterface },
29887 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29888 JSJitInfo::Method,
29889 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29890 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29891 false, /* isInfallible. False in setters. */
29892 false, /* isMovable. Not relevant for setters. */
29893 false, /* isEliminatable. Not relevant for setters. */
29894 false, /* isAlwaysInSlot. Only relevant for getters. */
29895 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29896 false, /* isTypedMethod. Only relevant for methods. */
29897 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29898};
29899
29900MOZ_CAN_RUN_SCRIPT static bool
29901passUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29902{
29903 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue24");
29904 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29907( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29905 "TestJSImplInterface", "passUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29907( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29906 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29907( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29907 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29907( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29908
29909 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29910 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29911 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29912 if (objIsXray) {
29913 unwrappedObj.emplace(cx, obj);
29914 }
29915 DoubleOrUTF8String arg0;
29916 if (!(args.hasDefined(0))) {
29917 arg0.RawSetAsDouble() = 1.0;
29918 } else {
29919 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29920 return false;
29921 }
29922 }
29923 if (objIsXray) {
29924 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29925 // we know Xrays have no dynamic unwrap behavior.
29926 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29927 if (!unwrappedObj.ref()) {
29928 return false;
29929 }
29930 }
29931 FastErrorResult rv;
29932 // NOTE: This assert does NOT call the function.
29933 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");
29934 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29935 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24"
)), 0))
) {
29936 return false;
29937 }
29938 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29938); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29938); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29939 args.rval().setUndefined();
29940 return true;
29941}
29942
29943static const JSJitInfo passUnionWithDefaultValue24_methodinfo = {
29944 { (JSJitGetterOp)passUnionWithDefaultValue24 },
29945 { prototypes::id::TestJSImplInterface },
29946 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29947 JSJitInfo::Method,
29948 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29949 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29950 false, /* isInfallible. False in setters. */
29951 false, /* isMovable. Not relevant for setters. */
29952 false, /* isEliminatable. Not relevant for setters. */
29953 false, /* isAlwaysInSlot. Only relevant for getters. */
29954 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29955 false, /* isTypedMethod. Only relevant for methods. */
29956 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29957};
29958
29959MOZ_CAN_RUN_SCRIPT static bool
29960passUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29961{
29962 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue25");
29963 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29966( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29964 "TestJSImplInterface", "passUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29966( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29965 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29966( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29966 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29966( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29967
29968 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29969 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29970 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29971 if (objIsXray) {
29972 unwrappedObj.emplace(cx, obj);
29973 }
29974 DoubleOrUTF8String arg0;
29975 if (!(args.hasDefined(0))) {
29976 arg0.RawSetAsDouble() = 1.5;
29977 } else {
29978 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29979 return false;
29980 }
29981 }
29982 if (objIsXray) {
29983 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29984 // we know Xrays have no dynamic unwrap behavior.
29985 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29986 if (!unwrappedObj.ref()) {
29987 return false;
29988 }
29989 }
29990 FastErrorResult rv;
29991 // NOTE: This assert does NOT call the function.
29992 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");
29993 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29994 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25"
)), 0))
) {
29995 return false;
29996 }
29997 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29997); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 29997); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
29998 args.rval().setUndefined();
29999 return true;
30000}
30001
30002static const JSJitInfo passUnionWithDefaultValue25_methodinfo = {
30003 { (JSJitGetterOp)passUnionWithDefaultValue25 },
30004 { prototypes::id::TestJSImplInterface },
30005 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30006 JSJitInfo::Method,
30007 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30008 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30009 false, /* isInfallible. False in setters. */
30010 false, /* isMovable. Not relevant for setters. */
30011 false, /* isEliminatable. Not relevant for setters. */
30012 false, /* isAlwaysInSlot. Only relevant for getters. */
30013 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30014 false, /* isTypedMethod. Only relevant for methods. */
30015 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30016};
30017
30018MOZ_CAN_RUN_SCRIPT static bool
30019passNullableUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30020{
30021 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue1");
30022 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30025( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30023 "TestJSImplInterface", "passNullableUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30025( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30024 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30025( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30025 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30025( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30026
30027 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30028 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30029 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30030 if (objIsXray) {
30031 unwrappedObj.emplace(cx, obj);
30032 }
30033 Nullable<DoubleOrString > arg0;
30034 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30035 arg0.SetNull();
30036 } else {
30037 if (!(args.hasDefined(0))) {
30038 arg0.SetValue().SetStringLiteral(u"");
30039 } else {
30040 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30041 return false;
30042 }
30043 }
30044 }
30045 if (objIsXray) {
30046 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30047 // we know Xrays have no dynamic unwrap behavior.
30048 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30049 if (!unwrappedObj.ref()) {
30050 return false;
30051 }
30052 }
30053 FastErrorResult rv;
30054 // NOTE: This assert does NOT call the function.
30055 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");
30056 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30057 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1"
)), 0))
) {
30058 return false;
30059 }
30060 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30060); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30060); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30061 args.rval().setUndefined();
30062 return true;
30063}
30064
30065static const JSJitInfo passNullableUnionWithDefaultValue1_methodinfo = {
30066 { (JSJitGetterOp)passNullableUnionWithDefaultValue1 },
30067 { prototypes::id::TestJSImplInterface },
30068 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30069 JSJitInfo::Method,
30070 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30071 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30072 false, /* isInfallible. False in setters. */
30073 false, /* isMovable. Not relevant for setters. */
30074 false, /* isEliminatable. Not relevant for setters. */
30075 false, /* isAlwaysInSlot. Only relevant for getters. */
30076 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30077 false, /* isTypedMethod. Only relevant for methods. */
30078 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30079};
30080
30081MOZ_CAN_RUN_SCRIPT static bool
30082passNullableUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30083{
30084 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue2");
30085 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30088( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30086 "TestJSImplInterface", "passNullableUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30088( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30087 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30088( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30088 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30088( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30089
30090 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30091 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30092 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30093 if (objIsXray) {
30094 unwrappedObj.emplace(cx, obj);
30095 }
30096 Nullable<DoubleOrString > arg0;
30097 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30098 arg0.SetNull();
30099 } else {
30100 if (!(args.hasDefined(0))) {
30101 arg0.SetValue().RawSetAsDouble() = 1.0;
30102 } else {
30103 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30104 return false;
30105 }
30106 }
30107 }
30108 if (objIsXray) {
30109 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30110 // we know Xrays have no dynamic unwrap behavior.
30111 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30112 if (!unwrappedObj.ref()) {
30113 return false;
30114 }
30115 }
30116 FastErrorResult rv;
30117 // NOTE: This assert does NOT call the function.
30118 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");
30119 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30120 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2"
)), 0))
) {
30121 return false;
30122 }
30123 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30123); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30123); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30124 args.rval().setUndefined();
30125 return true;
30126}
30127
30128static const JSJitInfo passNullableUnionWithDefaultValue2_methodinfo = {
30129 { (JSJitGetterOp)passNullableUnionWithDefaultValue2 },
30130 { prototypes::id::TestJSImplInterface },
30131 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30132 JSJitInfo::Method,
30133 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30134 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30135 false, /* isInfallible. False in setters. */
30136 false, /* isMovable. Not relevant for setters. */
30137 false, /* isEliminatable. Not relevant for setters. */
30138 false, /* isAlwaysInSlot. Only relevant for getters. */
30139 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30140 false, /* isTypedMethod. Only relevant for methods. */
30141 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30142};
30143
30144MOZ_CAN_RUN_SCRIPT static bool
30145passNullableUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30146{
30147 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue3");
30148 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30151( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30149 "TestJSImplInterface", "passNullableUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30151( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30150 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30151( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30151 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30151( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30152
30153 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30154 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30155 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30156 if (objIsXray) {
30157 unwrappedObj.emplace(cx, obj);
30158 }
30159 Nullable<DoubleOrString > arg0;
30160 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30161 arg0.SetNull();
30162 } else {
30163 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30164 return false;
30165 }
30166 }
30167 if (objIsXray) {
30168 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30169 // we know Xrays have no dynamic unwrap behavior.
30170 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30171 if (!unwrappedObj.ref()) {
30172 return false;
30173 }
30174 }
30175 FastErrorResult rv;
30176 // NOTE: This assert does NOT call the function.
30177 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");
30178 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30179 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3"
)), 0))
) {
30180 return false;
30181 }
30182 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30182); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30182); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30183 args.rval().setUndefined();
30184 return true;
30185}
30186
30187static const JSJitInfo passNullableUnionWithDefaultValue3_methodinfo = {
30188 { (JSJitGetterOp)passNullableUnionWithDefaultValue3 },
30189 { prototypes::id::TestJSImplInterface },
30190 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30191 JSJitInfo::Method,
30192 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30193 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30194 false, /* isInfallible. False in setters. */
30195 false, /* isMovable. Not relevant for setters. */
30196 false, /* isEliminatable. Not relevant for setters. */
30197 false, /* isAlwaysInSlot. Only relevant for getters. */
30198 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30199 false, /* isTypedMethod. Only relevant for methods. */
30200 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30201};
30202
30203MOZ_CAN_RUN_SCRIPT static bool
30204passNullableUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30205{
30206 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue4");
30207 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30210( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30208 "TestJSImplInterface", "passNullableUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30210( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30209 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30210( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30210 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30210( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30211
30212 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30213 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30214 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30215 if (objIsXray) {
30216 unwrappedObj.emplace(cx, obj);
30217 }
30218 Nullable<FloatOrString > arg0;
30219 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30220 arg0.SetNull();
30221 } else {
30222 if (!(args.hasDefined(0))) {
30223 arg0.SetValue().SetStringLiteral(u"");
30224 } else {
30225 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30226 return false;
30227 }
30228 }
30229 }
30230 if (objIsXray) {
30231 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30232 // we know Xrays have no dynamic unwrap behavior.
30233 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30234 if (!unwrappedObj.ref()) {
30235 return false;
30236 }
30237 }
30238 FastErrorResult rv;
30239 // NOTE: This assert does NOT call the function.
30240 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");
30241 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30242 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4"
)), 0))
) {
30243 return false;
30244 }
30245 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30245); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30245); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30246 args.rval().setUndefined();
30247 return true;
30248}
30249
30250static const JSJitInfo passNullableUnionWithDefaultValue4_methodinfo = {
30251 { (JSJitGetterOp)passNullableUnionWithDefaultValue4 },
30252 { prototypes::id::TestJSImplInterface },
30253 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30254 JSJitInfo::Method,
30255 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30256 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30257 false, /* isInfallible. False in setters. */
30258 false, /* isMovable. Not relevant for setters. */
30259 false, /* isEliminatable. Not relevant for setters. */
30260 false, /* isAlwaysInSlot. Only relevant for getters. */
30261 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30262 false, /* isTypedMethod. Only relevant for methods. */
30263 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30264};
30265
30266MOZ_CAN_RUN_SCRIPT static bool
30267passNullableUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30268{
30269 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue5");
30270 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30273( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30271 "TestJSImplInterface", "passNullableUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30273( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30272 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30273( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30273 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30273( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30274
30275 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30276 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30277 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30278 if (objIsXray) {
30279 unwrappedObj.emplace(cx, obj);
30280 }
30281 Nullable<FloatOrString > arg0;
30282 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30283 arg0.SetNull();
30284 } else {
30285 if (!(args.hasDefined(0))) {
30286 arg0.SetValue().RawSetAsFloat() = 1.0F;
30287 } else {
30288 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30289 return false;
30290 }
30291 }
30292 }
30293 if (objIsXray) {
30294 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30295 // we know Xrays have no dynamic unwrap behavior.
30296 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30297 if (!unwrappedObj.ref()) {
30298 return false;
30299 }
30300 }
30301 FastErrorResult rv;
30302 // NOTE: This assert does NOT call the function.
30303 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");
30304 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30305 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5"
)), 0))
) {
30306 return false;
30307 }
30308 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30308); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30308); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30309 args.rval().setUndefined();
30310 return true;
30311}
30312
30313static const JSJitInfo passNullableUnionWithDefaultValue5_methodinfo = {
30314 { (JSJitGetterOp)passNullableUnionWithDefaultValue5 },
30315 { prototypes::id::TestJSImplInterface },
30316 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30317 JSJitInfo::Method,
30318 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30319 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30320 false, /* isInfallible. False in setters. */
30321 false, /* isMovable. Not relevant for setters. */
30322 false, /* isEliminatable. Not relevant for setters. */
30323 false, /* isAlwaysInSlot. Only relevant for getters. */
30324 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30325 false, /* isTypedMethod. Only relevant for methods. */
30326 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30327};
30328
30329MOZ_CAN_RUN_SCRIPT static bool
30330passNullableUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30331{
30332 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue6");
30333 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30336( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30334 "TestJSImplInterface", "passNullableUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30336( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30335 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30336( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30336 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30336( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30337
30338 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30339 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30340 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30341 if (objIsXray) {
30342 unwrappedObj.emplace(cx, obj);
30343 }
30344 Nullable<FloatOrString > arg0;
30345 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30346 arg0.SetNull();
30347 } else {
30348 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30349 return false;
30350 }
30351 }
30352 if (objIsXray) {
30353 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30354 // we know Xrays have no dynamic unwrap behavior.
30355 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30356 if (!unwrappedObj.ref()) {
30357 return false;
30358 }
30359 }
30360 FastErrorResult rv;
30361 // NOTE: This assert does NOT call the function.
30362 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");
30363 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30364 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6"
)), 0))
) {
30365 return false;
30366 }
30367 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30367); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30368 args.rval().setUndefined();
30369 return true;
30370}
30371
30372static const JSJitInfo passNullableUnionWithDefaultValue6_methodinfo = {
30373 { (JSJitGetterOp)passNullableUnionWithDefaultValue6 },
30374 { prototypes::id::TestJSImplInterface },
30375 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30376 JSJitInfo::Method,
30377 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30378 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30379 false, /* isInfallible. False in setters. */
30380 false, /* isMovable. Not relevant for setters. */
30381 false, /* isEliminatable. Not relevant for setters. */
30382 false, /* isAlwaysInSlot. Only relevant for getters. */
30383 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30384 false, /* isTypedMethod. Only relevant for methods. */
30385 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30386};
30387
30388MOZ_CAN_RUN_SCRIPT static bool
30389passNullableUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30390{
30391 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue7");
30392 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30395( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30393 "TestJSImplInterface", "passNullableUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30395( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30394 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30395( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30395 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30395( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30396
30397 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30398 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30399 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30400 if (objIsXray) {
30401 unwrappedObj.emplace(cx, obj);
30402 }
30403 Nullable<UnrestrictedDoubleOrString > arg0;
30404 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30405 arg0.SetNull();
30406 } else {
30407 if (!(args.hasDefined(0))) {
30408 arg0.SetValue().SetStringLiteral(u"");
30409 } else {
30410 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30411 return false;
30412 }
30413 }
30414 }
30415 if (objIsXray) {
30416 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30417 // we know Xrays have no dynamic unwrap behavior.
30418 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30419 if (!unwrappedObj.ref()) {
30420 return false;
30421 }
30422 }
30423 FastErrorResult rv;
30424 // NOTE: This assert does NOT call the function.
30425 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");
30426 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30427 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7"
)), 0))
) {
30428 return false;
30429 }
30430 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30430); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30430); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30431 args.rval().setUndefined();
30432 return true;
30433}
30434
30435static const JSJitInfo passNullableUnionWithDefaultValue7_methodinfo = {
30436 { (JSJitGetterOp)passNullableUnionWithDefaultValue7 },
30437 { prototypes::id::TestJSImplInterface },
30438 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30439 JSJitInfo::Method,
30440 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30441 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30442 false, /* isInfallible. False in setters. */
30443 false, /* isMovable. Not relevant for setters. */
30444 false, /* isEliminatable. Not relevant for setters. */
30445 false, /* isAlwaysInSlot. Only relevant for getters. */
30446 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30447 false, /* isTypedMethod. Only relevant for methods. */
30448 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30449};
30450
30451MOZ_CAN_RUN_SCRIPT static bool
30452passNullableUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30453{
30454 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue8");
30455 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30458( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30456 "TestJSImplInterface", "passNullableUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30458( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30457 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30458( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30458 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30458( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30459
30460 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30461 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30462 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30463 if (objIsXray) {
30464 unwrappedObj.emplace(cx, obj);
30465 }
30466 Nullable<UnrestrictedDoubleOrString > arg0;
30467 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30468 arg0.SetNull();
30469 } else {
30470 if (!(args.hasDefined(0))) {
30471 arg0.SetValue().RawSetAsUnrestrictedDouble() = 1.0;
30472 } else {
30473 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30474 return false;
30475 }
30476 }
30477 }
30478 if (objIsXray) {
30479 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30480 // we know Xrays have no dynamic unwrap behavior.
30481 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30482 if (!unwrappedObj.ref()) {
30483 return false;
30484 }
30485 }
30486 FastErrorResult rv;
30487 // NOTE: This assert does NOT call the function.
30488 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");
30489 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30490 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8"
)), 0))
) {
30491 return false;
30492 }
30493 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30493); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30494 args.rval().setUndefined();
30495 return true;
30496}
30497
30498static const JSJitInfo passNullableUnionWithDefaultValue8_methodinfo = {
30499 { (JSJitGetterOp)passNullableUnionWithDefaultValue8 },
30500 { prototypes::id::TestJSImplInterface },
30501 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30502 JSJitInfo::Method,
30503 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30504 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30505 false, /* isInfallible. False in setters. */
30506 false, /* isMovable. Not relevant for setters. */
30507 false, /* isEliminatable. Not relevant for setters. */
30508 false, /* isAlwaysInSlot. Only relevant for getters. */
30509 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30510 false, /* isTypedMethod. Only relevant for methods. */
30511 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30512};
30513
30514MOZ_CAN_RUN_SCRIPT static bool
30515passNullableUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30516{
30517 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue9");
30518 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30521( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30519 "TestJSImplInterface", "passNullableUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30521( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30520 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30521( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30521 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30521( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30522
30523 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30524 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30525 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30526 if (objIsXray) {
30527 unwrappedObj.emplace(cx, obj);
30528 }
30529 Nullable<UnrestrictedDoubleOrString > arg0;
30530 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30531 arg0.SetNull();
30532 } else {
30533 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30534 return false;
30535 }
30536 }
30537 if (objIsXray) {
30538 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30539 // we know Xrays have no dynamic unwrap behavior.
30540 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30541 if (!unwrappedObj.ref()) {
30542 return false;
30543 }
30544 }
30545 FastErrorResult rv;
30546 // NOTE: This assert does NOT call the function.
30547 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");
30548 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30549 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9"
)), 0))
) {
30550 return false;
30551 }
30552 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30552); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30553 args.rval().setUndefined();
30554 return true;
30555}
30556
30557static const JSJitInfo passNullableUnionWithDefaultValue9_methodinfo = {
30558 { (JSJitGetterOp)passNullableUnionWithDefaultValue9 },
30559 { prototypes::id::TestJSImplInterface },
30560 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30561 JSJitInfo::Method,
30562 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30563 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30564 false, /* isInfallible. False in setters. */
30565 false, /* isMovable. Not relevant for setters. */
30566 false, /* isEliminatable. Not relevant for setters. */
30567 false, /* isAlwaysInSlot. Only relevant for getters. */
30568 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30569 false, /* isTypedMethod. Only relevant for methods. */
30570 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30571};
30572
30573MOZ_CAN_RUN_SCRIPT static bool
30574passNullableUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30575{
30576 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue10");
30577 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30580( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30578 "TestJSImplInterface", "passNullableUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30580( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30579 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30580( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30580 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30580( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30581
30582 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30583 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30584 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30585 if (objIsXray) {
30586 unwrappedObj.emplace(cx, obj);
30587 }
30588 Nullable<UnrestrictedFloatOrString > arg0;
30589 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30590 arg0.SetNull();
30591 } else {
30592 if (!(args.hasDefined(0))) {
30593 arg0.SetValue().SetStringLiteral(u"");
30594 } else {
30595 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30596 return false;
30597 }
30598 }
30599 }
30600 if (objIsXray) {
30601 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30602 // we know Xrays have no dynamic unwrap behavior.
30603 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30604 if (!unwrappedObj.ref()) {
30605 return false;
30606 }
30607 }
30608 FastErrorResult rv;
30609 // NOTE: This assert does NOT call the function.
30610 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");
30611 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30612 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10"
)), 0))
) {
30613 return false;
30614 }
30615 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30615); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30615); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30616 args.rval().setUndefined();
30617 return true;
30618}
30619
30620static const JSJitInfo passNullableUnionWithDefaultValue10_methodinfo = {
30621 { (JSJitGetterOp)passNullableUnionWithDefaultValue10 },
30622 { prototypes::id::TestJSImplInterface },
30623 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30624 JSJitInfo::Method,
30625 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30626 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30627 false, /* isInfallible. False in setters. */
30628 false, /* isMovable. Not relevant for setters. */
30629 false, /* isEliminatable. Not relevant for setters. */
30630 false, /* isAlwaysInSlot. Only relevant for getters. */
30631 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30632 false, /* isTypedMethod. Only relevant for methods. */
30633 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30634};
30635
30636MOZ_CAN_RUN_SCRIPT static bool
30637passNullableUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30638{
30639 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue11");
30640 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30643( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30641 "TestJSImplInterface", "passNullableUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30643( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30642 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30643( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30643 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30643( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30644
30645 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30646 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30647 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30648 if (objIsXray) {
30649 unwrappedObj.emplace(cx, obj);
30650 }
30651 Nullable<UnrestrictedFloatOrString > arg0;
30652 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30653 arg0.SetNull();
30654 } else {
30655 if (!(args.hasDefined(0))) {
30656 arg0.SetValue().RawSetAsUnrestrictedFloat() = 1.0F;
30657 } else {
30658 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30659 return false;
30660 }
30661 }
30662 }
30663 if (objIsXray) {
30664 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30665 // we know Xrays have no dynamic unwrap behavior.
30666 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30667 if (!unwrappedObj.ref()) {
30668 return false;
30669 }
30670 }
30671 FastErrorResult rv;
30672 // NOTE: This assert does NOT call the function.
30673 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");
30674 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30675 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11"
)), 0))
) {
30676 return false;
30677 }
30678 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30678); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30678); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30679 args.rval().setUndefined();
30680 return true;
30681}
30682
30683static const JSJitInfo passNullableUnionWithDefaultValue11_methodinfo = {
30684 { (JSJitGetterOp)passNullableUnionWithDefaultValue11 },
30685 { prototypes::id::TestJSImplInterface },
30686 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30687 JSJitInfo::Method,
30688 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30689 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30690 false, /* isInfallible. False in setters. */
30691 false, /* isMovable. Not relevant for setters. */
30692 false, /* isEliminatable. Not relevant for setters. */
30693 false, /* isAlwaysInSlot. Only relevant for getters. */
30694 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30695 false, /* isTypedMethod. Only relevant for methods. */
30696 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30697};
30698
30699MOZ_CAN_RUN_SCRIPT static bool
30700passNullableUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30701{
30702 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue12");
30703 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30706( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30704 "TestJSImplInterface", "passNullableUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30706( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30705 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30706( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30706 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30706( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30707
30708 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30709 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30710 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30711 if (objIsXray) {
30712 unwrappedObj.emplace(cx, obj);
30713 }
30714 Nullable<UnrestrictedFloatOrString > arg0;
30715 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30716 arg0.SetNull();
30717 } else {
30718 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30719 return false;
30720 }
30721 }
30722 if (objIsXray) {
30723 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30724 // we know Xrays have no dynamic unwrap behavior.
30725 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30726 if (!unwrappedObj.ref()) {
30727 return false;
30728 }
30729 }
30730 FastErrorResult rv;
30731 // NOTE: This assert does NOT call the function.
30732 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");
30733 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30734 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12"
)), 0))
) {
30735 return false;
30736 }
30737 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30737); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30737); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30738 args.rval().setUndefined();
30739 return true;
30740}
30741
30742static const JSJitInfo passNullableUnionWithDefaultValue12_methodinfo = {
30743 { (JSJitGetterOp)passNullableUnionWithDefaultValue12 },
30744 { prototypes::id::TestJSImplInterface },
30745 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30746 JSJitInfo::Method,
30747 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30748 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30749 false, /* isInfallible. False in setters. */
30750 false, /* isMovable. Not relevant for setters. */
30751 false, /* isEliminatable. Not relevant for setters. */
30752 false, /* isAlwaysInSlot. Only relevant for getters. */
30753 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30754 false, /* isTypedMethod. Only relevant for methods. */
30755 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30756};
30757
30758MOZ_CAN_RUN_SCRIPT static bool
30759passNullableUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30760{
30761 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue13");
30762 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30765( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30763 "TestJSImplInterface", "passNullableUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30765( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30764 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30765( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30765 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30765( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30766
30767 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30768 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30769 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30770 if (objIsXray) {
30771 unwrappedObj.emplace(cx, obj);
30772 }
30773 Nullable<DoubleOrByteString > arg0;
30774 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30775 arg0.SetNull();
30776 } else {
30777 if (!(args.hasDefined(0))) {
30778 arg0.SetValue().SetStringLiteral("");
30779 } else {
30780 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30781 return false;
30782 }
30783 }
30784 }
30785 if (objIsXray) {
30786 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30787 // we know Xrays have no dynamic unwrap behavior.
30788 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30789 if (!unwrappedObj.ref()) {
30790 return false;
30791 }
30792 }
30793 FastErrorResult rv;
30794 // NOTE: This assert does NOT call the function.
30795 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");
30796 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30797 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13"
)), 0))
) {
30798 return false;
30799 }
30800 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30800); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30800); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30801 args.rval().setUndefined();
30802 return true;
30803}
30804
30805static const JSJitInfo passNullableUnionWithDefaultValue13_methodinfo = {
30806 { (JSJitGetterOp)passNullableUnionWithDefaultValue13 },
30807 { prototypes::id::TestJSImplInterface },
30808 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30809 JSJitInfo::Method,
30810 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30811 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30812 false, /* isInfallible. False in setters. */
30813 false, /* isMovable. Not relevant for setters. */
30814 false, /* isEliminatable. Not relevant for setters. */
30815 false, /* isAlwaysInSlot. Only relevant for getters. */
30816 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30817 false, /* isTypedMethod. Only relevant for methods. */
30818 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30819};
30820
30821MOZ_CAN_RUN_SCRIPT static bool
30822passNullableUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30823{
30824 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue14");
30825 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30828( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30826 "TestJSImplInterface", "passNullableUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30828( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30827 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30828( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30828 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30828( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30829
30830 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30831 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30832 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30833 if (objIsXray) {
30834 unwrappedObj.emplace(cx, obj);
30835 }
30836 Nullable<DoubleOrByteString > arg0;
30837 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30838 arg0.SetNull();
30839 } else {
30840 if (!(args.hasDefined(0))) {
30841 arg0.SetValue().RawSetAsDouble() = 1.0;
30842 } else {
30843 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30844 return false;
30845 }
30846 }
30847 }
30848 if (objIsXray) {
30849 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30850 // we know Xrays have no dynamic unwrap behavior.
30851 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30852 if (!unwrappedObj.ref()) {
30853 return false;
30854 }
30855 }
30856 FastErrorResult rv;
30857 // NOTE: This assert does NOT call the function.
30858 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");
30859 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30860 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14"
)), 0))
) {
30861 return false;
30862 }
30863 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30863); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30863); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30864 args.rval().setUndefined();
30865 return true;
30866}
30867
30868static const JSJitInfo passNullableUnionWithDefaultValue14_methodinfo = {
30869 { (JSJitGetterOp)passNullableUnionWithDefaultValue14 },
30870 { prototypes::id::TestJSImplInterface },
30871 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30872 JSJitInfo::Method,
30873 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30874 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30875 false, /* isInfallible. False in setters. */
30876 false, /* isMovable. Not relevant for setters. */
30877 false, /* isEliminatable. Not relevant for setters. */
30878 false, /* isAlwaysInSlot. Only relevant for getters. */
30879 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30880 false, /* isTypedMethod. Only relevant for methods. */
30881 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30882};
30883
30884MOZ_CAN_RUN_SCRIPT static bool
30885passNullableUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30886{
30887 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue15");
30888 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30891( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30889 "TestJSImplInterface", "passNullableUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30891( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30890 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30891( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30891 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30891( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30892
30893 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30894 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30895 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30896 if (objIsXray) {
30897 unwrappedObj.emplace(cx, obj);
30898 }
30899 Nullable<DoubleOrByteString > arg0;
30900 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30901 arg0.SetNull();
30902 } else {
30903 if (!(args.hasDefined(0))) {
30904 arg0.SetValue().RawSetAsDouble() = 1.5;
30905 } else {
30906 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30907 return false;
30908 }
30909 }
30910 }
30911 if (objIsXray) {
30912 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30913 // we know Xrays have no dynamic unwrap behavior.
30914 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30915 if (!unwrappedObj.ref()) {
30916 return false;
30917 }
30918 }
30919 FastErrorResult rv;
30920 // NOTE: This assert does NOT call the function.
30921 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");
30922 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30923 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15"
)), 0))
) {
30924 return false;
30925 }
30926 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30926); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30927 args.rval().setUndefined();
30928 return true;
30929}
30930
30931static const JSJitInfo passNullableUnionWithDefaultValue15_methodinfo = {
30932 { (JSJitGetterOp)passNullableUnionWithDefaultValue15 },
30933 { prototypes::id::TestJSImplInterface },
30934 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30935 JSJitInfo::Method,
30936 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30937 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30938 false, /* isInfallible. False in setters. */
30939 false, /* isMovable. Not relevant for setters. */
30940 false, /* isEliminatable. Not relevant for setters. */
30941 false, /* isAlwaysInSlot. Only relevant for getters. */
30942 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30943 false, /* isTypedMethod. Only relevant for methods. */
30944 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30945};
30946
30947MOZ_CAN_RUN_SCRIPT static bool
30948passNullableUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30949{
30950 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue16");
30951 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30954( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30952 "TestJSImplInterface", "passNullableUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30954( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30953 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30954( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30954 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30954( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30955
30956 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30957 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30958 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30959 if (objIsXray) {
30960 unwrappedObj.emplace(cx, obj);
30961 }
30962 Nullable<DoubleOrByteString > arg0;
30963 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30964 arg0.SetNull();
30965 } else {
30966 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30967 return false;
30968 }
30969 }
30970 if (objIsXray) {
30971 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30972 // we know Xrays have no dynamic unwrap behavior.
30973 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30974 if (!unwrappedObj.ref()) {
30975 return false;
30976 }
30977 }
30978 FastErrorResult rv;
30979 // NOTE: This assert does NOT call the function.
30980 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");
30981 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30982 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16"
)), 0))
) {
30983 return false;
30984 }
30985 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30985); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 30985); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
30986 args.rval().setUndefined();
30987 return true;
30988}
30989
30990static const JSJitInfo passNullableUnionWithDefaultValue16_methodinfo = {
30991 { (JSJitGetterOp)passNullableUnionWithDefaultValue16 },
30992 { prototypes::id::TestJSImplInterface },
30993 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30994 JSJitInfo::Method,
30995 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30996 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30997 false, /* isInfallible. False in setters. */
30998 false, /* isMovable. Not relevant for setters. */
30999 false, /* isEliminatable. Not relevant for setters. */
31000 false, /* isAlwaysInSlot. Only relevant for getters. */
31001 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31002 false, /* isTypedMethod. Only relevant for methods. */
31003 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31004};
31005
31006MOZ_CAN_RUN_SCRIPT static bool
31007passNullableUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31008{
31009 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue17");
31010 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31013( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31011 "TestJSImplInterface", "passNullableUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31013( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31012 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31013( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31013 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31013( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31014
31015 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31016 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31017 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31018 if (objIsXray) {
31019 unwrappedObj.emplace(cx, obj);
31020 }
31021 Nullable<DoubleOrSupportedType > arg0;
31022 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31023 arg0.SetNull();
31024 } else {
31025 if (!(args.hasDefined(0))) {
31026 arg0.SetValue().RawSetAsSupportedType() = SupportedType::Text_html;
31027 } else {
31028 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31029 return false;
31030 }
31031 }
31032 }
31033 if (objIsXray) {
31034 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31035 // we know Xrays have no dynamic unwrap behavior.
31036 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31037 if (!unwrappedObj.ref()) {
31038 return false;
31039 }
31040 }
31041 FastErrorResult rv;
31042 // NOTE: This assert does NOT call the function.
31043 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");
31044 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31045 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17"
)), 0))
) {
31046 return false;
31047 }
31048 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31048); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31049 args.rval().setUndefined();
31050 return true;
31051}
31052
31053static const JSJitInfo passNullableUnionWithDefaultValue17_methodinfo = {
31054 { (JSJitGetterOp)passNullableUnionWithDefaultValue17 },
31055 { prototypes::id::TestJSImplInterface },
31056 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31057 JSJitInfo::Method,
31058 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31059 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31060 false, /* isInfallible. False in setters. */
31061 false, /* isMovable. Not relevant for setters. */
31062 false, /* isEliminatable. Not relevant for setters. */
31063 false, /* isAlwaysInSlot. Only relevant for getters. */
31064 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31065 false, /* isTypedMethod. Only relevant for methods. */
31066 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31067};
31068
31069MOZ_CAN_RUN_SCRIPT static bool
31070passNullableUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31071{
31072 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue18");
31073 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31076( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31074 "TestJSImplInterface", "passNullableUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31076( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31075 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31076( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31076 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31076( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31077
31078 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31079 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31080 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31081 if (objIsXray) {
31082 unwrappedObj.emplace(cx, obj);
31083 }
31084 Nullable<DoubleOrSupportedType > arg0;
31085 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31086 arg0.SetNull();
31087 } else {
31088 if (!(args.hasDefined(0))) {
31089 arg0.SetValue().RawSetAsDouble() = 1.0;
31090 } else {
31091 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31092 return false;
31093 }
31094 }
31095 }
31096 if (objIsXray) {
31097 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31098 // we know Xrays have no dynamic unwrap behavior.
31099 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31100 if (!unwrappedObj.ref()) {
31101 return false;
31102 }
31103 }
31104 FastErrorResult rv;
31105 // NOTE: This assert does NOT call the function.
31106 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");
31107 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31108 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18"
)), 0))
) {
31109 return false;
31110 }
31111 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31111); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31111); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31112 args.rval().setUndefined();
31113 return true;
31114}
31115
31116static const JSJitInfo passNullableUnionWithDefaultValue18_methodinfo = {
31117 { (JSJitGetterOp)passNullableUnionWithDefaultValue18 },
31118 { prototypes::id::TestJSImplInterface },
31119 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31120 JSJitInfo::Method,
31121 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31122 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31123 false, /* isInfallible. False in setters. */
31124 false, /* isMovable. Not relevant for setters. */
31125 false, /* isEliminatable. Not relevant for setters. */
31126 false, /* isAlwaysInSlot. Only relevant for getters. */
31127 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31128 false, /* isTypedMethod. Only relevant for methods. */
31129 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31130};
31131
31132MOZ_CAN_RUN_SCRIPT static bool
31133passNullableUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31134{
31135 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue19");
31136 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31139( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31137 "TestJSImplInterface", "passNullableUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31139( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31138 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31139( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31139 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31139( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31140
31141 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31142 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31143 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31144 if (objIsXray) {
31145 unwrappedObj.emplace(cx, obj);
31146 }
31147 Nullable<DoubleOrSupportedType > arg0;
31148 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31149 arg0.SetNull();
31150 } else {
31151 if (!(args.hasDefined(0))) {
31152 arg0.SetValue().RawSetAsDouble() = 1.5;
31153 } else {
31154 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31155 return false;
31156 }
31157 }
31158 }
31159 if (objIsXray) {
31160 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31161 // we know Xrays have no dynamic unwrap behavior.
31162 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31163 if (!unwrappedObj.ref()) {
31164 return false;
31165 }
31166 }
31167 FastErrorResult rv;
31168 // NOTE: This assert does NOT call the function.
31169 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");
31170 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31171 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19"
)), 0))
) {
31172 return false;
31173 }
31174 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31174); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31174); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31175 args.rval().setUndefined();
31176 return true;
31177}
31178
31179static const JSJitInfo passNullableUnionWithDefaultValue19_methodinfo = {
31180 { (JSJitGetterOp)passNullableUnionWithDefaultValue19 },
31181 { prototypes::id::TestJSImplInterface },
31182 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31183 JSJitInfo::Method,
31184 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31185 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31186 false, /* isInfallible. False in setters. */
31187 false, /* isMovable. Not relevant for setters. */
31188 false, /* isEliminatable. Not relevant for setters. */
31189 false, /* isAlwaysInSlot. Only relevant for getters. */
31190 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31191 false, /* isTypedMethod. Only relevant for methods. */
31192 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31193};
31194
31195MOZ_CAN_RUN_SCRIPT static bool
31196passNullableUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31197{
31198 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue20");
31199 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31202( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31200 "TestJSImplInterface", "passNullableUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31202( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31201 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31202( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31202 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31202( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31203
31204 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31205 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31206 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31207 if (objIsXray) {
31208 unwrappedObj.emplace(cx, obj);
31209 }
31210 Nullable<DoubleOrSupportedType > arg0;
31211 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31212 arg0.SetNull();
31213 } else {
31214 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31215 return false;
31216 }
31217 }
31218 if (objIsXray) {
31219 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31220 // we know Xrays have no dynamic unwrap behavior.
31221 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31222 if (!unwrappedObj.ref()) {
31223 return false;
31224 }
31225 }
31226 FastErrorResult rv;
31227 // NOTE: This assert does NOT call the function.
31228 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");
31229 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31230 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20"
)), 0))
) {
31231 return false;
31232 }
31233 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31233); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31233); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31234 args.rval().setUndefined();
31235 return true;
31236}
31237
31238static const JSJitInfo passNullableUnionWithDefaultValue20_methodinfo = {
31239 { (JSJitGetterOp)passNullableUnionWithDefaultValue20 },
31240 { prototypes::id::TestJSImplInterface },
31241 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31242 JSJitInfo::Method,
31243 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31244 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31245 false, /* isInfallible. False in setters. */
31246 false, /* isMovable. Not relevant for setters. */
31247 false, /* isEliminatable. Not relevant for setters. */
31248 false, /* isAlwaysInSlot. Only relevant for getters. */
31249 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31250 false, /* isTypedMethod. Only relevant for methods. */
31251 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31252};
31253
31254MOZ_CAN_RUN_SCRIPT static bool
31255passNullableUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31256{
31257 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue21");
31258 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31261( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31259 "TestJSImplInterface", "passNullableUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31261( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31260 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31261( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31261 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31261( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31262
31263 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31264 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31265 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31266 if (objIsXray) {
31267 unwrappedObj.emplace(cx, obj);
31268 }
31269 Nullable<DoubleOrUSVString > arg0;
31270 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31271 arg0.SetNull();
31272 } else {
31273 if (!(args.hasDefined(0))) {
31274 arg0.SetValue().SetStringLiteral(u"abc");
31275 } else {
31276 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31277 return false;
31278 }
31279 }
31280 }
31281 if (objIsXray) {
31282 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31283 // we know Xrays have no dynamic unwrap behavior.
31284 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31285 if (!unwrappedObj.ref()) {
31286 return false;
31287 }
31288 }
31289 FastErrorResult rv;
31290 // NOTE: This assert does NOT call the function.
31291 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");
31292 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31293 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21"
)), 0))
) {
31294 return false;
31295 }
31296 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31296); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31296); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31297 args.rval().setUndefined();
31298 return true;
31299}
31300
31301static const JSJitInfo passNullableUnionWithDefaultValue21_methodinfo = {
31302 { (JSJitGetterOp)passNullableUnionWithDefaultValue21 },
31303 { prototypes::id::TestJSImplInterface },
31304 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31305 JSJitInfo::Method,
31306 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31307 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31308 false, /* isInfallible. False in setters. */
31309 false, /* isMovable. Not relevant for setters. */
31310 false, /* isEliminatable. Not relevant for setters. */
31311 false, /* isAlwaysInSlot. Only relevant for getters. */
31312 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31313 false, /* isTypedMethod. Only relevant for methods. */
31314 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31315};
31316
31317MOZ_CAN_RUN_SCRIPT static bool
31318passNullableUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31319{
31320 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue22");
31321 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31324( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31322 "TestJSImplInterface", "passNullableUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31324( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31323 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31324( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31324 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31324( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31325
31326 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31327 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31328 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31329 if (objIsXray) {
31330 unwrappedObj.emplace(cx, obj);
31331 }
31332 Nullable<DoubleOrUSVString > arg0;
31333 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31334 arg0.SetNull();
31335 } else {
31336 if (!(args.hasDefined(0))) {
31337 arg0.SetValue().RawSetAsDouble() = 1.0;
31338 } else {
31339 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31340 return false;
31341 }
31342 }
31343 }
31344 if (objIsXray) {
31345 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31346 // we know Xrays have no dynamic unwrap behavior.
31347 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31348 if (!unwrappedObj.ref()) {
31349 return false;
31350 }
31351 }
31352 FastErrorResult rv;
31353 // NOTE: This assert does NOT call the function.
31354 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");
31355 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31356 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22"
)), 0))
) {
31357 return false;
31358 }
31359 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31359); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31359); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31360 args.rval().setUndefined();
31361 return true;
31362}
31363
31364static const JSJitInfo passNullableUnionWithDefaultValue22_methodinfo = {
31365 { (JSJitGetterOp)passNullableUnionWithDefaultValue22 },
31366 { prototypes::id::TestJSImplInterface },
31367 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31368 JSJitInfo::Method,
31369 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31370 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31371 false, /* isInfallible. False in setters. */
31372 false, /* isMovable. Not relevant for setters. */
31373 false, /* isEliminatable. Not relevant for setters. */
31374 false, /* isAlwaysInSlot. Only relevant for getters. */
31375 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31376 false, /* isTypedMethod. Only relevant for methods. */
31377 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31378};
31379
31380MOZ_CAN_RUN_SCRIPT static bool
31381passNullableUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31382{
31383 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue23");
31384 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31387( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31385 "TestJSImplInterface", "passNullableUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31387( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31386 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31387( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31387 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31387( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31388
31389 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31390 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31391 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31392 if (objIsXray) {
31393 unwrappedObj.emplace(cx, obj);
31394 }
31395 Nullable<DoubleOrUSVString > arg0;
31396 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31397 arg0.SetNull();
31398 } else {
31399 if (!(args.hasDefined(0))) {
31400 arg0.SetValue().RawSetAsDouble() = 1.5;
31401 } else {
31402 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31403 return false;
31404 }
31405 }
31406 }
31407 if (objIsXray) {
31408 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31409 // we know Xrays have no dynamic unwrap behavior.
31410 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31411 if (!unwrappedObj.ref()) {
31412 return false;
31413 }
31414 }
31415 FastErrorResult rv;
31416 // NOTE: This assert does NOT call the function.
31417 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");
31418 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31419 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23"
)), 0))
) {
31420 return false;
31421 }
31422 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31422); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31422); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31423 args.rval().setUndefined();
31424 return true;
31425}
31426
31427static const JSJitInfo passNullableUnionWithDefaultValue23_methodinfo = {
31428 { (JSJitGetterOp)passNullableUnionWithDefaultValue23 },
31429 { prototypes::id::TestJSImplInterface },
31430 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31431 JSJitInfo::Method,
31432 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31433 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31434 false, /* isInfallible. False in setters. */
31435 false, /* isMovable. Not relevant for setters. */
31436 false, /* isEliminatable. Not relevant for setters. */
31437 false, /* isAlwaysInSlot. Only relevant for getters. */
31438 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31439 false, /* isTypedMethod. Only relevant for methods. */
31440 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31441};
31442
31443MOZ_CAN_RUN_SCRIPT static bool
31444passNullableUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31445{
31446 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue24");
31447 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31450( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31448 "TestJSImplInterface", "passNullableUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31450( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31449 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31450( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31450 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31450( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31451
31452 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31453 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31454 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31455 if (objIsXray) {
31456 unwrappedObj.emplace(cx, obj);
31457 }
31458 Nullable<DoubleOrUSVString > arg0;
31459 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31460 arg0.SetNull();
31461 } else {
31462 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31463 return false;
31464 }
31465 }
31466 if (objIsXray) {
31467 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31468 // we know Xrays have no dynamic unwrap behavior.
31469 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31470 if (!unwrappedObj.ref()) {
31471 return false;
31472 }
31473 }
31474 FastErrorResult rv;
31475 // NOTE: This assert does NOT call the function.
31476 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");
31477 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31478 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24"
)), 0))
) {
31479 return false;
31480 }
31481 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31481); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31482 args.rval().setUndefined();
31483 return true;
31484}
31485
31486static const JSJitInfo passNullableUnionWithDefaultValue24_methodinfo = {
31487 { (JSJitGetterOp)passNullableUnionWithDefaultValue24 },
31488 { prototypes::id::TestJSImplInterface },
31489 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31490 JSJitInfo::Method,
31491 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31492 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31493 false, /* isInfallible. False in setters. */
31494 false, /* isMovable. Not relevant for setters. */
31495 false, /* isEliminatable. Not relevant for setters. */
31496 false, /* isAlwaysInSlot. Only relevant for getters. */
31497 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31498 false, /* isTypedMethod. Only relevant for methods. */
31499 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31500};
31501
31502MOZ_CAN_RUN_SCRIPT static bool
31503passNullableUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31504{
31505 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue25");
31506 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31509( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31507 "TestJSImplInterface", "passNullableUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31509( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31508 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31509( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31509 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31509( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31510
31511 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31512 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31513 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31514 if (objIsXray) {
31515 unwrappedObj.emplace(cx, obj);
31516 }
31517 Nullable<DoubleOrUTF8String > arg0;
31518 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31519 arg0.SetNull();
31520 } else {
31521 if (!(args.hasDefined(0))) {
31522 arg0.SetValue().SetStringLiteral("");
31523 } else {
31524 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31525 return false;
31526 }
31527 }
31528 }
31529 if (objIsXray) {
31530 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31531 // we know Xrays have no dynamic unwrap behavior.
31532 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31533 if (!unwrappedObj.ref()) {
31534 return false;
31535 }
31536 }
31537 FastErrorResult rv;
31538 // NOTE: This assert does NOT call the function.
31539 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");
31540 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31541 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25"
)), 0))
) {
31542 return false;
31543 }
31544 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31544); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31545 args.rval().setUndefined();
31546 return true;
31547}
31548
31549static const JSJitInfo passNullableUnionWithDefaultValue25_methodinfo = {
31550 { (JSJitGetterOp)passNullableUnionWithDefaultValue25 },
31551 { prototypes::id::TestJSImplInterface },
31552 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31553 JSJitInfo::Method,
31554 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31555 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31556 false, /* isInfallible. False in setters. */
31557 false, /* isMovable. Not relevant for setters. */
31558 false, /* isEliminatable. Not relevant for setters. */
31559 false, /* isAlwaysInSlot. Only relevant for getters. */
31560 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31561 false, /* isTypedMethod. Only relevant for methods. */
31562 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31563};
31564
31565MOZ_CAN_RUN_SCRIPT static bool
31566passNullableUnionWithDefaultValue26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31567{
31568 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue26");
31569 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31572( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31570 "TestJSImplInterface", "passNullableUnionWithDefaultValue26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31572( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31571 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31572( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31572 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31572( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31573
31574 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31575 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31576 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31577 if (objIsXray) {
31578 unwrappedObj.emplace(cx, obj);
31579 }
31580 Nullable<DoubleOrUTF8String > arg0;
31581 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31582 arg0.SetNull();
31583 } else {
31584 if (!(args.hasDefined(0))) {
31585 arg0.SetValue().RawSetAsDouble() = 1.0;
31586 } else {
31587 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31588 return false;
31589 }
31590 }
31591 }
31592 if (objIsXray) {
31593 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31594 // we know Xrays have no dynamic unwrap behavior.
31595 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31596 if (!unwrappedObj.ref()) {
31597 return false;
31598 }
31599 }
31600 FastErrorResult rv;
31601 // NOTE: This assert does NOT call the function.
31602 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");
31603 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31604 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26"
)), 0))
) {
31605 return false;
31606 }
31607 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31607); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31608 args.rval().setUndefined();
31609 return true;
31610}
31611
31612static const JSJitInfo passNullableUnionWithDefaultValue26_methodinfo = {
31613 { (JSJitGetterOp)passNullableUnionWithDefaultValue26 },
31614 { prototypes::id::TestJSImplInterface },
31615 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31616 JSJitInfo::Method,
31617 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31618 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31619 false, /* isInfallible. False in setters. */
31620 false, /* isMovable. Not relevant for setters. */
31621 false, /* isEliminatable. Not relevant for setters. */
31622 false, /* isAlwaysInSlot. Only relevant for getters. */
31623 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31624 false, /* isTypedMethod. Only relevant for methods. */
31625 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31626};
31627
31628MOZ_CAN_RUN_SCRIPT static bool
31629passNullableUnionWithDefaultValue27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31630{
31631 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue27");
31632 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31635( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31633 "TestJSImplInterface", "passNullableUnionWithDefaultValue27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31635( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31634 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31635( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31635 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31635( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31636
31637 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31638 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31639 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31640 if (objIsXray) {
31641 unwrappedObj.emplace(cx, obj);
31642 }
31643 Nullable<DoubleOrUTF8String > arg0;
31644 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31645 arg0.SetNull();
31646 } else {
31647 if (!(args.hasDefined(0))) {
31648 arg0.SetValue().RawSetAsDouble() = 1.5;
31649 } else {
31650 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31651 return false;
31652 }
31653 }
31654 }
31655 if (objIsXray) {
31656 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31657 // we know Xrays have no dynamic unwrap behavior.
31658 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31659 if (!unwrappedObj.ref()) {
31660 return false;
31661 }
31662 }
31663 FastErrorResult rv;
31664 // NOTE: This assert does NOT call the function.
31665 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");
31666 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31667 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27"
)), 0))
) {
31668 return false;
31669 }
31670 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31670); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31671 args.rval().setUndefined();
31672 return true;
31673}
31674
31675static const JSJitInfo passNullableUnionWithDefaultValue27_methodinfo = {
31676 { (JSJitGetterOp)passNullableUnionWithDefaultValue27 },
31677 { prototypes::id::TestJSImplInterface },
31678 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31679 JSJitInfo::Method,
31680 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31681 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31682 false, /* isInfallible. False in setters. */
31683 false, /* isMovable. Not relevant for setters. */
31684 false, /* isEliminatable. Not relevant for setters. */
31685 false, /* isAlwaysInSlot. Only relevant for getters. */
31686 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31687 false, /* isTypedMethod. Only relevant for methods. */
31688 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31689};
31690
31691MOZ_CAN_RUN_SCRIPT static bool
31692passNullableUnionWithDefaultValue28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31693{
31694 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue28");
31695 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31698( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31696 "TestJSImplInterface", "passNullableUnionWithDefaultValue28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31698( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31697 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31698( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31698 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31698( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31699
31700 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31701 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31702 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31703 if (objIsXray) {
31704 unwrappedObj.emplace(cx, obj);
31705 }
31706 Nullable<DoubleOrUTF8String > arg0;
31707 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31708 arg0.SetNull();
31709 } else {
31710 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31711 return false;
31712 }
31713 }
31714 if (objIsXray) {
31715 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31716 // we know Xrays have no dynamic unwrap behavior.
31717 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31718 if (!unwrappedObj.ref()) {
31719 return false;
31720 }
31721 }
31722 FastErrorResult rv;
31723 // NOTE: This assert does NOT call the function.
31724 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");
31725 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31726 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28"
)), 0))
) {
31727 return false;
31728 }
31729 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31729); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31729); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31730 args.rval().setUndefined();
31731 return true;
31732}
31733
31734static const JSJitInfo passNullableUnionWithDefaultValue28_methodinfo = {
31735 { (JSJitGetterOp)passNullableUnionWithDefaultValue28 },
31736 { prototypes::id::TestJSImplInterface },
31737 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31738 JSJitInfo::Method,
31739 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31740 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31741 false, /* isInfallible. False in setters. */
31742 false, /* isMovable. Not relevant for setters. */
31743 false, /* isEliminatable. Not relevant for setters. */
31744 false, /* isAlwaysInSlot. Only relevant for getters. */
31745 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31746 false, /* isTypedMethod. Only relevant for methods. */
31747 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31748};
31749
31750MOZ_CAN_RUN_SCRIPT static bool
31751passSequenceOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31752{
31753 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions");
31754 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31755 "TestJSImplInterface", "passSequenceOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31756 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31757 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31757( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31758
31759 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31760 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfUnions", 1)) {
31761 return false;
31762 }
31763 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31764 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31765 if (objIsXray) {
31766 unwrappedObj.emplace(cx, obj);
31767 }
31768 binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0;
31769 if (args[0].isObject()) {
31770 JS::ForOfIterator iter(cx);
31771 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
31772 return false;
31773 }
31774 if (!iter.valueIsIterable()) {
31775 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31776 return false;
31777 }
31778 binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> &arr = arg0;
31779 JS::Rooted<JS::Value> temp(cx);
31780 while (true) {
31781 bool done;
31782 if (!iter.next(&temp, &done)) {
31783 return false;
31784 }
31785 if (done) {
31786 break;
31787 }
31788 OwningCanvasPatternOrCanvasGradient* slotPtr = arr.AppendElement(mozilla::fallible);
31789 if (!slotPtr) {
31790 JS_ReportOutOfMemory(cx);
31791 return false;
31792 }
31793 OwningCanvasPatternOrCanvasGradient& slot = *slotPtr;
31794 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
31795 return false;
31796 }
31797 }
31798 } else {
31799 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31800 return false;
31801 }
31802 if (objIsXray) {
31803 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31804 // we know Xrays have no dynamic unwrap behavior.
31805 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31806 if (!unwrappedObj.ref()) {
31807 return false;
31808 }
31809 }
31810 FastErrorResult rv;
31811 // NOTE: This assert does NOT call the function.
31812 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");
31813 MOZ_KnownLive(self)(self)->PassSequenceOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31814 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions"
)), 0))
) {
31815 return false;
31816 }
31817 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31817); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31817); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31818 args.rval().setUndefined();
31819 return true;
31820}
31821
31822static const JSJitInfo passSequenceOfUnions_methodinfo = {
31823 { (JSJitGetterOp)passSequenceOfUnions },
31824 { prototypes::id::TestJSImplInterface },
31825 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31826 JSJitInfo::Method,
31827 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31828 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31829 false, /* isInfallible. False in setters. */
31830 false, /* isMovable. Not relevant for setters. */
31831 false, /* isEliminatable. Not relevant for setters. */
31832 false, /* isAlwaysInSlot. Only relevant for getters. */
31833 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31834 false, /* isTypedMethod. Only relevant for methods. */
31835 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31836};
31837
31838MOZ_CAN_RUN_SCRIPT static bool
31839passSequenceOfUnions2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31840{
31841 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions2");
31842 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31845( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31843 "TestJSImplInterface", "passSequenceOfUnions2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31845( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31844 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31845( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31845 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31845( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31846
31847 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31848 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfUnions2", 1)) {
31849 return false;
31850 }
31851 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31852 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31853 if (objIsXray) {
31854 unwrappedObj.emplace(cx, obj);
31855 }
31856 binding_detail::AutoSequence<OwningObjectOrLong> arg0;
31857 SequenceRooter<OwningObjectOrLong> arg0_holder(cx, &arg0);
31858 if (args[0].isObject()) {
31859 JS::ForOfIterator iter(cx);
31860 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
31861 return false;
31862 }
31863 if (!iter.valueIsIterable()) {
31864 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31865 return false;
31866 }
31867 binding_detail::AutoSequence<OwningObjectOrLong> &arr = arg0;
31868 JS::Rooted<JS::Value> temp(cx);
31869 while (true) {
31870 bool done;
31871 if (!iter.next(&temp, &done)) {
31872 return false;
31873 }
31874 if (done) {
31875 break;
31876 }
31877 OwningObjectOrLong* slotPtr = arr.AppendElement(mozilla::fallible);
31878 if (!slotPtr) {
31879 JS_ReportOutOfMemory(cx);
31880 return false;
31881 }
31882 OwningObjectOrLong& slot = *slotPtr;
31883 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
31884 return false;
31885 }
31886 }
31887 } else {
31888 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31889 return false;
31890 }
31891 if (objIsXray) {
31892 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31893 // we know Xrays have no dynamic unwrap behavior.
31894 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31895 if (!unwrappedObj.ref()) {
31896 return false;
31897 }
31898 }
31899 FastErrorResult rv;
31900 // NOTE: This assert does NOT call the function.
31901 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");
31902 MOZ_KnownLive(self)(self)->PassSequenceOfUnions2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31903 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2"
)), 0))
) {
31904 return false;
31905 }
31906 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31906); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 31906); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31907 args.rval().setUndefined();
31908 return true;
31909}
31910
31911static const JSJitInfo passSequenceOfUnions2_methodinfo = {
31912 { (JSJitGetterOp)passSequenceOfUnions2 },
31913 { prototypes::id::TestJSImplInterface },
31914 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31915 JSJitInfo::Method,
31916 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31917 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31918 false, /* isInfallible. False in setters. */
31919 false, /* isMovable. Not relevant for setters. */
31920 false, /* isEliminatable. Not relevant for setters. */
31921 false, /* isAlwaysInSlot. Only relevant for getters. */
31922 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31923 false, /* isTypedMethod. Only relevant for methods. */
31924 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31925};
31926
31927MOZ_CAN_RUN_SCRIPT static bool
31928passVariadicUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31929{
31930 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicUnion");
31931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31934( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31932 "TestJSImplInterface", "passVariadicUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31934( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31934( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31934( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31935
31936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31939 if (objIsXray) {
31940 unwrappedObj.emplace(cx, obj);
31941 }
31942 AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0;
31943 if (args.length() > 0) {
31944 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
31945 JS_ReportOutOfMemory(cx);
31946 return false;
31947 }
31948 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
31949 // OK to do infallible append here, since we ensured capacity already.
31950 OwningCanvasPatternOrCanvasGradient& slot = *arg0.AppendElement();
31951 if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) {
31952 return false;
31953 }
31954 }
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)->PassVariadicUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31967 MOZ_KnownLive(self)(self)->PassVariadicUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31968 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion"
)), 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 { MOZ_CrashSequence
(__null, 31971); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
31972 args.rval().setUndefined();
31973 return true;
31974}
31975
31976static const JSJitInfo passVariadicUnion_methodinfo = {
31977 { (JSJitGetterOp)passVariadicUnion },
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
31993passSequenceOfNullableUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31994{
31995 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableUnions");
31996 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31997 "TestJSImplInterface", "passSequenceOfNullableUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", 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"
, "passSequenceOfNullableUnions", 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"
, "passSequenceOfNullableUnions", 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 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableUnions", 1)) {
32003 return false;
32004 }
32005 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32006 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32007 if (objIsXray) {
32008 unwrappedObj.emplace(cx, obj);
32009 }
32010 binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0;
32011 if (args[0].isObject()) {
32012 JS::ForOfIterator iter(cx);
32013 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
32014 return false;
32015 }
32016 if (!iter.valueIsIterable()) {
32017 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
32018 return false;
32019 }
32020 binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> &arr = arg0;
32021 JS::Rooted<JS::Value> temp(cx);
32022 while (true) {
32023 bool done;
32024 if (!iter.next(&temp, &done)) {
32025 return false;
32026 }
32027 if (done) {
32028 break;
32029 }
32030 Nullable<OwningCanvasPatternOrCanvasGradient >* slotPtr = arr.AppendElement(mozilla::fallible);
32031 if (!slotPtr) {
32032 JS_ReportOutOfMemory(cx);
32033 return false;
32034 }
32035 Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *slotPtr;
32036 if (temp.isNullOrUndefined()) {
32037 slot.SetNull();
32038 } else {
32039 if (!slot.SetValue().Init(cx, temp, "Element of argument 1", true)) {
32040 return false;
32041 }
32042 }
32043 }
32044 } else {
32045 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
32046 return false;
32047 }
32048 if (objIsXray) {
32049 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32050 // we know Xrays have no dynamic unwrap behavior.
32051 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32052 if (!unwrappedObj.ref()) {
32053 return false;
32054 }
32055 }
32056 FastErrorResult rv;
32057 // NOTE: This assert does NOT call the function.
32058 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");
32059 MOZ_KnownLive(self)(self)->PassSequenceOfNullableUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32060 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions"
)), 0))
) {
32061 return false;
32062 }
32063 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32063); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32063); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32064 args.rval().setUndefined();
32065 return true;
32066}
32067
32068static const JSJitInfo passSequenceOfNullableUnions_methodinfo = {
32069 { (JSJitGetterOp)passSequenceOfNullableUnions },
32070 { prototypes::id::TestJSImplInterface },
32071 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32072 JSJitInfo::Method,
32073 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32074 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32075 false, /* isInfallible. False in setters. */
32076 false, /* isMovable. Not relevant for setters. */
32077 false, /* isEliminatable. Not relevant for setters. */
32078 false, /* isAlwaysInSlot. Only relevant for getters. */
32079 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32080 false, /* isTypedMethod. Only relevant for methods. */
32081 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32082};
32083
32084MOZ_CAN_RUN_SCRIPT static bool
32085passVariadicNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32086{
32087 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableUnion");
32088 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32091( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32089 "TestJSImplInterface", "passVariadicNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32091( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32090 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32091( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32091 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32091( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32092
32093 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32094 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32095 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32096 if (objIsXray) {
32097 unwrappedObj.emplace(cx, obj);
32098 }
32099 AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0;
32100 if (args.length() > 0) {
32101 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
32102 JS_ReportOutOfMemory(cx);
32103 return false;
32104 }
32105 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
32106 // OK to do infallible append here, since we ensured capacity already.
32107 Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *arg0.AppendElement();
32108 if (args[variadicArg].isNullOrUndefined()) {
32109 slot.SetNull();
32110 } else {
32111 if (!slot.SetValue().Init(cx, args[variadicArg], "Argument 1", true)) {
32112 return false;
32113 }
32114 }
32115 }
32116 }
32117 if (objIsXray) {
32118 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32119 // we know Xrays have no dynamic unwrap behavior.
32120 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32121 if (!unwrappedObj.ref()) {
32122 return false;
32123 }
32124 }
32125 FastErrorResult rv;
32126 // NOTE: This assert does NOT call the function.
32127 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");
32128 MOZ_KnownLive(self)(self)->PassVariadicNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32129 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion"
)), 0))
) {
32130 return false;
32131 }
32132 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32132); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32132); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32133 args.rval().setUndefined();
32134 return true;
32135}
32136
32137static const JSJitInfo passVariadicNullableUnion_methodinfo = {
32138 { (JSJitGetterOp)passVariadicNullableUnion },
32139 { prototypes::id::TestJSImplInterface },
32140 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32141 JSJitInfo::Method,
32142 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32143 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32144 false, /* isInfallible. False in setters. */
32145 false, /* isMovable. Not relevant for setters. */
32146 false, /* isEliminatable. Not relevant for setters. */
32147 false, /* isAlwaysInSlot. Only relevant for getters. */
32148 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32149 false, /* isTypedMethod. Only relevant for methods. */
32150 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32151};
32152
32153MOZ_CAN_RUN_SCRIPT static bool
32154passRecordOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32155{
32156 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfUnions");
32157 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32160( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32158 "TestJSImplInterface", "passRecordOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32160( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32159 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32160( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32160 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32160( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32161
32162 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32163 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfUnions", 1)) {
32164 return false;
32165 }
32166 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32167 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32168 if (objIsXray) {
32169 unwrappedObj.emplace(cx, obj);
32170 }
32171 Record<nsString, OwningCanvasPatternOrCanvasGradient> arg0;
32172 if (args[0].isObject()) {
32173 auto& recordEntries = arg0.Entries();
32174
32175 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
32176 JS::RootedVector<jsid> ids(cx);
32177 if (!js::GetPropertyKeys(cx, recordObj,
32178 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
32179 return false;
32180 }
32181 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
32182 JS_ReportOutOfMemory(cx);
32183 return false;
32184 }
32185 JS::Rooted<JS::Value> propNameValue(cx);
32186 JS::Rooted<JS::Value> temp(cx);
32187 JS::Rooted<jsid> curId(cx);
32188 JS::Rooted<JS::Value> idVal(cx);
32189 // Use a hashset to keep track of ids seen, to avoid
32190 // introducing nasty O(N^2) behavior scanning for them all the
32191 // time. Ideally we'd use a data structure with O(1) lookup
32192 // _and_ ordering for the MozMap, but we don't have one lying
32193 // around.
32194 nsTHashtable<nsStringHashKey> idsSeen;
32195 for (size_t i = 0; i < ids.length(); ++i) {
32196 curId = ids[i];
32197
32198 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
32199 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
32200 &desc)) {
32201 return false;
32202 }
32203
32204 if (desc.isNothing() || !desc->enumerable()) {
32205 continue;
32206 }
32207
32208 idVal = js::IdToValue(curId);
32209 nsString propName;
32210 // This will just throw if idVal is a Symbol, like the spec says
32211 // to do.
32212 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
32213 return false;
32214 }
32215
32216 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
32217 return false;
32218 }
32219
32220 Record<nsString, OwningCanvasPatternOrCanvasGradient>::EntryType* entry;
32221 if (!idsSeen.EnsureInserted(propName)) {
32222 // Find the existing entry.
32223 auto idx = recordEntries.IndexOf(propName);
32224 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", 32225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 32225); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
32225 "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", 32225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 32225); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
32226 // Now blow it away to make it look like it was just added
32227 // to the array, because it's not obvious that it's
32228 // safe to write to its already-initialized mValue via our
32229 // normal codegen conversions. For example, the value
32230 // could be a union and this would change its type, but
32231 // codegen assumes we won't do that.
32232 entry = recordEntries.ReconstructElementAt(idx);
32233 } else {
32234 // Safe to do an infallible append here, because we did a
32235 // SetCapacity above to the right capacity.
32236 entry = recordEntries.AppendElement();
32237 }
32238 entry->mKey = propName;
32239 OwningCanvasPatternOrCanvasGradient& slot = entry->mValue;
32240 if (!slot.Init(cx, temp, "Value in argument 1", true)) {
32241 return false;
32242 }
32243 }
32244 } else {
32245 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
32246 return false;
32247 }
32248 if (objIsXray) {
32249 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32250 // we know Xrays have no dynamic unwrap behavior.
32251 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32252 if (!unwrappedObj.ref()) {
32253 return false;
32254 }
32255 }
32256 FastErrorResult rv;
32257 // NOTE: This assert does NOT call the function.
32258 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");
32259 MOZ_KnownLive(self)(self)->PassRecordOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32260 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions"
)), 0))
) {
32261 return false;
32262 }
32263 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32263); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32264 args.rval().setUndefined();
32265 return true;
32266}
32267
32268static const JSJitInfo passRecordOfUnions_methodinfo = {
32269 { (JSJitGetterOp)passRecordOfUnions },
32270 { prototypes::id::TestJSImplInterface },
32271 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32272 JSJitInfo::Method,
32273 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32274 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32275 false, /* isInfallible. False in setters. */
32276 false, /* isMovable. Not relevant for setters. */
32277 false, /* isEliminatable. Not relevant for setters. */
32278 false, /* isAlwaysInSlot. Only relevant for getters. */
32279 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32280 false, /* isTypedMethod. Only relevant for methods. */
32281 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32282};
32283
32284MOZ_CAN_RUN_SCRIPT static bool
32285receiveUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32286{
32287 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32290( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32288 "TestJSImplInterface", "receiveUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32290( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32289 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32290( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32290 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32290( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32291
32292 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32293 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32294 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32295 if (objIsXray) {
32296 unwrappedObj.emplace(cx, obj);
32297 }
32298 if (objIsXray) {
32299 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32300 // we know Xrays have no dynamic unwrap behavior.
32301 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32302 if (!unwrappedObj.ref()) {
32303 return false;
32304 }
32305 }
32306 FastErrorResult rv;
32307 OwningCanvasPatternOrCanvasGradient result;
32308 // NOTE: This assert does NOT call the function.
32309 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");
32310 MOZ_KnownLive(self)(self)->ReceiveUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32311 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion"
)), 0))
) {
32312 return false;
32313 }
32314 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32314); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32314); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32315 if (!result.ToJSVal(cx, obj, args.rval())) {
32316 return false;
32317 }
32318 return true;
32319}
32320
32321static const JSJitInfo receiveUnion_methodinfo = {
32322 { (JSJitGetterOp)receiveUnion },
32323 { prototypes::id::TestJSImplInterface },
32324 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32325 JSJitInfo::Method,
32326 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32327 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
32328 false, /* isInfallible. False in setters. */
32329 false, /* isMovable. Not relevant for setters. */
32330 false, /* isEliminatable. Not relevant for setters. */
32331 false, /* isAlwaysInSlot. Only relevant for getters. */
32332 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32333 false, /* isTypedMethod. Only relevant for methods. */
32334 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32335};
32336
32337MOZ_CAN_RUN_SCRIPT static bool
32338receiveUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32339{
32340 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32343( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32341 "TestJSImplInterface", "receiveUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32343( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32342 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32343( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32343 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32343( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32344
32345 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32346 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32347 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32348 if (objIsXray) {
32349 unwrappedObj.emplace(cx, obj);
32350 }
32351 if (objIsXray) {
32352 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32353 // we know Xrays have no dynamic unwrap behavior.
32354 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32355 if (!unwrappedObj.ref()) {
32356 return false;
32357 }
32358 }
32359 FastErrorResult rv;
32360 RootedUnion<OwningObjectOrLong> result(cx);
32361 // NOTE: This assert does NOT call the function.
32362 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");
32363 MOZ_KnownLive(self)(self)->ReceiveUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32364 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2"
)), 0))
) {
32365 return false;
32366 }
32367 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32367); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32368 if (!result.ToJSVal(cx, obj, args.rval())) {
32369 return false;
32370 }
32371 return true;
32372}
32373
32374static const JSJitInfo receiveUnion2_methodinfo = {
32375 { (JSJitGetterOp)receiveUnion2 },
32376 { prototypes::id::TestJSImplInterface },
32377 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32378 JSJitInfo::Method,
32379 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32380 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32381 false, /* isInfallible. False in setters. */
32382 false, /* isMovable. Not relevant for setters. */
32383 false, /* isEliminatable. Not relevant for setters. */
32384 false, /* isAlwaysInSlot. Only relevant for getters. */
32385 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32386 false, /* isTypedMethod. Only relevant for methods. */
32387 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32388};
32389
32390MOZ_CAN_RUN_SCRIPT static bool
32391receiveUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32392{
32393 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32396( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32394 "TestJSImplInterface", "receiveUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32396( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32395 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32396( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32396 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32396( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32397
32398 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32399 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32400 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32401 if (objIsXray) {
32402 unwrappedObj.emplace(cx, obj);
32403 }
32404 if (objIsXray) {
32405 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32406 // we know Xrays have no dynamic unwrap behavior.
32407 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32408 if (!unwrappedObj.ref()) {
32409 return false;
32410 }
32411 }
32412 FastErrorResult rv;
32413 OwningCanvasPatternOrNullOrCanvasGradient result;
32414 // NOTE: This assert does NOT call the function.
32415 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");
32416 MOZ_KnownLive(self)(self)->ReceiveUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32417 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull"
)), 0))
) {
32418 return false;
32419 }
32420 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32420); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32420); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32421 if (!result.ToJSVal(cx, obj, args.rval())) {
32422 return false;
32423 }
32424 return true;
32425}
32426
32427static const JSJitInfo receiveUnionContainingNull_methodinfo = {
32428 { (JSJitGetterOp)receiveUnionContainingNull },
32429 { prototypes::id::TestJSImplInterface },
32430 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32431 JSJitInfo::Method,
32432 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32433 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32434 false, /* isInfallible. False in setters. */
32435 false, /* isMovable. Not relevant for setters. */
32436 false, /* isEliminatable. Not relevant for setters. */
32437 false, /* isAlwaysInSlot. Only relevant for getters. */
32438 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32439 false, /* isTypedMethod. Only relevant for methods. */
32440 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32441};
32442
32443MOZ_CAN_RUN_SCRIPT static bool
32444receiveNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32445{
32446 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32449( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32447 "TestJSImplInterface", "receiveNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32449( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32448 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32449( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32449 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32449( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32450
32451 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32452 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32453 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32454 if (objIsXray) {
32455 unwrappedObj.emplace(cx, obj);
32456 }
32457 if (objIsXray) {
32458 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32459 // we know Xrays have no dynamic unwrap behavior.
32460 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32461 if (!unwrappedObj.ref()) {
32462 return false;
32463 }
32464 }
32465 FastErrorResult rv;
32466 Nullable<OwningCanvasPatternOrCanvasGradient> result;
32467 // NOTE: This assert does NOT call the function.
32468 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");
32469 MOZ_KnownLive(self)(self)->ReceiveNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion"
)), 0))
) {
32471 return false;
32472 }
32473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32473); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32474 if (result.IsNull()) {
32475 args.rval().setNull();
32476 return true;
32477 }
32478 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32479 return false;
32480 }
32481 return true;
32482}
32483
32484static const JSJitInfo receiveNullableUnion_methodinfo = {
32485 { (JSJitGetterOp)receiveNullableUnion },
32486 { prototypes::id::TestJSImplInterface },
32487 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32488 JSJitInfo::Method,
32489 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32490 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32491 false, /* isInfallible. False in setters. */
32492 false, /* isMovable. Not relevant for setters. */
32493 false, /* isEliminatable. Not relevant for setters. */
32494 false, /* isAlwaysInSlot. Only relevant for getters. */
32495 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32496 false, /* isTypedMethod. Only relevant for methods. */
32497 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32498};
32499
32500MOZ_CAN_RUN_SCRIPT static bool
32501receiveNullableUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32502{
32503 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32506( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32504 "TestJSImplInterface", "receiveNullableUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32506( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32505 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32506( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32506 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32506( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32507
32508 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32509 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32510 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32511 if (objIsXray) {
32512 unwrappedObj.emplace(cx, obj);
32513 }
32514 if (objIsXray) {
32515 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32516 // we know Xrays have no dynamic unwrap behavior.
32517 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32518 if (!unwrappedObj.ref()) {
32519 return false;
32520 }
32521 }
32522 FastErrorResult rv;
32523 NullableRootedUnion<OwningObjectOrLong> result(cx);
32524 // NOTE: This assert does NOT call the function.
32525 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");
32526 MOZ_KnownLive(self)(self)->ReceiveNullableUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32527 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2"
)), 0))
) {
32528 return false;
32529 }
32530 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32530); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32530); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32531 if (result.IsNull()) {
32532 args.rval().setNull();
32533 return true;
32534 }
32535 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32536 return false;
32537 }
32538 return true;
32539}
32540
32541static const JSJitInfo receiveNullableUnion2_methodinfo = {
32542 { (JSJitGetterOp)receiveNullableUnion2 },
32543 { prototypes::id::TestJSImplInterface },
32544 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32545 JSJitInfo::Method,
32546 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32547 JSVAL_TYPE_UNKNOWN, /* 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};
32556
32557MOZ_CAN_RUN_SCRIPT static bool
32558get_writableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32559{
32560 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32563( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32561 "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32563( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32562 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32563( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32563 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32563( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32564
32565 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32566 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32567 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32568 if (objIsXray) {
32569 unwrappedObj.emplace(cx, obj);
32570 }
32571 if (objIsXray) {
32572 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32573 // we know Xrays have no dynamic unwrap behavior.
32574 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32575 if (!unwrappedObj.ref()) {
32576 return false;
32577 }
32578 }
32579 FastErrorResult rv;
32580 OwningCanvasPatternOrCanvasGradient result;
32581 // NOTE: This assert does NOT call the function.
32582 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");
32583 MOZ_KnownLive(self)(self)->GetWritableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32584 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter"
)), 0))
) {
32585 return false;
32586 }
32587 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32587); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32587); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32588 if (!result.ToJSVal(cx, obj, args.rval())) {
32589 return false;
32590 }
32591 return true;
32592}
32593
32594MOZ_CAN_RUN_SCRIPT static bool
32595set_writableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32596{
32597 BindingCallContext cx(cx_, "TestJSImplInterface.writableUnion setter");
32598 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32601( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32599 "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32601( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32600 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32601( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32601 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32601( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32602
32603 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32604 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32605 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32606 if (objIsXray) {
32607 unwrappedObj.emplace(cx, obj);
32608 }
32609 CanvasPatternOrCanvasGradient arg0;
32610 if (!arg0.Init(cx, args[0], "Value being assigned", true)) {
32611 return false;
32612 }
32613 if (objIsXray) {
32614 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32615 // we know Xrays have no dynamic unwrap behavior.
32616 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32617 if (!unwrappedObj.ref()) {
32618 return false;
32619 }
32620 }
32621 FastErrorResult rv;
32622 // NOTE: This assert does NOT call the function.
32623 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");
32624 MOZ_KnownLive(self)(self)->SetWritableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32625 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter"
)), 0))
) {
32626 return false;
32627 }
32628 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32628); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32628); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32629
32630 return true;
32631}
32632
32633static const JSJitInfo writableUnion_getterinfo = {
32634 { get_writableUnion },
32635 { prototypes::id::TestJSImplInterface },
32636 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32637 JSJitInfo::Getter,
32638 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32639 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
32640 false, /* isInfallible. False in setters. */
32641 false, /* isMovable. Not relevant for setters. */
32642 false, /* isEliminatable. Not relevant for setters. */
32643 false, /* isAlwaysInSlot. Only relevant for getters. */
32644 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32645 false, /* isTypedMethod. Only relevant for methods. */
32646 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32647};
32648static const JSJitInfo writableUnion_setterinfo = {
32649 { (JSJitGetterOp)set_writableUnion },
32650 { prototypes::id::TestJSImplInterface },
32651 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32652 JSJitInfo::Setter,
32653 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32654 JSVAL_TYPE_UNDEFINED, /* 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};
32663
32664MOZ_CAN_RUN_SCRIPT static bool
32665get_writableUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32666{
32667 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32670( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32668 "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32670( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32669 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32670( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32670 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32670( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32671
32672 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32673 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32674 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32675 if (objIsXray) {
32676 unwrappedObj.emplace(cx, obj);
32677 }
32678 if (objIsXray) {
32679 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32680 // we know Xrays have no dynamic unwrap behavior.
32681 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32682 if (!unwrappedObj.ref()) {
32683 return false;
32684 }
32685 }
32686 FastErrorResult rv;
32687 OwningCanvasPatternOrNullOrCanvasGradient result;
32688 // NOTE: This assert does NOT call the function.
32689 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");
32690 MOZ_KnownLive(self)(self)->GetWritableUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32691 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter"
)), 0))
) {
32692 return false;
32693 }
32694 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32694); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32695 if (!result.ToJSVal(cx, obj, args.rval())) {
32696 return false;
32697 }
32698 return true;
32699}
32700
32701MOZ_CAN_RUN_SCRIPT static bool
32702set_writableUnionContainingNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32703{
32704 BindingCallContext cx(cx_, "TestJSImplInterface.writableUnionContainingNull setter");
32705 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32708( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32706 "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32708( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32707 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32708( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32708 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32708( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32709
32710 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32711 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32712 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32713 if (objIsXray) {
32714 unwrappedObj.emplace(cx, obj);
32715 }
32716 CanvasPatternOrNullOrCanvasGradient arg0;
32717 if (!arg0.Init(cx, args[0], "Value being assigned", true)) {
32718 return false;
32719 }
32720 if (objIsXray) {
32721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32722 // we know Xrays have no dynamic unwrap behavior.
32723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32724 if (!unwrappedObj.ref()) {
32725 return false;
32726 }
32727 }
32728 FastErrorResult rv;
32729 // NOTE: This assert does NOT call the function.
32730 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");
32731 MOZ_KnownLive(self)(self)->SetWritableUnionContainingNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32732 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter"
)), 0))
) {
32733 return false;
32734 }
32735 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32735); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32736
32737 return true;
32738}
32739
32740static const JSJitInfo writableUnionContainingNull_getterinfo = {
32741 { get_writableUnionContainingNull },
32742 { prototypes::id::TestJSImplInterface },
32743 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32744 JSJitInfo::Getter,
32745 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32746 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32747 false, /* isInfallible. False in setters. */
32748 false, /* isMovable. Not relevant for setters. */
32749 false, /* isEliminatable. Not relevant for setters. */
32750 false, /* isAlwaysInSlot. Only relevant for getters. */
32751 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32752 false, /* isTypedMethod. Only relevant for methods. */
32753 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32754};
32755static const JSJitInfo writableUnionContainingNull_setterinfo = {
32756 { (JSJitGetterOp)set_writableUnionContainingNull },
32757 { prototypes::id::TestJSImplInterface },
32758 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32759 JSJitInfo::Setter,
32760 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32761 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32762 false, /* isInfallible. False in setters. */
32763 false, /* isMovable. Not relevant for setters. */
32764 false, /* isEliminatable. Not relevant for setters. */
32765 false, /* isAlwaysInSlot. Only relevant for getters. */
32766 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32767 false, /* isTypedMethod. Only relevant for methods. */
32768 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32769};
32770
32771MOZ_CAN_RUN_SCRIPT static bool
32772get_writableNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32773{
32774 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32777( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32775 "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32777( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32776 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32777( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32777 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32777( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32778
32779 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32780 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32781 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32782 if (objIsXray) {
32783 unwrappedObj.emplace(cx, obj);
32784 }
32785 if (objIsXray) {
32786 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32787 // we know Xrays have no dynamic unwrap behavior.
32788 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32789 if (!unwrappedObj.ref()) {
32790 return false;
32791 }
32792 }
32793 FastErrorResult rv;
32794 Nullable<OwningCanvasPatternOrCanvasGradient> result;
32795 // NOTE: This assert does NOT call the function.
32796 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");
32797 MOZ_KnownLive(self)(self)->GetWritableNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32798 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter"
)), 0))
) {
32799 return false;
32800 }
32801 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32801); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32801); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32802 if (result.IsNull()) {
32803 args.rval().setNull();
32804 return true;
32805 }
32806 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32807 return false;
32808 }
32809 return true;
32810}
32811
32812MOZ_CAN_RUN_SCRIPT static bool
32813set_writableNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32814{
32815 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableUnion setter");
32816 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32819( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32817 "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32819( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32818 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32819( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32819 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32819( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32820
32821 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32822 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32823 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32824 if (objIsXray) {
32825 unwrappedObj.emplace(cx, obj);
32826 }
32827 Nullable<CanvasPatternOrCanvasGradient > arg0;
32828 if (args[0].isNullOrUndefined()) {
32829 arg0.SetNull();
32830 } else {
32831 if (!arg0.SetValue().Init(cx, args[0], "Value being assigned", true)) {
32832 return false;
32833 }
32834 }
32835 if (objIsXray) {
32836 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32837 // we know Xrays have no dynamic unwrap behavior.
32838 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32839 if (!unwrappedObj.ref()) {
32840 return false;
32841 }
32842 }
32843 FastErrorResult rv;
32844 // NOTE: This assert does NOT call the function.
32845 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");
32846 MOZ_KnownLive(self)(self)->SetWritableNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32847 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter"
)), 0))
) {
32848 return false;
32849 }
32850 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32850); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32850); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32851
32852 return true;
32853}
32854
32855static const JSJitInfo writableNullableUnion_getterinfo = {
32856 { get_writableNullableUnion },
32857 { prototypes::id::TestJSImplInterface },
32858 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32859 JSJitInfo::Getter,
32860 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32861 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32862 false, /* isInfallible. False in setters. */
32863 false, /* isMovable. Not relevant for setters. */
32864 false, /* isEliminatable. Not relevant for setters. */
32865 false, /* isAlwaysInSlot. Only relevant for getters. */
32866 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32867 false, /* isTypedMethod. Only relevant for methods. */
32868 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32869};
32870static const JSJitInfo writableNullableUnion_setterinfo = {
32871 { (JSJitGetterOp)set_writableNullableUnion },
32872 { prototypes::id::TestJSImplInterface },
32873 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32874 JSJitInfo::Setter,
32875 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32876 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32877 false, /* isInfallible. False in setters. */
32878 false, /* isMovable. Not relevant for setters. */
32879 false, /* isEliminatable. Not relevant for setters. */
32880 false, /* isAlwaysInSlot. Only relevant for getters. */
32881 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32882 false, /* isTypedMethod. Only relevant for methods. */
32883 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32884};
32885
32886MOZ_CAN_RUN_SCRIPT static bool
32887passPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32888{
32889 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32892( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32890 "TestJSImplInterface", "passPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32892( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32891 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32892( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32892 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32892( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32893
32894 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32895 if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromise", 1)) {
32896 return false;
32897 }
32898 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32899 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32900 if (objIsXray) {
32901 unwrappedObj.emplace(cx, obj);
32902 }
32903 OwningNonNull<Promise> arg0;
32904 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
32905 // etc.
32906
32907 JS::Rooted<JSObject*> globalObj(cx);
32908 globalObj = JS::CurrentGlobalOrNull(cx);
32909 JSAutoRealm ar(cx, globalObj);
32910 GlobalObject promiseGlobal(cx, globalObj);
32911 if (promiseGlobal.Failed()) {
32912 return false;
32913 }
32914
32915 JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
32916 if (!JS_WrapValue(cx, &valueToResolve)) {
32917 return false;
32918 }
32919 binding_detail::FastErrorResult promiseRv;
32920 nsCOMPtr<nsIGlobalObject> global =
32921 do_QueryInterface(promiseGlobal.GetAsSupports());
32922 if (!global) {
32923 promiseRv.Throw(NS_ERROR_UNEXPECTED);
32924 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { do { } while (false); MOZ_ReportCrash
("" "promiseRv.MaybeSetPendingException(cx)", "../TestJSImplGenBinding.cpp"
, 32924); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)"
")"); do { MOZ_CrashSequence(__null, 32924); __attribute__((
nomerge)) ::abort(); } while (false); } while (false); } } while
(false)
;
32925 return false;
32926 }
32927 arg0 = Promise::Resolve(global, cx, valueToResolve,
32928 promiseRv);
32929 if (promiseRv.MaybeSetPendingException(cx)) {
32930 return false;
32931 }
32932 }
32933 if (objIsXray) {
32934 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32935 // we know Xrays have no dynamic unwrap behavior.
32936 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32937 if (!unwrappedObj.ref()) {
32938 return false;
32939 }
32940 }
32941 FastErrorResult rv;
32942 // NOTE: This assert does NOT call the function.
32943 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");
32944 MOZ_KnownLive(self)(self)->PassPromise(NonNullHelper(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32945 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise"
)), 0))
) {
32946 return false;
32947 }
32948 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32948); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 32948); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
32949 args.rval().setUndefined();
32950 return true;
32951}
32952
32953static const JSJitInfo passPromise_methodinfo = {
32954 { (JSJitGetterOp)passPromise },
32955 { prototypes::id::TestJSImplInterface },
32956 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32957 JSJitInfo::Method,
32958 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32959 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32960 false, /* isInfallible. False in setters. */
32961 false, /* isMovable. Not relevant for setters. */
32962 false, /* isEliminatable. Not relevant for setters. */
32963 false, /* isAlwaysInSlot. Only relevant for getters. */
32964 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32965 false, /* isTypedMethod. Only relevant for methods. */
32966 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32967};
32968
32969MOZ_CAN_RUN_SCRIPT static bool
32970passOptionalPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32971{
32972 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32975( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32973 "TestJSImplInterface", "passOptionalPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32975( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32974 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32975( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32975 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32975( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32976
32977 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32978 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32979 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32980 if (objIsXray) {
32981 unwrappedObj.emplace(cx, obj);
32982 }
32983 Optional<OwningNonNull<Promise>> arg0;
32984 if (args.hasDefined(0)) {
32985 arg0.Construct();
32986 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
32987 // etc.
32988
32989 JS::Rooted<JSObject*> globalObj(cx);
32990 globalObj = JS::CurrentGlobalOrNull(cx);
32991 JSAutoRealm ar(cx, globalObj);
32992 GlobalObject promiseGlobal(cx, globalObj);
32993 if (promiseGlobal.Failed()) {
32994 return false;
32995 }
32996
32997 JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
32998 if (!JS_WrapValue(cx, &valueToResolve)) {
32999 return false;
33000 }
33001 binding_detail::FastErrorResult promiseRv;
33002 nsCOMPtr<nsIGlobalObject> global =
33003 do_QueryInterface(promiseGlobal.GetAsSupports());
33004 if (!global) {
33005 promiseRv.Throw(NS_ERROR_UNEXPECTED);
33006 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { do { } while (false); MOZ_ReportCrash
("" "promiseRv.MaybeSetPendingException(cx)", "../TestJSImplGenBinding.cpp"
, 33006); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)"
")"); do { MOZ_CrashSequence(__null, 33006); __attribute__((
nomerge)) ::abort(); } while (false); } while (false); } } while
(false)
;
33007 return false;
33008 }
33009 arg0.Value() = Promise::Resolve(global, cx, valueToResolve,
33010 promiseRv);
33011 if (promiseRv.MaybeSetPendingException(cx)) {
33012 return false;
33013 }
33014 }
33015 }
33016 if (objIsXray) {
33017 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33018 // we know Xrays have no dynamic unwrap behavior.
33019 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33020 if (!unwrappedObj.ref()) {
33021 return false;
33022 }
33023 }
33024 FastErrorResult rv;
33025 // NOTE: This assert does NOT call the function.
33026 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");
33027 MOZ_KnownLive(self)(self)->PassOptionalPromise(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33028 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise"
)), 0))
) {
33029 return false;
33030 }
33031 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33031); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33032 args.rval().setUndefined();
33033 return true;
33034}
33035
33036static const JSJitInfo passOptionalPromise_methodinfo = {
33037 { (JSJitGetterOp)passOptionalPromise },
33038 { prototypes::id::TestJSImplInterface },
33039 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33040 JSJitInfo::Method,
33041 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33042 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33043 false, /* isInfallible. False in setters. */
33044 false, /* isMovable. Not relevant for setters. */
33045 false, /* isEliminatable. Not relevant for setters. */
33046 false, /* isAlwaysInSlot. Only relevant for getters. */
33047 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33048 false, /* isTypedMethod. Only relevant for methods. */
33049 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33050};
33051
33052MOZ_CAN_RUN_SCRIPT static bool
33053passPromiseSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33054{
33055 BindingCallContext cx(cx_, "TestJSImplInterface.passPromiseSequence");
33056 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33059( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33057 "TestJSImplInterface", "passPromiseSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33059( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33058 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33059( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33059 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33059( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33060
33061 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33062 if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromiseSequence", 1)) {
33063 return false;
33064 }
33065 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33066 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33067 if (objIsXray) {
33068 unwrappedObj.emplace(cx, obj);
33069 }
33070 binding_detail::AutoSequence<OwningNonNull<Promise>> arg0;
33071 if (args[0].isObject()) {
33072 JS::ForOfIterator iter(cx);
33073 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
33074 return false;
33075 }
33076 if (!iter.valueIsIterable()) {
33077 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33078 return false;
33079 }
33080 binding_detail::AutoSequence<OwningNonNull<Promise>> &arr = arg0;
33081 JS::Rooted<JS::Value> temp(cx);
33082 while (true) {
33083 bool done;
33084 if (!iter.next(&temp, &done)) {
33085 return false;
33086 }
33087 if (done) {
33088 break;
33089 }
33090 OwningNonNull<Promise>* slotPtr = arr.AppendElement(mozilla::fallible);
33091 if (!slotPtr) {
33092 JS_ReportOutOfMemory(cx);
33093 return false;
33094 }
33095 OwningNonNull<Promise>& slot = *slotPtr;
33096 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
33097 // etc.
33098
33099 JS::Rooted<JSObject*> globalObj(cx);
33100 globalObj = JS::CurrentGlobalOrNull(cx);
33101 JSAutoRealm ar(cx, globalObj);
33102 GlobalObject promiseGlobal(cx, globalObj);
33103 if (promiseGlobal.Failed()) {
33104 return false;
33105 }
33106
33107 JS::Rooted<JS::Value> valueToResolve(cx, temp);
33108 if (!JS_WrapValue(cx, &valueToResolve)) {
33109 return false;
33110 }
33111 binding_detail::FastErrorResult promiseRv;
33112 nsCOMPtr<nsIGlobalObject> global =
33113 do_QueryInterface(promiseGlobal.GetAsSupports());
33114 if (!global) {
33115 promiseRv.Throw(NS_ERROR_UNEXPECTED);
33116 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { do { } while (false); MOZ_ReportCrash
("" "promiseRv.MaybeSetPendingException(cx)", "../TestJSImplGenBinding.cpp"
, 33116); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)"
")"); do { MOZ_CrashSequence(__null, 33116); __attribute__((
nomerge)) ::abort(); } while (false); } while (false); } } while
(false)
;
33117 return false;
33118 }
33119 slot = Promise::Resolve(global, cx, valueToResolve,
33120 promiseRv);
33121 if (promiseRv.MaybeSetPendingException(cx)) {
33122 return false;
33123 }
33124 }
33125 }
33126 } else {
33127 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33128 return false;
33129 }
33130 if (objIsXray) {
33131 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33132 // we know Xrays have no dynamic unwrap behavior.
33133 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33134 if (!unwrappedObj.ref()) {
33135 return false;
33136 }
33137 }
33138 FastErrorResult rv;
33139 // NOTE: This assert does NOT call the function.
33140 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");
33141 MOZ_KnownLive(self)(self)->PassPromiseSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33142 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence"
)), 0))
) {
33143 return false;
33144 }
33145 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33145); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33145); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33146 args.rval().setUndefined();
33147 return true;
33148}
33149
33150static const JSJitInfo passPromiseSequence_methodinfo = {
33151 { (JSJitGetterOp)passPromiseSequence },
33152 { prototypes::id::TestJSImplInterface },
33153 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33154 JSJitInfo::Method,
33155 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33156 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33157 false, /* isInfallible. False in setters. */
33158 false, /* isMovable. Not relevant for setters. */
33159 false, /* isEliminatable. Not relevant for setters. */
33160 false, /* isAlwaysInSlot. Only relevant for getters. */
33161 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33162 false, /* isTypedMethod. Only relevant for methods. */
33163 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33164};
33165
33166MOZ_CAN_RUN_SCRIPT static bool
33167receivePromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33168{
33169 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33172( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33170 "TestJSImplInterface", "receivePromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33172( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33171 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33172( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33172 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33172( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33173
33174 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33175 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33176 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33177 if (objIsXray) {
33178 unwrappedObj.emplace(cx, obj);
33179 }
33180 if (objIsXray) {
33181 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33182 // we know Xrays have no dynamic unwrap behavior.
33183 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33184 if (!unwrappedObj.ref()) {
33185 return false;
33186 }
33187 }
33188 FastErrorResult rv;
33189 auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceivePromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
33190 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise"
)), 0))
) {
33191 return false;
33192 }
33193 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33193); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33193); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33194 if (!ToJSValue(cx, result, args.rval())) {
33195 return false;
33196 }
33197 return true;
33198}
33199
33200MOZ_CAN_RUN_SCRIPT static bool
33201receivePromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33202{
33203 bool ok = receivePromise(cx, obj, void_self, args);
33204 if (ok) {
33205 return true;
33206 }
33207 return ConvertExceptionToPromise(cx, args.rval());
33208}
33209
33210static const JSJitInfo receivePromise_methodinfo = {
33211 { (JSJitGetterOp)receivePromise_promiseWrapper },
33212 { prototypes::id::TestJSImplInterface },
33213 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33214 JSJitInfo::Method,
33215 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33216 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33217 false, /* isInfallible. False in setters. */
33218 false, /* isMovable. Not relevant for setters. */
33219 false, /* isEliminatable. Not relevant for setters. */
33220 false, /* isAlwaysInSlot. Only relevant for getters. */
33221 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33222 false, /* isTypedMethod. Only relevant for methods. */
33223 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33224};
33225
33226MOZ_CAN_RUN_SCRIPT static bool
33227receiveAddrefedPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33228{
33229 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33232( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33230 "TestJSImplInterface", "receiveAddrefedPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33232( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33231 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33232( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33232 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33232( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33233
33234 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33235 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33236 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33237 if (objIsXray) {
33238 unwrappedObj.emplace(cx, obj);
33239 }
33240 if (objIsXray) {
33241 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33242 // we know Xrays have no dynamic unwrap behavior.
33243 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33244 if (!unwrappedObj.ref()) {
33245 return false;
33246 }
33247 }
33248 FastErrorResult rv;
33249 auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceiveAddrefedPromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
33250 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise"
)), 0))
) {
33251 return false;
33252 }
33253 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33253); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33254 if (!ToJSValue(cx, result, args.rval())) {
33255 return false;
33256 }
33257 return true;
33258}
33259
33260MOZ_CAN_RUN_SCRIPT static bool
33261receiveAddrefedPromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33262{
33263 bool ok = receiveAddrefedPromise(cx, obj, void_self, args);
33264 if (ok) {
33265 return true;
33266 }
33267 return ConvertExceptionToPromise(cx, args.rval());
33268}
33269
33270static const JSJitInfo receiveAddrefedPromise_methodinfo = {
33271 { (JSJitGetterOp)receiveAddrefedPromise_promiseWrapper },
33272 { prototypes::id::TestJSImplInterface },
33273 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33274 JSJitInfo::Method,
33275 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33276 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33277 false, /* isInfallible. False in setters. */
33278 false, /* isMovable. Not relevant for setters. */
33279 false, /* isEliminatable. Not relevant for setters. */
33280 false, /* isAlwaysInSlot. Only relevant for getters. */
33281 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33282 false, /* isTypedMethod. Only relevant for methods. */
33283 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33284};
33285
33286MOZ_CAN_RUN_SCRIPT static bool
33287methodRenamedFrom(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33288{
33289 BindingCallContext cx(cx_, "TestJSImplInterface.methodRenamedFrom");
33290 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33293( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33291 "TestJSImplInterface", "methodRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33293( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33292 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33293( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33293 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33293( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33294
33295 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33296 unsigned argcount = std::min(args.length(), 1u);
33297 switch (argcount) {
33298 case 0: {
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 // NOTE: This assert does NOT call the function.
33314 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");
33315 MOZ_KnownLive(self)(self)->MethodRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"
)), 0))
) {
33317 return false;
33318 }
33319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33319); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33320 args.rval().setUndefined();
33321 return true;
33322 break;
33323 }
33324 case 1: {
33325 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33326 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33327 if (objIsXray) {
33328 unwrappedObj.emplace(cx, obj);
33329 }
33330 int8_t arg0;
33331 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
33332 return false;
33333 }
33334 if (objIsXray) {
33335 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33336 // we know Xrays have no dynamic unwrap behavior.
33337 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33338 if (!unwrappedObj.ref()) {
33339 return false;
33340 }
33341 }
33342 FastErrorResult rv;
33343 // NOTE: This assert does NOT call the function.
33344 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");
33345 MOZ_KnownLive(self)(self)->MethodRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33346 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"
)), 0))
) {
33347 return false;
33348 }
33349 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33349); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33349); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33350 args.rval().setUndefined();
33351 return true;
33352 break;
33353 }
33354 default: {
33355 // Using nsPrintfCString here would require including that
33356 // header. Let's not worry about it.
33357 nsAutoCString argCountStr;
33358 argCountStr.AppendPrintf("%u", args.length());
33359 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
33360 }
33361 }
33362 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 33362); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 33362); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
33363 return false;
33364}
33365
33366static const JSJitInfo methodRenamedFrom_methodinfo = {
33367 { (JSJitGetterOp)methodRenamedFrom },
33368 { prototypes::id::TestJSImplInterface },
33369 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33370 JSJitInfo::Method,
33371 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33372 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33373 false, /* isInfallible. False in setters. */
33374 false, /* isMovable. Not relevant for setters. */
33375 false, /* isEliminatable. Not relevant for setters. */
33376 false, /* isAlwaysInSlot. Only relevant for getters. */
33377 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33378 false, /* isTypedMethod. Only relevant for methods. */
33379 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33380};
33381
33382MOZ_CAN_RUN_SCRIPT static bool
33383get_attributeGetterRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
33384{
33385 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33388( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33386 "TestJSImplInterface", "attributeGetterRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33388( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33387 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33388( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33388 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33388( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33389
33390 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33391 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33392 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33393 if (objIsXray) {
33394 unwrappedObj.emplace(cx, obj);
33395 }
33396 if (objIsXray) {
33397 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33398 // we know Xrays have no dynamic unwrap behavior.
33399 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33400 if (!unwrappedObj.ref()) {
33401 return false;
33402 }
33403 }
33404 FastErrorResult rv;
33405 int8_t result(MOZ_KnownLive(self)(self)->GetAttributeGetterRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
33406 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter"
)), 0))
) {
33407 return false;
33408 }
33409 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33409); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33409); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33410 args.rval().setInt32(int32_t(result));
33411 return true;
33412}
33413
33414static const JSJitInfo attributeGetterRenamedFrom_getterinfo = {
33415 { get_attributeGetterRenamedFrom },
33416 { prototypes::id::TestJSImplInterface },
33417 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33418 JSJitInfo::Getter,
33419 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33420 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
33421 false, /* isInfallible. False in setters. */
33422 false, /* isMovable. Not relevant for setters. */
33423 false, /* isEliminatable. Not relevant for setters. */
33424 false, /* isAlwaysInSlot. Only relevant for getters. */
33425 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33426 false, /* isTypedMethod. Only relevant for methods. */
33427 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33428};
33429
33430MOZ_CAN_RUN_SCRIPT static bool
33431get_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
33432{
33433 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33436( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33434 "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33436( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33435 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33436( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33436 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33436( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33437
33438 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33439 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33440 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33441 if (objIsXray) {
33442 unwrappedObj.emplace(cx, obj);
33443 }
33444 if (objIsXray) {
33445 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33446 // we know Xrays have no dynamic unwrap behavior.
33447 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33448 if (!unwrappedObj.ref()) {
33449 return false;
33450 }
33451 }
33452 FastErrorResult rv;
33453 int8_t result(MOZ_KnownLive(self)(self)->GetAttributeRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
33454 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter"
)), 0))
) {
33455 return false;
33456 }
33457 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33457); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33457); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33458 args.rval().setInt32(int32_t(result));
33459 return true;
33460}
33461
33462MOZ_CAN_RUN_SCRIPT static bool
33463set_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
33464{
33465 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33468( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33466 "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33468( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33467 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject33468( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33468 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33468( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33469
33470 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33471 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33472 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33473 if (objIsXray) {
33474 unwrappedObj.emplace(cx, obj);
33475 }
33476 int8_t arg0;
33477 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
33478 return false;
33479 }
33480 if (objIsXray) {
33481 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33482 // we know Xrays have no dynamic unwrap behavior.
33483 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33484 if (!unwrappedObj.ref()) {
33485 return false;
33486 }
33487 }
33488 FastErrorResult rv;
33489 // NOTE: This assert does NOT call the function.
33490 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");
33491 MOZ_KnownLive(self)(self)->SetAttributeRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33492 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter"
)), 0))
) {
33493 return false;
33494 }
33495 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33495); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33495); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33496
33497 return true;
33498}
33499
33500static const JSJitInfo attributeRenamedFrom_getterinfo = {
33501 { get_attributeRenamedFrom },
33502 { prototypes::id::TestJSImplInterface },
33503 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33504 JSJitInfo::Getter,
33505 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33506 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
33507 false, /* isInfallible. False in setters. */
33508 false, /* isMovable. Not relevant for setters. */
33509 false, /* isEliminatable. Not relevant for setters. */
33510 false, /* isAlwaysInSlot. Only relevant for getters. */
33511 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33512 false, /* isTypedMethod. Only relevant for methods. */
33513 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33514};
33515static const JSJitInfo attributeRenamedFrom_setterinfo = {
33516 { (JSJitGetterOp)set_attributeRenamedFrom },
33517 { prototypes::id::TestJSImplInterface },
33518 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33519 JSJitInfo::Setter,
33520 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33521 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33522 false, /* isInfallible. False in setters. */
33523 false, /* isMovable. Not relevant for setters. */
33524 false, /* isEliminatable. Not relevant for setters. */
33525 false, /* isAlwaysInSlot. Only relevant for getters. */
33526 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33527 false, /* isTypedMethod. Only relevant for methods. */
33528 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33529};
33530
33531MOZ_CAN_RUN_SCRIPT static bool
33532passDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33533{
33534 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary");
33535 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33538( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33536 "TestJSImplInterface", "passDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33538( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33537 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33538( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33538 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33538( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33539
33540 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33541 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33542 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33543 if (objIsXray) {
33544 unwrappedObj.emplace(cx, obj);
33545 }
33546 RootedDictionary<binding_detail::FastDict> arg0(cx);
33547 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
33548 return false;
33549 }
33550 if (objIsXray) {
33551 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33552 // we know Xrays have no dynamic unwrap behavior.
33553 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33554 if (!unwrappedObj.ref()) {
33555 return false;
33556 }
33557 }
33558 FastErrorResult rv;
33559 // NOTE: This assert does NOT call the function.
33560 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");
33561 MOZ_KnownLive(self)(self)->PassDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33562 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary"
)), 0))
) {
33563 return false;
33564 }
33565 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33565); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33565); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33566 args.rval().setUndefined();
33567 return true;
33568}
33569
33570static const JSJitInfo passDictionary_methodinfo = {
33571 { (JSJitGetterOp)passDictionary },
33572 { prototypes::id::TestJSImplInterface },
33573 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33574 JSJitInfo::Method,
33575 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33576 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33577 false, /* isInfallible. False in setters. */
33578 false, /* isMovable. Not relevant for setters. */
33579 false, /* isEliminatable. Not relevant for setters. */
33580 false, /* isAlwaysInSlot. Only relevant for getters. */
33581 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33582 false, /* isTypedMethod. Only relevant for methods. */
33583 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33584};
33585
33586MOZ_CAN_RUN_SCRIPT static bool
33587passDictionary2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33588{
33589 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary2");
33590 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33593( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33591 "TestJSImplInterface", "passDictionary2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33593( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33592 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33593( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33593 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33593( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33594
33595 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33596 if (!args.requireAtLeast(cx, "TestJSImplInterface.passDictionary2", 1)) {
33597 return false;
33598 }
33599 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33600 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33601 if (objIsXray) {
33602 unwrappedObj.emplace(cx, obj);
33603 }
33604 RootedDictionary<binding_detail::FastDict> arg0(cx);
33605 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
33606 return false;
33607 }
33608 if (objIsXray) {
33609 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33610 // we know Xrays have no dynamic unwrap behavior.
33611 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33612 if (!unwrappedObj.ref()) {
33613 return false;
33614 }
33615 }
33616 FastErrorResult rv;
33617 // NOTE: This assert does NOT call the function.
33618 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");
33619 MOZ_KnownLive(self)(self)->PassDictionary2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33620 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2"
)), 0))
) {
33621 return false;
33622 }
33623 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33623); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33623); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33624 args.rval().setUndefined();
33625 return true;
33626}
33627
33628static const JSJitInfo passDictionary2_methodinfo = {
33629 { (JSJitGetterOp)passDictionary2 },
33630 { prototypes::id::TestJSImplInterface },
33631 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33632 JSJitInfo::Method,
33633 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33634 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33635 false, /* isInfallible. False in setters. */
33636 false, /* isMovable. Not relevant for setters. */
33637 false, /* isEliminatable. Not relevant for setters. */
33638 false, /* isAlwaysInSlot. Only relevant for getters. */
33639 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33640 false, /* isTypedMethod. Only relevant for methods. */
33641 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33642};
33643
33644MOZ_CAN_RUN_SCRIPT static bool
33645receiveDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33646{
33647 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33650( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33648 "TestJSImplInterface", "receiveDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33650( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33649 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33650( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33650 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33650( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33651
33652 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33653 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33654 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33655 if (objIsXray) {
33656 unwrappedObj.emplace(cx, obj);
33657 }
33658 if (objIsXray) {
33659 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33660 // we know Xrays have no dynamic unwrap behavior.
33661 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33662 if (!unwrappedObj.ref()) {
33663 return false;
33664 }
33665 }
33666 FastErrorResult rv;
33667 RootedDictionary<Dict> result(cx);
33668 // NOTE: This assert does NOT call the function.
33669 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");
33670 MOZ_KnownLive(self)(self)->ReceiveDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33671 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary"
)), 0))
) {
33672 return false;
33673 }
33674 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33674); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33674); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33675 if (!result.ToObjectInternal(cx, args.rval())) {
33676 return false;
33677 }
33678 return true;
33679}
33680
33681static const JSJitInfo receiveDictionary_methodinfo = {
33682 { (JSJitGetterOp)receiveDictionary },
33683 { prototypes::id::TestJSImplInterface },
33684 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33685 JSJitInfo::Method,
33686 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33687 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33688 false, /* isInfallible. False in setters. */
33689 false, /* isMovable. Not relevant for setters. */
33690 false, /* isEliminatable. Not relevant for setters. */
33691 false, /* isAlwaysInSlot. Only relevant for getters. */
33692 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33693 false, /* isTypedMethod. Only relevant for methods. */
33694 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33695};
33696
33697MOZ_CAN_RUN_SCRIPT static bool
33698receiveNullableDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33699{
33700 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33703( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33701 "TestJSImplInterface", "receiveNullableDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33703( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33702 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33703( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33703 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33703( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33704
33705 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33706 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33707 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33708 if (objIsXray) {
33709 unwrappedObj.emplace(cx, obj);
33710 }
33711 if (objIsXray) {
33712 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33713 // we know Xrays have no dynamic unwrap behavior.
33714 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33715 if (!unwrappedObj.ref()) {
33716 return false;
33717 }
33718 }
33719 FastErrorResult rv;
33720 NullableRootedDictionary<Dict> result(cx);
33721 // NOTE: This assert does NOT call the function.
33722 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");
33723 MOZ_KnownLive(self)(self)->ReceiveNullableDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33724 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary"
)), 0))
) {
33725 return false;
33726 }
33727 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33727); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33727); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33728 if (result.IsNull()) {
33729 args.rval().setNull();
33730 return true;
33731 }
33732 if (!result.Value().ToObjectInternal(cx, args.rval())) {
33733 return false;
33734 }
33735 return true;
33736}
33737
33738static const JSJitInfo receiveNullableDictionary_methodinfo = {
33739 { (JSJitGetterOp)receiveNullableDictionary },
33740 { prototypes::id::TestJSImplInterface },
33741 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33742 JSJitInfo::Method,
33743 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33744 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
33745 false, /* isInfallible. False in setters. */
33746 false, /* isMovable. Not relevant for setters. */
33747 false, /* isEliminatable. Not relevant for setters. */
33748 false, /* isAlwaysInSlot. Only relevant for getters. */
33749 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33750 false, /* isTypedMethod. Only relevant for methods. */
33751 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33752};
33753
33754MOZ_CAN_RUN_SCRIPT static bool
33755passOtherDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33756{
33757 BindingCallContext cx(cx_, "TestJSImplInterface.passOtherDictionary");
33758 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33761( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33759 "TestJSImplInterface", "passOtherDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33761( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33760 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33761( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33761 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33761( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33762
33763 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33764 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33765 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33766 if (objIsXray) {
33767 unwrappedObj.emplace(cx, obj);
33768 }
33769 binding_detail::FastGrandparentDict arg0;
33770 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
33771 return false;
33772 }
33773 if (objIsXray) {
33774 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33775 // we know Xrays have no dynamic unwrap behavior.
33776 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33777 if (!unwrappedObj.ref()) {
33778 return false;
33779 }
33780 }
33781 FastErrorResult rv;
33782 // NOTE: This assert does NOT call the function.
33783 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");
33784 MOZ_KnownLive(self)(self)->PassOtherDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33785 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary"
)), 0))
) {
33786 return false;
33787 }
33788 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33788); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33788); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33789 args.rval().setUndefined();
33790 return true;
33791}
33792
33793static const JSJitInfo passOtherDictionary_methodinfo = {
33794 { (JSJitGetterOp)passOtherDictionary },
33795 { prototypes::id::TestJSImplInterface },
33796 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33797 JSJitInfo::Method,
33798 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33799 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33800 false, /* isInfallible. False in setters. */
33801 false, /* isMovable. Not relevant for setters. */
33802 false, /* isEliminatable. Not relevant for setters. */
33803 false, /* isAlwaysInSlot. Only relevant for getters. */
33804 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33805 false, /* isTypedMethod. Only relevant for methods. */
33806 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33807};
33808
33809MOZ_CAN_RUN_SCRIPT static bool
33810passSequenceOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33811{
33812 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfDictionaries");
33813 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33816( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33814 "TestJSImplInterface", "passSequenceOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33816( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33815 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33816( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33816 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33816( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33817
33818 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33819 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfDictionaries", 1)) {
33820 return false;
33821 }
33822 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33823 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33824 if (objIsXray) {
33825 unwrappedObj.emplace(cx, obj);
33826 }
33827 binding_detail::AutoSequence<Dict> arg0;
33828 SequenceRooter<Dict> arg0_holder(cx, &arg0);
33829 if (args[0].isObject()) {
33830 JS::ForOfIterator iter(cx);
33831 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
33832 return false;
33833 }
33834 if (!iter.valueIsIterable()) {
33835 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33836 return false;
33837 }
33838 binding_detail::AutoSequence<Dict> &arr = arg0;
33839 JS::Rooted<JS::Value> temp(cx);
33840 while (true) {
33841 bool done;
33842 if (!iter.next(&temp, &done)) {
33843 return false;
33844 }
33845 if (done) {
33846 break;
33847 }
33848 Dict* slotPtr = arr.AppendElement(mozilla::fallible);
33849 if (!slotPtr) {
33850 JS_ReportOutOfMemory(cx);
33851 return false;
33852 }
33853 Dict& slot = *slotPtr;
33854 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
33855 return false;
33856 }
33857 }
33858 } else {
33859 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33860 return false;
33861 }
33862 if (objIsXray) {
33863 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33864 // we know Xrays have no dynamic unwrap behavior.
33865 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33866 if (!unwrappedObj.ref()) {
33867 return false;
33868 }
33869 }
33870 FastErrorResult rv;
33871 // NOTE: This assert does NOT call the function.
33872 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");
33873 MOZ_KnownLive(self)(self)->PassSequenceOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33874 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries"
)), 0))
) {
33875 return false;
33876 }
33877 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33877); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 33877); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
33878 args.rval().setUndefined();
33879 return true;
33880}
33881
33882static const JSJitInfo passSequenceOfDictionaries_methodinfo = {
33883 { (JSJitGetterOp)passSequenceOfDictionaries },
33884 { prototypes::id::TestJSImplInterface },
33885 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33886 JSJitInfo::Method,
33887 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33888 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33889 false, /* isInfallible. False in setters. */
33890 false, /* isMovable. Not relevant for setters. */
33891 false, /* isEliminatable. Not relevant for setters. */
33892 false, /* isAlwaysInSlot. Only relevant for getters. */
33893 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33894 false, /* isTypedMethod. Only relevant for methods. */
33895 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33896};
33897
33898MOZ_CAN_RUN_SCRIPT static bool
33899passRecordOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33900{
33901 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfDictionaries");
33902 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33905( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33903 "TestJSImplInterface", "passRecordOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33905( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33904 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33905( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33905 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33905( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33906
33907 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33908 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfDictionaries", 1)) {
33909 return false;
33910 }
33911 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33912 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33913 if (objIsXray) {
33914 unwrappedObj.emplace(cx, obj);
33915 }
33916 Record<nsString, GrandparentDict> arg0;
33917 if (args[0].isObject()) {
33918 auto& recordEntries = arg0.Entries();
33919
33920 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
33921 JS::RootedVector<jsid> ids(cx);
33922 if (!js::GetPropertyKeys(cx, recordObj,
33923 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
33924 return false;
33925 }
33926 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
33927 JS_ReportOutOfMemory(cx);
33928 return false;
33929 }
33930 JS::Rooted<JS::Value> propNameValue(cx);
33931 JS::Rooted<JS::Value> temp(cx);
33932 JS::Rooted<jsid> curId(cx);
33933 JS::Rooted<JS::Value> idVal(cx);
33934 // Use a hashset to keep track of ids seen, to avoid
33935 // introducing nasty O(N^2) behavior scanning for them all the
33936 // time. Ideally we'd use a data structure with O(1) lookup
33937 // _and_ ordering for the MozMap, but we don't have one lying
33938 // around.
33939 nsTHashtable<nsStringHashKey> idsSeen;
33940 for (size_t i = 0; i < ids.length(); ++i) {
33941 curId = ids[i];
33942
33943 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
33944 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
33945 &desc)) {
33946 return false;
33947 }
33948
33949 if (desc.isNothing() || !desc->enumerable()) {
33950 continue;
33951 }
33952
33953 idVal = js::IdToValue(curId);
33954 nsString propName;
33955 // This will just throw if idVal is a Symbol, like the spec says
33956 // to do.
33957 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
33958 return false;
33959 }
33960
33961 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
33962 return false;
33963 }
33964
33965 Record<nsString, GrandparentDict>::EntryType* entry;
33966 if (!idsSeen.EnsureInserted(propName)) {
33967 // Find the existing entry.
33968 auto idx = recordEntries.IndexOf(propName);
33969 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", 33970); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 33970); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
33970 "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", 33970); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 33970); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
33971 // Now blow it away to make it look like it was just added
33972 // to the array, because it's not obvious that it's
33973 // safe to write to its already-initialized mValue via our
33974 // normal codegen conversions. For example, the value
33975 // could be a union and this would change its type, but
33976 // codegen assumes we won't do that.
33977 entry = recordEntries.ReconstructElementAt(idx);
33978 } else {
33979 // Safe to do an infallible append here, because we did a
33980 // SetCapacity above to the right capacity.
33981 entry = recordEntries.AppendElement();
33982 }
33983 entry->mKey = propName;
33984 GrandparentDict& slot = entry->mValue;
33985 if (!slot.Init(cx, temp, "Value in argument 1", true)) {
33986 return false;
33987 }
33988 }
33989 } else {
33990 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
33991 return false;
33992 }
33993 if (objIsXray) {
33994 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33995 // we know Xrays have no dynamic unwrap behavior.
33996 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33997 if (!unwrappedObj.ref()) {
33998 return false;
33999 }
34000 }
34001 FastErrorResult rv;
34002 // NOTE: This assert does NOT call the function.
34003 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");
34004 MOZ_KnownLive(self)(self)->PassRecordOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34005 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries"
)), 0))
) {
34006 return false;
34007 }
34008 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34008); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34008); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34009 args.rval().setUndefined();
34010 return true;
34011}
34012
34013static const JSJitInfo passRecordOfDictionaries_methodinfo = {
34014 { (JSJitGetterOp)passRecordOfDictionaries },
34015 { prototypes::id::TestJSImplInterface },
34016 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34017 JSJitInfo::Method,
34018 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34019 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34020 false, /* isInfallible. False in setters. */
34021 false, /* isMovable. Not relevant for setters. */
34022 false, /* isEliminatable. Not relevant for setters. */
34023 false, /* isAlwaysInSlot. Only relevant for getters. */
34024 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34025 false, /* isTypedMethod. Only relevant for methods. */
34026 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34027};
34028
34029MOZ_CAN_RUN_SCRIPT static bool
34030passDictionaryOrLong(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34031{
34032 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionaryOrLong");
34033 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34036( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34034 "TestJSImplInterface", "passDictionaryOrLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34036( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34035 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34036( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34036 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34036( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34037
34038 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34039 unsigned argcount = std::min(args.length(), 1u);
34040 switch (argcount) {
34041 case 0: {
34042 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34043 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34044 if (objIsXray) {
34045 unwrappedObj.emplace(cx, obj);
34046 }
34047 RootedDictionary<binding_detail::FastDict> arg0(cx);
34048 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
34049 return false;
34050 }
34051 if (objIsXray) {
34052 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34053 // we know Xrays have no dynamic unwrap behavior.
34054 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34055 if (!unwrappedObj.ref()) {
34056 return false;
34057 }
34058 }
34059 FastErrorResult rv;
34060 // NOTE: This assert does NOT call the function.
34061 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");
34062 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34063 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34064 return false;
34065 }
34066 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34066); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34066); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34067 args.rval().setUndefined();
34068 return true;
34069 break;
34070 }
34071 case 1: {
34072 if (args[0].isNullOrUndefined()) {
34073 RootedDictionary<binding_detail::FastDict> arg0(cx);
34074 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
34075 return false;
34076 }
34077 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34078 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34079 if (objIsXray) {
34080 unwrappedObj.emplace(cx, obj);
34081 }
34082 if (objIsXray) {
34083 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34084 // we know Xrays have no dynamic unwrap behavior.
34085 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34086 if (!unwrappedObj.ref()) {
34087 return false;
34088 }
34089 }
34090 FastErrorResult rv;
34091 // NOTE: This assert does NOT call the function.
34092 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");
34093 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34094 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34095 return false;
34096 }
34097 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34097); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34097); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34098 args.rval().setUndefined();
34099 return true;
34100 }
34101 if (args[0].isObject()) {
34102 do {
34103 RootedDictionary<binding_detail::FastDict> arg0(cx);
34104 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
34105 return false;
34106 }
34107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34109 if (objIsXray) {
34110 unwrappedObj.emplace(cx, obj);
34111 }
34112 if (objIsXray) {
34113 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34114 // we know Xrays have no dynamic unwrap behavior.
34115 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34116 if (!unwrappedObj.ref()) {
34117 return false;
34118 }
34119 }
34120 FastErrorResult rv;
34121 // NOTE: This assert does NOT call the function.
34122 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");
34123 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34124 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34125 return false;
34126 }
34127 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34127); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34127); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34128 args.rval().setUndefined();
34129 return true;
34130 } while (false);
34131 }
34132 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34133 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34134 if (objIsXray) {
34135 unwrappedObj.emplace(cx, obj);
34136 }
34137 int32_t arg0;
34138 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
34139 return false;
34140 }
34141 if (objIsXray) {
34142 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34143 // we know Xrays have no dynamic unwrap behavior.
34144 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34145 if (!unwrappedObj.ref()) {
34146 return false;
34147 }
34148 }
34149 FastErrorResult rv;
34150 // NOTE: This assert does NOT call the function.
34151 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");
34152 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34154 return false;
34155 }
34156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34156); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34157 args.rval().setUndefined();
34158 return true;
34159 break;
34160 }
34161 default: {
34162 // Using nsPrintfCString here would require including that
34163 // header. Let's not worry about it.
34164 nsAutoCString argCountStr;
34165 argCountStr.AppendPrintf("%u", args.length());
34166 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
34167 }
34168 }
34169 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 34169); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 34169); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
34170 return false;
34171}
34172
34173static const JSJitInfo passDictionaryOrLong_methodinfo = {
34174 { (JSJitGetterOp)passDictionaryOrLong },
34175 { prototypes::id::TestJSImplInterface },
34176 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34177 JSJitInfo::Method,
34178 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34179 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34180 false, /* isInfallible. False in setters. */
34181 false, /* isMovable. Not relevant for setters. */
34182 false, /* isEliminatable. Not relevant for setters. */
34183 false, /* isAlwaysInSlot. Only relevant for getters. */
34184 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34185 false, /* isTypedMethod. Only relevant for methods. */
34186 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34187};
34188
34189MOZ_CAN_RUN_SCRIPT static bool
34190passDictContainingDict(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34191{
34192 BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingDict");
34193 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34196( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34194 "TestJSImplInterface", "passDictContainingDict", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34196( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34195 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34196( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34196 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34196( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34197
34198 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34199 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34200 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34201 if (objIsXray) {
34202 unwrappedObj.emplace(cx, obj);
34203 }
34204 RootedDictionary<binding_detail::FastDictContainingDict> arg0(cx);
34205 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
34206 return false;
34207 }
34208 if (objIsXray) {
34209 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34210 // we know Xrays have no dynamic unwrap behavior.
34211 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34212 if (!unwrappedObj.ref()) {
34213 return false;
34214 }
34215 }
34216 FastErrorResult rv;
34217 // NOTE: This assert does NOT call the function.
34218 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");
34219 MOZ_KnownLive(self)(self)->PassDictContainingDict(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34220 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict"
)), 0))
) {
34221 return false;
34222 }
34223 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34223); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34223); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34224 args.rval().setUndefined();
34225 return true;
34226}
34227
34228static const JSJitInfo passDictContainingDict_methodinfo = {
34229 { (JSJitGetterOp)passDictContainingDict },
34230 { prototypes::id::TestJSImplInterface },
34231 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34232 JSJitInfo::Method,
34233 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34234 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34235 false, /* isInfallible. False in setters. */
34236 false, /* isMovable. Not relevant for setters. */
34237 false, /* isEliminatable. Not relevant for setters. */
34238 false, /* isAlwaysInSlot. Only relevant for getters. */
34239 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34240 false, /* isTypedMethod. Only relevant for methods. */
34241 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34242};
34243
34244MOZ_CAN_RUN_SCRIPT static bool
34245passDictContainingSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34246{
34247 BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingSequence");
34248 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34251( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34249 "TestJSImplInterface", "passDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34251( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34250 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34251( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34251 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34251( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
34252
34253 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34254 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34255 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34256 if (objIsXray) {
34257 unwrappedObj.emplace(cx, obj);
34258 }
34259 RootedDictionary<binding_detail::FastDictContainingSequence> arg0(cx);
34260 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
34261 return false;
34262 }
34263 if (objIsXray) {
34264 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34265 // we know Xrays have no dynamic unwrap behavior.
34266 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34267 if (!unwrappedObj.ref()) {
34268 return false;
34269 }
34270 }
34271 FastErrorResult rv;
34272 // NOTE: This assert does NOT call the function.
34273 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");
34274 MOZ_KnownLive(self)(self)->PassDictContainingSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34275 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence"
)), 0))
) {
34276 return false;
34277 }
34278 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34278); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34278); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34279 args.rval().setUndefined();
34280 return true;
34281}
34282
34283static const JSJitInfo passDictContainingSequence_methodinfo = {
34284 { (JSJitGetterOp)passDictContainingSequence },
34285 { prototypes::id::TestJSImplInterface },
34286 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34287 JSJitInfo::Method,
34288 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34289 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34290 false, /* isInfallible. False in setters. */
34291 false, /* isMovable. Not relevant for setters. */
34292 false, /* isEliminatable. Not relevant for setters. */
34293 false, /* isAlwaysInSlot. Only relevant for getters. */
34294 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34295 false, /* isTypedMethod. Only relevant for methods. */
34296 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34297};
34298
34299MOZ_CAN_RUN_SCRIPT static bool
34300receiveDictContainingSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34301{
34302 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34305( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34303 "TestJSImplInterface", "receiveDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34305( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34304 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34305( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34305 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34305( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
34306
34307 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34308 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34309 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34310 if (objIsXray) {
34311 unwrappedObj.emplace(cx, obj);
34312 }
34313 if (objIsXray) {
34314 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34315 // we know Xrays have no dynamic unwrap behavior.
34316 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34317 if (!unwrappedObj.ref()) {
34318 return false;
34319 }
34320 }
34321 FastErrorResult rv;
34322 RootedDictionary<DictContainingSequence> result(cx);
34323 // NOTE: This assert does NOT call the function.
34324 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");
34325 MOZ_KnownLive(self)(self)->ReceiveDictContainingSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34326 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence"
)), 0))
) {
34327 return false;
34328 }
34329 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34329); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34329); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34330 if (!result.ToObjectInternal(cx, args.rval())) {
34331 return false;
34332 }
34333 return true;
34334}
34335
34336static const JSJitInfo receiveDictContainingSequence_methodinfo = {
34337 { (JSJitGetterOp)receiveDictContainingSequence },
34338 { prototypes::id::TestJSImplInterface },
34339 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34340 JSJitInfo::Method,
34341 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34342 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
34343 false, /* isInfallible. False in setters. */
34344 false, /* isMovable. Not relevant for setters. */
34345 false, /* isEliminatable. Not relevant for setters. */
34346 false, /* isAlwaysInSlot. Only relevant for getters. */
34347 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34348 false, /* isTypedMethod. Only relevant for methods. */
34349 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34350};
34351
34352MOZ_CAN_RUN_SCRIPT static bool
34353passVariadicDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34354{
34355 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicDictionary");
34356 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34359( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34357 "TestJSImplInterface", "passVariadicDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34359( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34358 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34359( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34359 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34359( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34360
34361 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34362 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34363 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34364 if (objIsXray) {
34365 unwrappedObj.emplace(cx, obj);
34366 }
34367 AutoSequence<Dict> arg0;
34368 SequenceRooter<Dict> arg0_holder(cx, &arg0);
34369 if (args.length() > 0) {
34370 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
34371 JS_ReportOutOfMemory(cx);
34372 return false;
34373 }
34374 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
34375 // OK to do infallible append here, since we ensured capacity already.
34376 Dict& slot = *arg0.AppendElement();
34377 if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) {
34378 return false;
34379 }
34380 }
34381 }
34382 if (objIsXray) {
34383 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34384 // we know Xrays have no dynamic unwrap behavior.
34385 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34386 if (!unwrappedObj.ref()) {
34387 return false;
34388 }
34389 }
34390 FastErrorResult rv;
34391 // NOTE: This assert does NOT call the function.
34392 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");
34393 MOZ_KnownLive(self)(self)->PassVariadicDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34394 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary"
)), 0))
) {
34395 return false;
34396 }
34397 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34397); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34398 args.rval().setUndefined();
34399 return true;
34400}
34401
34402static const JSJitInfo passVariadicDictionary_methodinfo = {
34403 { (JSJitGetterOp)passVariadicDictionary },
34404 { prototypes::id::TestJSImplInterface },
34405 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34406 JSJitInfo::Method,
34407 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34408 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34409 false, /* isInfallible. False in setters. */
34410 false, /* isMovable. Not relevant for setters. */
34411 false, /* isEliminatable. Not relevant for setters. */
34412 false, /* isAlwaysInSlot. Only relevant for getters. */
34413 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34414 false, /* isTypedMethod. Only relevant for methods. */
34415 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34416};
34417
34418MOZ_CAN_RUN_SCRIPT static bool
34419dontEnforceRangeOrClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34420{
34421 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34424( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34422 "TestJSImplInterface", "dontEnforceRangeOrClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34424( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34423 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34424( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34424 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34424( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34425
34426 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34427 if (!args.requireAtLeast(cx, "TestJSImplInterface.dontEnforceRangeOrClamp", 1)) {
34428 return false;
34429 }
34430 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34431 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34432 if (objIsXray) {
34433 unwrappedObj.emplace(cx, obj);
34434 }
34435 int8_t arg0;
34436 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
34437 return false;
34438 }
34439 if (objIsXray) {
34440 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34441 // we know Xrays have no dynamic unwrap behavior.
34442 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34443 if (!unwrappedObj.ref()) {
34444 return false;
34445 }
34446 }
34447 FastErrorResult rv;
34448 // NOTE: This assert does NOT call the function.
34449 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");
34450 MOZ_KnownLive(self)(self)->DontEnforceRangeOrClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34451 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp"
)), 0))
) {
34452 return false;
34453 }
34454 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34454); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34454); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34455 args.rval().setUndefined();
34456 return true;
34457}
34458
34459static const JSJitInfo dontEnforceRangeOrClamp_methodinfo = {
34460 { (JSJitGetterOp)dontEnforceRangeOrClamp },
34461 { prototypes::id::TestJSImplInterface },
34462 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34463 JSJitInfo::Method,
34464 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34465 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34466 false, /* isInfallible. False in setters. */
34467 false, /* isMovable. Not relevant for setters. */
34468 false, /* isEliminatable. Not relevant for setters. */
34469 false, /* isAlwaysInSlot. Only relevant for getters. */
34470 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34471 false, /* isTypedMethod. Only relevant for methods. */
34472 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34473};
34474
34475MOZ_CAN_RUN_SCRIPT static bool
34476doEnforceRange(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34477{
34478 BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRange");
34479 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34482( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34480 "TestJSImplInterface", "doEnforceRange", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34482( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34481 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34482( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34482 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34482( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34483
34484 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34485 if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRange", 1)) {
34486 return false;
34487 }
34488 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34489 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34490 if (objIsXray) {
34491 unwrappedObj.emplace(cx, obj);
34492 }
34493 int8_t arg0;
34494 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0)) {
34495 return false;
34496 }
34497 if (objIsXray) {
34498 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34499 // we know Xrays have no dynamic unwrap behavior.
34500 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34501 if (!unwrappedObj.ref()) {
34502 return false;
34503 }
34504 }
34505 FastErrorResult rv;
34506 // NOTE: This assert does NOT call the function.
34507 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");
34508 MOZ_KnownLive(self)(self)->DoEnforceRange(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34509 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange"
)), 0))
) {
34510 return false;
34511 }
34512 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34512); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34513 args.rval().setUndefined();
34514 return true;
34515}
34516
34517static const JSJitInfo doEnforceRange_methodinfo = {
34518 { (JSJitGetterOp)doEnforceRange },
34519 { prototypes::id::TestJSImplInterface },
34520 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34521 JSJitInfo::Method,
34522 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34523 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34524 false, /* isInfallible. False in setters. */
34525 false, /* isMovable. Not relevant for setters. */
34526 false, /* isEliminatable. Not relevant for setters. */
34527 false, /* isAlwaysInSlot. Only relevant for getters. */
34528 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34529 false, /* isTypedMethod. Only relevant for methods. */
34530 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34531};
34532
34533MOZ_CAN_RUN_SCRIPT static bool
34534doEnforceRangeNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34535{
34536 BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRangeNullable");
34537 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34540( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34538 "TestJSImplInterface", "doEnforceRangeNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34540( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34539 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34540( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34540 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34540( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34541
34542 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34543 if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRangeNullable", 1)) {
34544 return false;
34545 }
34546 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34547 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34548 if (objIsXray) {
34549 unwrappedObj.emplace(cx, obj);
34550 }
34551 Nullable<int8_t> arg0;
34552 if (args[0].isNullOrUndefined()) {
34553 arg0.SetNull();
34554 } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0.SetValue())) {
34555 return false;
34556 }
34557 if (objIsXray) {
34558 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34559 // we know Xrays have no dynamic unwrap behavior.
34560 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34561 if (!unwrappedObj.ref()) {
34562 return false;
34563 }
34564 }
34565 FastErrorResult rv;
34566 // NOTE: This assert does NOT call the function.
34567 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");
34568 MOZ_KnownLive(self)(self)->DoEnforceRangeNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34569 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable"
)), 0))
) {
34570 return false;
34571 }
34572 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34572); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34572); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34573 args.rval().setUndefined();
34574 return true;
34575}
34576
34577static const JSJitInfo doEnforceRangeNullable_methodinfo = {
34578 { (JSJitGetterOp)doEnforceRangeNullable },
34579 { prototypes::id::TestJSImplInterface },
34580 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34581 JSJitInfo::Method,
34582 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34583 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34584 false, /* isInfallible. False in setters. */
34585 false, /* isMovable. Not relevant for setters. */
34586 false, /* isEliminatable. Not relevant for setters. */
34587 false, /* isAlwaysInSlot. Only relevant for getters. */
34588 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34589 false, /* isTypedMethod. Only relevant for methods. */
34590 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34591};
34592
34593MOZ_CAN_RUN_SCRIPT static bool
34594doClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34595{
34596 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34599( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34597 "TestJSImplInterface", "doClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34599( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34598 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34599( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34599 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34599( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
34600
34601 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34602 if (!args.requireAtLeast(cx, "TestJSImplInterface.doClamp", 1)) {
34603 return false;
34604 }
34605 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34606 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34607 if (objIsXray) {
34608 unwrappedObj.emplace(cx, obj);
34609 }
34610 int8_t arg0;
34611 if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0)) {
34612 return false;
34613 }
34614 if (objIsXray) {
34615 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34616 // we know Xrays have no dynamic unwrap behavior.
34617 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34618 if (!unwrappedObj.ref()) {
34619 return false;
34620 }
34621 }
34622 FastErrorResult rv;
34623 // NOTE: This assert does NOT call the function.
34624 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");
34625 MOZ_KnownLive(self)(self)->DoClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34626 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp"
)), 0))
) {
34627 return false;
34628 }
34629 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34629); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34629); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34630 args.rval().setUndefined();
34631 return true;
34632}
34633
34634static const JSJitInfo doClamp_methodinfo = {
34635 { (JSJitGetterOp)doClamp },
34636 { prototypes::id::TestJSImplInterface },
34637 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34638 JSJitInfo::Method,
34639 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34640 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34641 false, /* isInfallible. False in setters. */
34642 false, /* isMovable. Not relevant for setters. */
34643 false, /* isEliminatable. Not relevant for setters. */
34644 false, /* isAlwaysInSlot. Only relevant for getters. */
34645 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34646 false, /* isTypedMethod. Only relevant for methods. */
34647 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34648};
34649
34650MOZ_CAN_RUN_SCRIPT static bool
34651doClampNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34652{
34653 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34654 "TestJSImplInterface", "doClampNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34655 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34656 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34657
34658 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34659 if (!args.requireAtLeast(cx, "TestJSImplInterface.doClampNullable", 1)) {
34660 return false;
34661 }
34662 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34663 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34664 if (objIsXray) {
34665 unwrappedObj.emplace(cx, obj);
34666 }
34667 Nullable<int8_t> arg0;
34668 if (args[0].isNullOrUndefined()) {
34669 arg0.SetNull();
34670 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0.SetValue())) {
34671 return false;
34672 }
34673 if (objIsXray) {
34674 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34675 // we know Xrays have no dynamic unwrap behavior.
34676 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34677 if (!unwrappedObj.ref()) {
34678 return false;
34679 }
34680 }
34681 FastErrorResult rv;
34682 // NOTE: This assert does NOT call the function.
34683 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");
34684 MOZ_KnownLive(self)(self)->DoClampNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34685 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable"
)), 0))
) {
34686 return false;
34687 }
34688 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34688); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34689 args.rval().setUndefined();
34690 return true;
34691}
34692
34693static const JSJitInfo doClampNullable_methodinfo = {
34694 { (JSJitGetterOp)doClampNullable },
34695 { prototypes::id::TestJSImplInterface },
34696 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34697 JSJitInfo::Method,
34698 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34699 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34700 false, /* isInfallible. False in setters. */
34701 false, /* isMovable. Not relevant for setters. */
34702 false, /* isEliminatable. Not relevant for setters. */
34703 false, /* isAlwaysInSlot. Only relevant for getters. */
34704 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34705 false, /* isTypedMethod. Only relevant for methods. */
34706 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34707};
34708
34709MOZ_CAN_RUN_SCRIPT static bool
34710get_enforcedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34711{
34712 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34715( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34713 "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34715( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34714 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34715( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34715 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34715( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34716
34717 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34718 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34719 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34720 if (objIsXray) {
34721 unwrappedObj.emplace(cx, obj);
34722 }
34723 if (objIsXray) {
34724 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34725 // we know Xrays have no dynamic unwrap behavior.
34726 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34727 if (!unwrappedObj.ref()) {
34728 return false;
34729 }
34730 }
34731 FastErrorResult rv;
34732 int8_t result(MOZ_KnownLive(self)(self)->GetEnforcedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
34733 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter"
)), 0))
) {
34734 return false;
34735 }
34736 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34736); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34736); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34737 args.rval().setInt32(int32_t(result));
34738 return true;
34739}
34740
34741MOZ_CAN_RUN_SCRIPT static bool
34742set_enforcedByte(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34743{
34744 BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByte setter");
34745 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34748( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34746 "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34748( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34747 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34748( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34748 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34748( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34749
34750 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34751 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34752 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34753 if (objIsXray) {
34754 unwrappedObj.emplace(cx, obj);
34755 }
34756 int8_t arg0;
34757 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0)) {
34758 return false;
34759 }
34760 if (objIsXray) {
34761 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34762 // we know Xrays have no dynamic unwrap behavior.
34763 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34764 if (!unwrappedObj.ref()) {
34765 return false;
34766 }
34767 }
34768 FastErrorResult rv;
34769 // NOTE: This assert does NOT call the function.
34770 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");
34771 MOZ_KnownLive(self)(self)->SetEnforcedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34772 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter"
)), 0))
) {
34773 return false;
34774 }
34775 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34775); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34775); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34776
34777 return true;
34778}
34779
34780static const JSJitInfo enforcedByte_getterinfo = {
34781 { get_enforcedByte },
34782 { prototypes::id::TestJSImplInterface },
34783 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34784 JSJitInfo::Getter,
34785 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34786 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
34787 false, /* isInfallible. False in setters. */
34788 false, /* isMovable. Not relevant for setters. */
34789 false, /* isEliminatable. Not relevant for setters. */
34790 false, /* isAlwaysInSlot. Only relevant for getters. */
34791 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34792 false, /* isTypedMethod. Only relevant for methods. */
34793 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34794};
34795static const JSJitInfo enforcedByte_setterinfo = {
34796 { (JSJitGetterOp)set_enforcedByte },
34797 { prototypes::id::TestJSImplInterface },
34798 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34799 JSJitInfo::Setter,
34800 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34801 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34802 false, /* isInfallible. False in setters. */
34803 false, /* isMovable. Not relevant for setters. */
34804 false, /* isEliminatable. Not relevant for setters. */
34805 false, /* isAlwaysInSlot. Only relevant for getters. */
34806 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34807 false, /* isTypedMethod. Only relevant for methods. */
34808 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34809};
34810
34811MOZ_CAN_RUN_SCRIPT static bool
34812get_enforcedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34813{
34814 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34817( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34815 "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34817( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34816 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34817( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34817 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34817( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34818
34819 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34820 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34821 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34822 if (objIsXray
0.1
'objIsXray' is false
0.1
'objIsXray' is false
) {
1
Taking false branch
34823 unwrappedObj.emplace(cx, obj);
34824 }
34825 if (objIsXray
1.1
'objIsXray' is false
1.1
'objIsXray' is false
) {
2
Taking false branch
34826 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34827 // we know Xrays have no dynamic unwrap behavior.
34828 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34829 if (!unwrappedObj.ref()) {
34830 return false;
34831 }
34832 }
34833 FastErrorResult rv;
34834 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'
34835 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter"
)), 0))
) {
34836 return false;
34837 }
34838 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34838); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34838); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34839 if (result.IsNull()) {
34840 args.rval().setNull();
34841 return true;
34842 }
34843 args.rval().setInt32(int32_t(result.Value()));
34844 return true;
34845}
34846
34847MOZ_CAN_RUN_SCRIPT static bool
34848set_enforcedByteNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34849{
34850 BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByteNullable setter");
34851 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34854( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34852 "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34854( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34853 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34854( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34854 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34854( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34855
34856 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34857 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34858 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34859 if (objIsXray) {
34860 unwrappedObj.emplace(cx, obj);
34861 }
34862 Nullable<int8_t> arg0;
34863 if (args[0].isNullOrUndefined()) {
34864 arg0.SetNull();
34865 } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
34866 return false;
34867 }
34868 if (objIsXray) {
34869 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34870 // we know Xrays have no dynamic unwrap behavior.
34871 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34872 if (!unwrappedObj.ref()) {
34873 return false;
34874 }
34875 }
34876 FastErrorResult rv;
34877 // NOTE: This assert does NOT call the function.
34878 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");
34879 MOZ_KnownLive(self)(self)->SetEnforcedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34880 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter"
)), 0))
) {
34881 return false;
34882 }
34883 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34883); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34883); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34884
34885 return true;
34886}
34887
34888static const JSJitInfo enforcedByteNullable_getterinfo = {
34889 { get_enforcedByteNullable },
34890 { prototypes::id::TestJSImplInterface },
34891 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34892 JSJitInfo::Getter,
34893 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34894 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
34895 false, /* isInfallible. False in setters. */
34896 false, /* isMovable. Not relevant for setters. */
34897 false, /* isEliminatable. Not relevant for setters. */
34898 false, /* isAlwaysInSlot. Only relevant for getters. */
34899 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34900 false, /* isTypedMethod. Only relevant for methods. */
34901 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34902};
34903static const JSJitInfo enforcedByteNullable_setterinfo = {
34904 { (JSJitGetterOp)set_enforcedByteNullable },
34905 { prototypes::id::TestJSImplInterface },
34906 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34907 JSJitInfo::Setter,
34908 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34909 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34910 false, /* isInfallible. False in setters. */
34911 false, /* isMovable. Not relevant for setters. */
34912 false, /* isEliminatable. Not relevant for setters. */
34913 false, /* isAlwaysInSlot. Only relevant for getters. */
34914 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34915 false, /* isTypedMethod. Only relevant for methods. */
34916 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34917};
34918
34919MOZ_CAN_RUN_SCRIPT static bool
34920get_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34921{
34922 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34925( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34923 "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34925( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34924 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34925( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34925 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34925( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34926
34927 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34928 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34929 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34930 if (objIsXray) {
34931 unwrappedObj.emplace(cx, obj);
34932 }
34933 if (objIsXray) {
34934 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34935 // we know Xrays have no dynamic unwrap behavior.
34936 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34937 if (!unwrappedObj.ref()) {
34938 return false;
34939 }
34940 }
34941 FastErrorResult rv;
34942 int8_t result(MOZ_KnownLive(self)(self)->GetClampedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
34943 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter"
)), 0))
) {
34944 return false;
34945 }
34946 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34946); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34946); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34947 args.rval().setInt32(int32_t(result));
34948 return true;
34949}
34950
34951MOZ_CAN_RUN_SCRIPT static bool
34952set_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34953{
34954 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34957( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34955 "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34957( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34956 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34957( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34957 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34957( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34958
34959 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34960 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34961 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34962 if (objIsXray) {
34963 unwrappedObj.emplace(cx, obj);
34964 }
34965 int8_t arg0;
34966 if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0)) {
34967 return false;
34968 }
34969 if (objIsXray) {
34970 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34971 // we know Xrays have no dynamic unwrap behavior.
34972 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34973 if (!unwrappedObj.ref()) {
34974 return false;
34975 }
34976 }
34977 FastErrorResult rv;
34978 // NOTE: This assert does NOT call the function.
34979 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");
34980 MOZ_KnownLive(self)(self)->SetClampedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34981 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter"
)), 0))
) {
34982 return false;
34983 }
34984 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34984); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 34984); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
34985
34986 return true;
34987}
34988
34989static const JSJitInfo clampedByte_getterinfo = {
34990 { get_clampedByte },
34991 { prototypes::id::TestJSImplInterface },
34992 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34993 JSJitInfo::Getter,
34994 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34995 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
34996 false, /* isInfallible. False in setters. */
34997 false, /* isMovable. Not relevant for setters. */
34998 false, /* isEliminatable. Not relevant for setters. */
34999 false, /* isAlwaysInSlot. Only relevant for getters. */
35000 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35001 false, /* isTypedMethod. Only relevant for methods. */
35002 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35003};
35004static const JSJitInfo clampedByte_setterinfo = {
35005 { (JSJitGetterOp)set_clampedByte },
35006 { prototypes::id::TestJSImplInterface },
35007 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35008 JSJitInfo::Setter,
35009 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35010 JSVAL_TYPE_UNDEFINED, /* 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};
35019
35020MOZ_CAN_RUN_SCRIPT static bool
35021get_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
35022{
35023 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35026( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35024 "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35026( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35025 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject35026( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35026 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35026( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35027
35028 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35029 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35030 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35031 if (objIsXray) {
35032 unwrappedObj.emplace(cx, obj);
35033 }
35034 if (objIsXray) {
35035 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35036 // we know Xrays have no dynamic unwrap behavior.
35037 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35038 if (!unwrappedObj.ref()) {
35039 return false;
35040 }
35041 }
35042 FastErrorResult rv;
35043 Nullable<int8_t> result(MOZ_KnownLive(self)(self)->GetClampedByteNullable(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35044 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter"
)), 0))
) {
35045 return false;
35046 }
35047 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35047); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35047); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35048 if (result.IsNull()) {
35049 args.rval().setNull();
35050 return true;
35051 }
35052 args.rval().setInt32(int32_t(result.Value()));
35053 return true;
35054}
35055
35056MOZ_CAN_RUN_SCRIPT static bool
35057set_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
35058{
35059 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35062( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35060 "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35062( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35061 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject35062( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35062 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35062( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35063
35064 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35065 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35066 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35067 if (objIsXray) {
35068 unwrappedObj.emplace(cx, obj);
35069 }
35070 Nullable<int8_t> arg0;
35071 if (args[0].isNullOrUndefined()) {
35072 arg0.SetNull();
35073 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
35074 return false;
35075 }
35076 if (objIsXray) {
35077 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35078 // we know Xrays have no dynamic unwrap behavior.
35079 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35080 if (!unwrappedObj.ref()) {
35081 return false;
35082 }
35083 }
35084 FastErrorResult rv;
35085 // NOTE: This assert does NOT call the function.
35086 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");
35087 MOZ_KnownLive(self)(self)->SetClampedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35088 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter"
)), 0))
) {
35089 return false;
35090 }
35091 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35091); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35091); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35092
35093 return true;
35094}
35095
35096static const JSJitInfo clampedByteNullable_getterinfo = {
35097 { get_clampedByteNullable },
35098 { prototypes::id::TestJSImplInterface },
35099 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35100 JSJitInfo::Getter,
35101 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35102 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
35103 false, /* isInfallible. False in setters. */
35104 false, /* isMovable. Not relevant for setters. */
35105 false, /* isEliminatable. Not relevant for setters. */
35106 false, /* isAlwaysInSlot. Only relevant for getters. */
35107 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35108 false, /* isTypedMethod. Only relevant for methods. */
35109 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35110};
35111static const JSJitInfo clampedByteNullable_setterinfo = {
35112 { (JSJitGetterOp)set_clampedByteNullable },
35113 { prototypes::id::TestJSImplInterface },
35114 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35115 JSJitInfo::Setter,
35116 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35117 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35118 false, /* isInfallible. False in setters. */
35119 false, /* isMovable. Not relevant for setters. */
35120 false, /* isEliminatable. Not relevant for setters. */
35121 false, /* isAlwaysInSlot. Only relevant for getters. */
35122 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35123 false, /* isTypedMethod. Only relevant for methods. */
35124 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35125};
35126
35127MOZ_CAN_RUN_SCRIPT static bool
35128exerciseTypedefInterfaces1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35129{
35130 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces1");
35131 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35134( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35132 "TestJSImplInterface", "exerciseTypedefInterfaces1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35134( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35133 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35134( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35134 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35134( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35135
35136 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35137 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces1", 1)) {
35138 return false;
35139 }
35140 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35141 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35142 if (objIsXray) {
35143 unwrappedObj.emplace(cx, obj);
35144 }
35145 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35146 if (args[0].isObject()) {
35147 {
35148 // Our JSContext should be in the right global to do unwrapping in.
35149 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35150 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35151 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35152 return false;
35153 }
35154 }
35155 } else {
35156 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35157 return false;
35158 }
35159 if (objIsXray) {
35160 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35161 // we know Xrays have no dynamic unwrap behavior.
35162 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35163 if (!unwrappedObj.ref()) {
35164 return false;
35165 }
35166 }
35167 FastErrorResult rv;
35168 // NOTE: This assert does NOT call the function.
35169 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");
35170 MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35171 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1"
)), 0))
) {
35172 return false;
35173 }
35174 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35174); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35174); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35175 args.rval().setUndefined();
35176 return true;
35177}
35178
35179static const JSJitInfo exerciseTypedefInterfaces1_methodinfo = {
35180 { (JSJitGetterOp)exerciseTypedefInterfaces1 },
35181 { prototypes::id::TestJSImplInterface },
35182 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35183 JSJitInfo::Method,
35184 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35185 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35186 false, /* isInfallible. False in setters. */
35187 false, /* isMovable. Not relevant for setters. */
35188 false, /* isEliminatable. Not relevant for setters. */
35189 false, /* isAlwaysInSlot. Only relevant for getters. */
35190 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35191 false, /* isTypedMethod. Only relevant for methods. */
35192 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35193};
35194
35195MOZ_CAN_RUN_SCRIPT static bool
35196exerciseTypedefInterfaces2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35197{
35198 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces2");
35199 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35202( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35200 "TestJSImplInterface", "exerciseTypedefInterfaces2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35202( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35201 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35202( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35202 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35202( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35203
35204 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35205 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces2", 1)) {
35206 return false;
35207 }
35208 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35209 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35210 if (objIsXray) {
35211 unwrappedObj.emplace(cx, obj);
35212 }
35213 mozilla::dom::TestJSImplInterface* arg0;
35214 if (args[0].isObject()) {
35215 {
35216 // Our JSContext should be in the right global to do unwrapping in.
35217 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35218 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35219 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35220 return false;
35221 }
35222 }
35223 } else if (args[0].isNullOrUndefined()) {
35224 arg0 = nullptr;
35225 } else {
35226 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35227 return false;
35228 }
35229 if (objIsXray) {
35230 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35231 // we know Xrays have no dynamic unwrap behavior.
35232 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35233 if (!unwrappedObj.ref()) {
35234 return false;
35235 }
35236 }
35237 FastErrorResult rv;
35238 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)))));
35239 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2"
)), 0))
) {
35240 return false;
35241 }
35242 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35242); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35242); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35243 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
35244 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35244); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35244); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35245 return false;
35246 }
35247 return true;
35248}
35249
35250static const JSJitInfo exerciseTypedefInterfaces2_methodinfo = {
35251 { (JSJitGetterOp)exerciseTypedefInterfaces2 },
35252 { prototypes::id::TestJSImplInterface },
35253 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35254 JSJitInfo::Method,
35255 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35256 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
35257 false, /* isInfallible. False in setters. */
35258 false, /* isMovable. Not relevant for setters. */
35259 false, /* isEliminatable. Not relevant for setters. */
35260 false, /* isAlwaysInSlot. Only relevant for getters. */
35261 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35262 false, /* isTypedMethod. Only relevant for methods. */
35263 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35264};
35265
35266MOZ_CAN_RUN_SCRIPT static bool
35267exerciseTypedefInterfaces3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35268{
35269 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces3");
35270 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35273( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35271 "TestJSImplInterface", "exerciseTypedefInterfaces3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35273( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35272 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35273( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35273 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35273( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35274
35275 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35276 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces3", 1)) {
35277 return false;
35278 }
35279 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35280 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35281 if (objIsXray) {
35282 unwrappedObj.emplace(cx, obj);
35283 }
35284 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35285 if (args[0].isObject()) {
35286 {
35287 // Our JSContext should be in the right global to do unwrapping in.
35288 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35289 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35290 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35291 return false;
35292 }
35293 }
35294 } else {
35295 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35296 return false;
35297 }
35298 if (objIsXray) {
35299 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35300 // we know Xrays have no dynamic unwrap behavior.
35301 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35302 if (!unwrappedObj.ref()) {
35303 return false;
35304 }
35305 }
35306 FastErrorResult rv;
35307 // NOTE: This assert does NOT call the function.
35308 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");
35309 MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35310 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3"
)), 0))
) {
35311 return false;
35312 }
35313 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35313); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35313); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35314 args.rval().setUndefined();
35315 return true;
35316}
35317
35318static const JSJitInfo exerciseTypedefInterfaces3_methodinfo = {
35319 { (JSJitGetterOp)exerciseTypedefInterfaces3 },
35320 { prototypes::id::TestJSImplInterface },
35321 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35322 JSJitInfo::Method,
35323 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35324 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35325 false, /* isInfallible. False in setters. */
35326 false, /* isMovable. Not relevant for setters. */
35327 false, /* isEliminatable. Not relevant for setters. */
35328 false, /* isAlwaysInSlot. Only relevant for getters. */
35329 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35330 false, /* isTypedMethod. Only relevant for methods. */
35331 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35332};
35333
35334MOZ_CAN_RUN_SCRIPT static bool
35335get_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
35336{
35337 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35340( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35338 "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35340( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35339 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject35340( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35340 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35340( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35341
35342 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35343 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35344 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35345 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35346 if (objIsXray) {
35347 unwrappedObj.emplace(cx, obj);
35348 }
35349 if (objIsXray) {
35350 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35351 // we know Xrays have no dynamic unwrap behavior.
35352 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35353 if (!unwrappedObj.ref()) {
35354 return false;
35355 }
35356 }
35357 FastErrorResult rv;
35358 int8_t result(MOZ_KnownLive(self)(self)->GetDeprecatedAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35359 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter"
)), 0))
) {
35360 return false;
35361 }
35362 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35362); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35363 args.rval().setInt32(int32_t(result));
35364 return true;
35365}
35366
35367MOZ_CAN_RUN_SCRIPT static bool
35368set_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
35369{
35370 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35373( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35371 "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35373( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35372 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject35373( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35373 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35373( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35374
35375 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35376 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35377 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35378 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35379 if (objIsXray) {
35380 unwrappedObj.emplace(cx, obj);
35381 }
35382 int8_t arg0;
35383 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
35384 return false;
35385 }
35386 if (objIsXray) {
35387 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35388 // we know Xrays have no dynamic unwrap behavior.
35389 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35390 if (!unwrappedObj.ref()) {
35391 return false;
35392 }
35393 }
35394 FastErrorResult rv;
35395 // NOTE: This assert does NOT call the function.
35396 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");
35397 MOZ_KnownLive(self)(self)->SetDeprecatedAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35398 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter"
)), 0))
) {
35399 return false;
35400 }
35401 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35401); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35401); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35402
35403 return true;
35404}
35405
35406static const JSJitInfo deprecatedAttribute_getterinfo = {
35407 { get_deprecatedAttribute },
35408 { prototypes::id::TestJSImplInterface },
35409 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35410 JSJitInfo::Getter,
35411 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35412 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
35413 false, /* isInfallible. False in setters. */
35414 false, /* isMovable. Not relevant for setters. */
35415 false, /* isEliminatable. Not relevant for setters. */
35416 false, /* isAlwaysInSlot. Only relevant for getters. */
35417 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35418 false, /* isTypedMethod. Only relevant for methods. */
35419 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35420};
35421static const JSJitInfo deprecatedAttribute_setterinfo = {
35422 { (JSJitGetterOp)set_deprecatedAttribute },
35423 { prototypes::id::TestJSImplInterface },
35424 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35425 JSJitInfo::Setter,
35426 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35427 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35428 false, /* isInfallible. False in setters. */
35429 false, /* isMovable. Not relevant for setters. */
35430 false, /* isEliminatable. Not relevant for setters. */
35431 false, /* isAlwaysInSlot. Only relevant for getters. */
35432 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35433 false, /* isTypedMethod. Only relevant for methods. */
35434 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35435};
35436
35437MOZ_CAN_RUN_SCRIPT static bool
35438deprecatedMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35439{
35440 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35443( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35441 "TestJSImplInterface", "deprecatedMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35443( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35442 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35443( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35443 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35443( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35444
35445 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35446 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35447 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35448 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35449 if (objIsXray) {
35450 unwrappedObj.emplace(cx, obj);
35451 }
35452 if (objIsXray) {
35453 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35454 // we know Xrays have no dynamic unwrap behavior.
35455 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35456 if (!unwrappedObj.ref()) {
35457 return false;
35458 }
35459 }
35460 FastErrorResult rv;
35461 int8_t result(MOZ_KnownLive(self)(self)->DeprecatedMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35462 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod"
)), 0))
) {
35463 return false;
35464 }
35465 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35465); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35465); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35466 args.rval().setInt32(int32_t(result));
35467 return true;
35468}
35469
35470static const JSJitInfo deprecatedMethod_methodinfo = {
35471 { (JSJitGetterOp)deprecatedMethod },
35472 { prototypes::id::TestJSImplInterface },
35473 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35474 JSJitInfo::Method,
35475 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35476 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
35477 false, /* isInfallible. False in setters. */
35478 false, /* isMovable. Not relevant for setters. */
35479 false, /* isEliminatable. Not relevant for setters. */
35480 false, /* isAlwaysInSlot. Only relevant for getters. */
35481 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35482 false, /* isTypedMethod. Only relevant for methods. */
35483 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35484};
35485
35486MOZ_CAN_RUN_SCRIPT static bool
35487deprecatedMethodWithContext(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35488{
35489 BindingCallContext cx(cx_, "TestJSImplInterface.deprecatedMethodWithContext");
35490 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35493( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35491 "TestJSImplInterface", "deprecatedMethodWithContext", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35493( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35492 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35493( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35493 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35493( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35494
35495 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35496 if (!args.requireAtLeast(cx, "TestJSImplInterface.deprecatedMethodWithContext", 1)) {
35497 return false;
35498 }
35499 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35500 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35501 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35502 if (objIsXray) {
35503 unwrappedObj.emplace(cx, obj);
35504 }
35505 JS::Rooted<JS::Value> arg0(cx);
35506#ifdef __clang__1
35507#pragma clang diagnostic push
35508#pragma clang diagnostic ignored "-Wunreachable-code"
35509#pragma clang diagnostic ignored "-Wunreachable-code-return"
35510#endif // __clang__
35511 if ((true) && !CallerSubsumes(args[0])) {
35512 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
35513 return false;
35514 }
35515#ifdef __clang__1
35516#pragma clang diagnostic pop
35517#endif // __clang__
35518 arg0 = args[0];
35519 if (objIsXray) {
35520 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35521 // we know Xrays have no dynamic unwrap behavior.
35522 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35523 if (!unwrappedObj.ref()) {
35524 return false;
35525 }
35526 }
35527 FastErrorResult rv;
35528 // NOTE: This assert does NOT call the function.
35529 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");
35530 MOZ_KnownLive(self)(self)->DeprecatedMethodWithContext(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35531 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext"
)), 0))
) {
35532 return false;
35533 }
35534 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35534); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35534); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35535 args.rval().setUndefined();
35536 return true;
35537}
35538
35539static const JSJitInfo deprecatedMethodWithContext_methodinfo = {
35540 { (JSJitGetterOp)deprecatedMethodWithContext },
35541 { prototypes::id::TestJSImplInterface },
35542 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35543 JSJitInfo::Method,
35544 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35545 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35546 false, /* isInfallible. False in setters. */
35547 false, /* isMovable. Not relevant for setters. */
35548 false, /* isEliminatable. Not relevant for setters. */
35549 false, /* isAlwaysInSlot. Only relevant for getters. */
35550 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35551 false, /* isTypedMethod. Only relevant for methods. */
35552 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35553};
35554
35555MOZ_CAN_RUN_SCRIPT static bool
35556overload1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35557{
35558 BindingCallContext cx(cx_, "TestJSImplInterface.overload1");
35559 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35562( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35560 "TestJSImplInterface", "overload1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35562( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35561 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35562( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35562 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35562( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35563
35564 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35565 unsigned argcount = std::min(args.length(), 2u);
35566 switch (argcount) {
35567 case 1: {
35568 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35569 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35570 if (objIsXray) {
35571 unwrappedObj.emplace(cx, obj);
35572 }
35573 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35574 if (args[0].isObject()) {
35575 {
35576 // Our JSContext should be in the right global to do unwrapping in.
35577 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35578 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35579 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35580 return false;
35581 }
35582 }
35583 } else {
35584 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35585 return false;
35586 }
35587 if (objIsXray) {
35588 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35589 // we know Xrays have no dynamic unwrap behavior.
35590 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35591 if (!unwrappedObj.ref()) {
35592 return false;
35593 }
35594 }
35595 FastErrorResult rv;
35596 bool result(MOZ_KnownLive(self)(self)->Overload1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35597 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"
)), 0))
) {
35598 return false;
35599 }
35600 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35600); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35600); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35601 args.rval().setBoolean(result);
35602 return true;
35603 break;
35604 }
35605 case 2: {
35606 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35607 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35608 if (objIsXray) {
35609 unwrappedObj.emplace(cx, obj);
35610 }
35611 binding_detail::FakeString<char16_t> arg0;
35612 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
35613 return false;
35614 }
35615 NonNull<mozilla::dom::TestJSImplInterface> arg1;
35616 if (args[1].isObject()) {
35617 {
35618 // Our JSContext should be in the right global to do unwrapping in.
35619 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[1], arg1, cx);
35620 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35621 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestJSImplInterface");
35622 return false;
35623 }
35624 }
35625 } else {
35626 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
35627 return false;
35628 }
35629 if (objIsXray) {
35630 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35631 // we know Xrays have no dynamic unwrap behavior.
35632 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35633 if (!unwrappedObj.ref()) {
35634 return false;
35635 }
35636 }
35637 FastErrorResult rv;
35638 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)))));
35639 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"
)), 0))
) {
35640 return false;
35641 }
35642 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35642); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35642); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35643 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
35644 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35644); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35644); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35645 return false;
35646 }
35647 return true;
35648 break;
35649 }
35650 default: {
35651 // Using nsPrintfCString here would require including that
35652 // header. Let's not worry about it.
35653 nsAutoCString argCountStr;
35654 argCountStr.AppendPrintf("%u", args.length());
35655 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
35656 }
35657 }
35658 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 35658); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 35658); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
35659 return false;
35660}
35661
35662static const JSJitInfo overload1_methodinfo = {
35663 { (JSJitGetterOp)overload1 },
35664 { prototypes::id::TestJSImplInterface },
35665 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35666 JSJitInfo::Method,
35667 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35668 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
35669 false, /* isInfallible. False in setters. */
35670 false, /* isMovable. Not relevant for setters. */
35671 false, /* isEliminatable. Not relevant for setters. */
35672 false, /* isAlwaysInSlot. Only relevant for getters. */
35673 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35674 false, /* isTypedMethod. Only relevant for methods. */
35675 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35676};
35677
35678MOZ_CAN_RUN_SCRIPT static bool
35679overload2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35680{
35681 BindingCallContext cx(cx_, "TestJSImplInterface.overload2");
35682 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35685( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35683 "TestJSImplInterface", "overload2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35685( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35684 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35685( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35685 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35685( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35686
35687 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35688 unsigned argcount = std::min(args.length(), 1u);
35689 switch (argcount) {
35690 case 0: {
35691 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35692 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35693 if (objIsXray) {
35694 unwrappedObj.emplace(cx, obj);
35695 }
35696 RootedDictionary<binding_detail::FastDict> arg0(cx);
35697 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
35698 return false;
35699 }
35700 if (objIsXray) {
35701 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35702 // we know Xrays have no dynamic unwrap behavior.
35703 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35704 if (!unwrappedObj.ref()) {
35705 return false;
35706 }
35707 }
35708 FastErrorResult rv;
35709 // NOTE: This assert does NOT call the function.
35710 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");
35711 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35712 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35713 return false;
35714 }
35715 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35715); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35715); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35716 args.rval().setUndefined();
35717 return true;
35718 break;
35719 }
35720 case 1: {
35721 if (args[0].isNullOrUndefined()) {
35722 RootedDictionary<binding_detail::FastDict> arg0(cx);
35723 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
35724 return false;
35725 }
35726 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35727 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35728 if (objIsXray) {
35729 unwrappedObj.emplace(cx, obj);
35730 }
35731 if (objIsXray) {
35732 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35733 // we know Xrays have no dynamic unwrap behavior.
35734 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35735 if (!unwrappedObj.ref()) {
35736 return false;
35737 }
35738 }
35739 FastErrorResult rv;
35740 // NOTE: This assert does NOT call the function.
35741 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");
35742 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35743 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35744 return false;
35745 }
35746 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35746); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35746); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35747 args.rval().setUndefined();
35748 return true;
35749 }
35750 if (args[0].isObject()) {
35751 do {
35752 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35753 {
35754 // Our JSContext should be in the right global to do unwrapping in.
35755 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35756 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35757 break;
35758 }
35759 }
35760 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35761 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35762 if (objIsXray) {
35763 unwrappedObj.emplace(cx, obj);
35764 }
35765 if (objIsXray) {
35766 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35767 // we know Xrays have no dynamic unwrap behavior.
35768 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35769 if (!unwrappedObj.ref()) {
35770 return false;
35771 }
35772 }
35773 FastErrorResult rv;
35774 // NOTE: This assert does NOT call the function.
35775 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");
35776 MOZ_KnownLive(self)(self)->Overload2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35777 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35778 return false;
35779 }
35780 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35780); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35780); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35781 args.rval().setUndefined();
35782 return true;
35783 } while (false);
35784 do {
35785 RootedDictionary<binding_detail::FastDict> arg0(cx);
35786 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
35787 return false;
35788 }
35789 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35790 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35791 if (objIsXray) {
35792 unwrappedObj.emplace(cx, obj);
35793 }
35794 if (objIsXray) {
35795 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35796 // we know Xrays have no dynamic unwrap behavior.
35797 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35798 if (!unwrappedObj.ref()) {
35799 return false;
35800 }
35801 }
35802 FastErrorResult rv;
35803 // NOTE: This assert does NOT call the function.
35804 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");
35805 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35806 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35807 return false;
35808 }
35809 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35809); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35809); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35810 args.rval().setUndefined();
35811 return true;
35812 } while (false);
35813 }
35814 if (args[0].isBoolean()) {
35815 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35816 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35817 if (objIsXray) {
35818 unwrappedObj.emplace(cx, obj);
35819 }
35820 bool arg0;
35821 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
35822 return false;
35823 }
35824 if (objIsXray) {
35825 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35826 // we know Xrays have no dynamic unwrap behavior.
35827 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35828 if (!unwrappedObj.ref()) {
35829 return false;
35830 }
35831 }
35832 FastErrorResult rv;
35833 // NOTE: This assert does NOT call the function.
35834 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");
35835 MOZ_KnownLive(self)(self)->Overload2(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35836 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35837 return false;
35838 }
35839 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35839); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35839); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35840 args.rval().setUndefined();
35841 return true;
35842 }
35843 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35844 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35845 if (objIsXray) {
35846 unwrappedObj.emplace(cx, obj);
35847 }
35848 binding_detail::FakeString<char16_t> arg0;
35849 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
35850 return false;
35851 }
35852 if (objIsXray) {
35853 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35854 // we know Xrays have no dynamic unwrap behavior.
35855 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35856 if (!unwrappedObj.ref()) {
35857 return false;
35858 }
35859 }
35860 FastErrorResult rv;
35861 // NOTE: This assert does NOT call the function.
35862 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");
35863 MOZ_KnownLive(self)(self)->Overload2(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35864 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35865 return false;
35866 }
35867 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35867); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35867); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35868 args.rval().setUndefined();
35869 return true;
35870 break;
35871 }
35872 default: {
35873 // Using nsPrintfCString here would require including that
35874 // header. Let's not worry about it.
35875 nsAutoCString argCountStr;
35876 argCountStr.AppendPrintf("%u", args.length());
35877 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
35878 }
35879 }
35880 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 35880); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 35880); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
35881 return false;
35882}
35883
35884static const JSJitInfo overload2_methodinfo = {
35885 { (JSJitGetterOp)overload2 },
35886 { prototypes::id::TestJSImplInterface },
35887 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35888 JSJitInfo::Method,
35889 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35890 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35891 false, /* isInfallible. False in setters. */
35892 false, /* isMovable. Not relevant for setters. */
35893 false, /* isEliminatable. Not relevant for setters. */
35894 false, /* isAlwaysInSlot. Only relevant for getters. */
35895 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35896 false, /* isTypedMethod. Only relevant for methods. */
35897 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35898};
35899
35900MOZ_CAN_RUN_SCRIPT static bool
35901overload3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35902{
35903 BindingCallContext cx(cx_, "TestJSImplInterface.overload3");
35904 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35907( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35905 "TestJSImplInterface", "overload3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35907( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35906 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35907( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35907 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35907( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35908
35909 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35910 unsigned argcount = std::min(args.length(), 1u);
35911 switch (argcount) {
35912 case 1: {
35913 if (args[0].isObject()) {
35914 do {
35915 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35916 {
35917 // Our JSContext should be in the right global to do unwrapping in.
35918 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35919 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35920 break;
35921 }
35922 }
35923 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35924 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35925 if (objIsXray) {
35926 unwrappedObj.emplace(cx, obj);
35927 }
35928 if (objIsXray) {
35929 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35930 // we know Xrays have no dynamic unwrap behavior.
35931 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35932 if (!unwrappedObj.ref()) {
35933 return false;
35934 }
35935 }
35936 FastErrorResult rv;
35937 // NOTE: This assert does NOT call the function.
35938 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");
35939 MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35940 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
35941 return false;
35942 }
35943 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35943); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35943); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35944 args.rval().setUndefined();
35945 return true;
35946 } while (false);
35947 do {
35948 RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx);
35949 if (JS::IsCallable(&args[0].toObject())) {
35950 { // scope for tempRoot and tempGlobalRoot if needed
35951 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
35952 }
35953 } else {
35954 break;
35955 }
35956 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35957 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35958 if (objIsXray) {
35959 unwrappedObj.emplace(cx, obj);
35960 }
35961 if (objIsXray) {
35962 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35963 // we know Xrays have no dynamic unwrap behavior.
35964 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35965 if (!unwrappedObj.ref()) {
35966 return false;
35967 }
35968 }
35969 FastErrorResult rv;
35970 // NOTE: This assert does NOT call the function.
35971 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");
35972 MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35973 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
35974 return false;
35975 }
35976 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35976); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 35976); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
35977 args.rval().setUndefined();
35978 return true;
35979 } while (false);
35980 }
35981 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35982 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35983 if (objIsXray) {
35984 unwrappedObj.emplace(cx, obj);
35985 }
35986 bool arg0;
35987 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
35988 return false;
35989 }
35990 if (objIsXray) {
35991 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35992 // we know Xrays have no dynamic unwrap behavior.
35993 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35994 if (!unwrappedObj.ref()) {
35995 return false;
35996 }
35997 }
35998 FastErrorResult rv;
35999 // NOTE: This assert does NOT call the function.
36000 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");
36001 MOZ_KnownLive(self)(self)->Overload3(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36002 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
36003 return false;
36004 }
36005 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36005); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36006 args.rval().setUndefined();
36007 return true;
36008 break;
36009 }
36010 default: {
36011 // Using nsPrintfCString here would require including that
36012 // header. Let's not worry about it.
36013 nsAutoCString argCountStr;
36014 argCountStr.AppendPrintf("%u", args.length());
36015 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36016 }
36017 }
36018 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36018); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36018); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36019 return false;
36020}
36021
36022static const JSJitInfo overload3_methodinfo = {
36023 { (JSJitGetterOp)overload3 },
36024 { prototypes::id::TestJSImplInterface },
36025 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36026 JSJitInfo::Method,
36027 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36028 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36029 false, /* isInfallible. False in setters. */
36030 false, /* isMovable. Not relevant for setters. */
36031 false, /* isEliminatable. Not relevant for setters. */
36032 false, /* isAlwaysInSlot. Only relevant for getters. */
36033 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36034 false, /* isTypedMethod. Only relevant for methods. */
36035 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36036};
36037
36038MOZ_CAN_RUN_SCRIPT static bool
36039overload4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36040{
36041 BindingCallContext cx(cx_, "TestJSImplInterface.overload4");
36042 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36045( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36043 "TestJSImplInterface", "overload4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36045( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36044 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36045( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36045 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36045( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36046
36047 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36048 unsigned argcount = std::min(args.length(), 1u);
36049 switch (argcount) {
36050 case 1: {
36051 if (args[0].isObject()) {
36052 do {
36053 NonNull<mozilla::dom::TestJSImplInterface> arg0;
36054 {
36055 // Our JSContext should be in the right global to do unwrapping in.
36056 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
36057 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
36058 break;
36059 }
36060 }
36061 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36062 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36063 if (objIsXray) {
36064 unwrappedObj.emplace(cx, obj);
36065 }
36066 if (objIsXray) {
36067 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36068 // we know Xrays have no dynamic unwrap behavior.
36069 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36070 if (!unwrappedObj.ref()) {
36071 return false;
36072 }
36073 }
36074 FastErrorResult rv;
36075 // NOTE: This assert does NOT call the function.
36076 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");
36077 MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36078 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
36079 return false;
36080 }
36081 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36081); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36081); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36082 args.rval().setUndefined();
36083 return true;
36084 } while (false);
36085 do {
36086 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
36087 { // scope for tempRoot and tempGlobalRoot if needed
36088 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
36089 }
36090 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36091 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36092 if (objIsXray) {
36093 unwrappedObj.emplace(cx, obj);
36094 }
36095 if (objIsXray) {
36096 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36097 // we know Xrays have no dynamic unwrap behavior.
36098 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36099 if (!unwrappedObj.ref()) {
36100 return false;
36101 }
36102 }
36103 FastErrorResult rv;
36104 // NOTE: This assert does NOT call the function.
36105 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");
36106 MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36107 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
36108 return false;
36109 }
36110 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36110); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36111 args.rval().setUndefined();
36112 return true;
36113 } while (false);
36114 }
36115 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36116 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36117 if (objIsXray) {
36118 unwrappedObj.emplace(cx, obj);
36119 }
36120 binding_detail::FakeString<char16_t> arg0;
36121 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
36122 return false;
36123 }
36124 if (objIsXray) {
36125 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36126 // we know Xrays have no dynamic unwrap behavior.
36127 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36128 if (!unwrappedObj.ref()) {
36129 return false;
36130 }
36131 }
36132 FastErrorResult rv;
36133 // NOTE: This assert does NOT call the function.
36134 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");
36135 MOZ_KnownLive(self)(self)->Overload4(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36136 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
36137 return false;
36138 }
36139 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36139); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36139); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36140 args.rval().setUndefined();
36141 return true;
36142 break;
36143 }
36144 default: {
36145 // Using nsPrintfCString here would require including that
36146 // header. Let's not worry about it.
36147 nsAutoCString argCountStr;
36148 argCountStr.AppendPrintf("%u", args.length());
36149 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36150 }
36151 }
36152 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36152); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36152); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36153 return false;
36154}
36155
36156static const JSJitInfo overload4_methodinfo = {
36157 { (JSJitGetterOp)overload4 },
36158 { prototypes::id::TestJSImplInterface },
36159 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36160 JSJitInfo::Method,
36161 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36162 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36163 false, /* isInfallible. False in setters. */
36164 false, /* isMovable. Not relevant for setters. */
36165 false, /* isEliminatable. Not relevant for setters. */
36166 false, /* isAlwaysInSlot. Only relevant for getters. */
36167 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36168 false, /* isTypedMethod. Only relevant for methods. */
36169 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36170};
36171
36172MOZ_CAN_RUN_SCRIPT static bool
36173overload5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36174{
36175 BindingCallContext cx(cx_, "TestJSImplInterface.overload5");
36176 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36179( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36177 "TestJSImplInterface", "overload5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36179( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36178 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36179( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36179 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36179( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36180
36181 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36182 unsigned argcount = std::min(args.length(), 1u);
36183 switch (argcount) {
36184 case 1: {
36185 if (args[0].isNumber()) {
36186 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36187 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36188 if (objIsXray) {
36189 unwrappedObj.emplace(cx, obj);
36190 }
36191 int32_t arg0;
36192 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36193 return false;
36194 }
36195 if (objIsXray) {
36196 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36197 // we know Xrays have no dynamic unwrap behavior.
36198 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36199 if (!unwrappedObj.ref()) {
36200 return false;
36201 }
36202 }
36203 FastErrorResult rv;
36204 // NOTE: This assert does NOT call the function.
36205 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");
36206 MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36207 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"
)), 0))
) {
36208 return false;
36209 }
36210 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36210); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36210); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36211 args.rval().setUndefined();
36212 return true;
36213 }
36214 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36215 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36216 if (objIsXray) {
36217 unwrappedObj.emplace(cx, obj);
36218 }
36219 MyTestEnum arg0;
36220 {
36221 int index;
36222 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
36223 binding_detail::EnumStrings<MyTestEnum>::Values,
36224 "MyTestEnum", "argument 1",
36225 &index)) {
36226 return false;
36227 }
36228 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", 36228); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 36228); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36229 arg0 = static_cast<MyTestEnum>(index);
36230 }
36231 if (objIsXray) {
36232 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36233 // we know Xrays have no dynamic unwrap behavior.
36234 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36235 if (!unwrappedObj.ref()) {
36236 return false;
36237 }
36238 }
36239 FastErrorResult rv;
36240 // NOTE: This assert does NOT call the function.
36241 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");
36242 MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36243 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"
)), 0))
) {
36244 return false;
36245 }
36246 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36246); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36246); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36247 args.rval().setUndefined();
36248 return true;
36249 break;
36250 }
36251 default: {
36252 // Using nsPrintfCString here would require including that
36253 // header. Let's not worry about it.
36254 nsAutoCString argCountStr;
36255 argCountStr.AppendPrintf("%u", args.length());
36256 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36257 }
36258 }
36259 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36259); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36259); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36260 return false;
36261}
36262
36263static const JSJitInfo overload5_methodinfo = {
36264 { (JSJitGetterOp)overload5 },
36265 { prototypes::id::TestJSImplInterface },
36266 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36267 JSJitInfo::Method,
36268 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36269 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36270 false, /* isInfallible. False in setters. */
36271 false, /* isMovable. Not relevant for setters. */
36272 false, /* isEliminatable. Not relevant for setters. */
36273 false, /* isAlwaysInSlot. Only relevant for getters. */
36274 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36275 false, /* isTypedMethod. Only relevant for methods. */
36276 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36277};
36278
36279MOZ_CAN_RUN_SCRIPT static bool
36280overload6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36281{
36282 BindingCallContext cx(cx_, "TestJSImplInterface.overload6");
36283 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36286( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36284 "TestJSImplInterface", "overload6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36286( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36285 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36286( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36286 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36286( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36287
36288 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36289 unsigned argcount = std::min(args.length(), 1u);
36290 switch (argcount) {
36291 case 1: {
36292 if (args[0].isBoolean()) {
36293 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36294 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36295 if (objIsXray) {
36296 unwrappedObj.emplace(cx, obj);
36297 }
36298 bool arg0;
36299 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36300 return false;
36301 }
36302 if (objIsXray) {
36303 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36304 // we know Xrays have no dynamic unwrap behavior.
36305 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36306 if (!unwrappedObj.ref()) {
36307 return false;
36308 }
36309 }
36310 FastErrorResult rv;
36311 // NOTE: This assert does NOT call the function.
36312 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");
36313 MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36314 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"
)), 0))
) {
36315 return false;
36316 }
36317 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36317); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36317); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36318 args.rval().setUndefined();
36319 return true;
36320 }
36321 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36322 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36323 if (objIsXray) {
36324 unwrappedObj.emplace(cx, obj);
36325 }
36326 int32_t arg0;
36327 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36328 return false;
36329 }
36330 if (objIsXray) {
36331 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36332 // we know Xrays have no dynamic unwrap behavior.
36333 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36334 if (!unwrappedObj.ref()) {
36335 return false;
36336 }
36337 }
36338 FastErrorResult rv;
36339 // NOTE: This assert does NOT call the function.
36340 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");
36341 MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36342 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"
)), 0))
) {
36343 return false;
36344 }
36345 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36345); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36345); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36346 args.rval().setUndefined();
36347 return true;
36348 break;
36349 }
36350 default: {
36351 // Using nsPrintfCString here would require including that
36352 // header. Let's not worry about it.
36353 nsAutoCString argCountStr;
36354 argCountStr.AppendPrintf("%u", args.length());
36355 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36356 }
36357 }
36358 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36358); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36358); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36359 return false;
36360}
36361
36362static const JSJitInfo overload6_methodinfo = {
36363 { (JSJitGetterOp)overload6 },
36364 { prototypes::id::TestJSImplInterface },
36365 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36366 JSJitInfo::Method,
36367 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36368 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36369 false, /* isInfallible. False in setters. */
36370 false, /* isMovable. Not relevant for setters. */
36371 false, /* isEliminatable. Not relevant for setters. */
36372 false, /* isAlwaysInSlot. Only relevant for getters. */
36373 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36374 false, /* isTypedMethod. Only relevant for methods. */
36375 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36376};
36377
36378MOZ_CAN_RUN_SCRIPT static bool
36379overload7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36380{
36381 BindingCallContext cx(cx_, "TestJSImplInterface.overload7");
36382 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36385( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36383 "TestJSImplInterface", "overload7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36385( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36384 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36385( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36385 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36385( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36386
36387 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36388 unsigned argcount = std::min(args.length(), 1u);
36389 switch (argcount) {
36390 case 1: {
36391 if (args[0].isBoolean()) {
36392 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36393 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36394 if (objIsXray) {
36395 unwrappedObj.emplace(cx, obj);
36396 }
36397 bool arg0;
36398 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36399 return false;
36400 }
36401 if (objIsXray) {
36402 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36403 // we know Xrays have no dynamic unwrap behavior.
36404 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36405 if (!unwrappedObj.ref()) {
36406 return false;
36407 }
36408 }
36409 FastErrorResult rv;
36410 // NOTE: This assert does NOT call the function.
36411 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");
36412 MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36413 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36414 return false;
36415 }
36416 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36416); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36416); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36417 args.rval().setUndefined();
36418 return true;
36419 }
36420 if (args[0].isNumber()) {
36421 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36422 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36423 if (objIsXray) {
36424 unwrappedObj.emplace(cx, obj);
36425 }
36426 int32_t arg0;
36427 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36428 return false;
36429 }
36430 if (objIsXray) {
36431 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36432 // we know Xrays have no dynamic unwrap behavior.
36433 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36434 if (!unwrappedObj.ref()) {
36435 return false;
36436 }
36437 }
36438 FastErrorResult rv;
36439 // NOTE: This assert does NOT call the function.
36440 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");
36441 MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36442 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36443 return false;
36444 }
36445 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36445); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36445); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36446 args.rval().setUndefined();
36447 return true;
36448 }
36449 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36450 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36451 if (objIsXray) {
36452 unwrappedObj.emplace(cx, obj);
36453 }
36454 nsCString arg0;
36455 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
36456 return false;
36457 }
36458 if (objIsXray) {
36459 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36460 // we know Xrays have no dynamic unwrap behavior.
36461 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36462 if (!unwrappedObj.ref()) {
36463 return false;
36464 }
36465 }
36466 FastErrorResult rv;
36467 // NOTE: This assert does NOT call the function.
36468 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");
36469 MOZ_KnownLive(self)(self)->Overload7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36471 return false;
36472 }
36473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36473); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36474 args.rval().setUndefined();
36475 return true;
36476 break;
36477 }
36478 default: {
36479 // Using nsPrintfCString here would require including that
36480 // header. Let's not worry about it.
36481 nsAutoCString argCountStr;
36482 argCountStr.AppendPrintf("%u", args.length());
36483 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36484 }
36485 }
36486 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36486); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36486); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36487 return false;
36488}
36489
36490static const JSJitInfo overload7_methodinfo = {
36491 { (JSJitGetterOp)overload7 },
36492 { prototypes::id::TestJSImplInterface },
36493 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36494 JSJitInfo::Method,
36495 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36496 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36497 false, /* isInfallible. False in setters. */
36498 false, /* isMovable. Not relevant for setters. */
36499 false, /* isEliminatable. Not relevant for setters. */
36500 false, /* isAlwaysInSlot. Only relevant for getters. */
36501 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36502 false, /* isTypedMethod. Only relevant for methods. */
36503 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36504};
36505
36506MOZ_CAN_RUN_SCRIPT static bool
36507overload8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36508{
36509 BindingCallContext cx(cx_, "TestJSImplInterface.overload8");
36510 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36513( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36511 "TestJSImplInterface", "overload8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36513( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36512 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36513( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36513 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36513( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36514
36515 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36516 unsigned argcount = std::min(args.length(), 1u);
36517 switch (argcount) {
36518 case 1: {
36519 if (args[0].isObject()) {
36520 do {
36521 NonNull<mozilla::dom::TestJSImplInterface> arg0;
36522 {
36523 // Our JSContext should be in the right global to do unwrapping in.
36524 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
36525 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
36526 break;
36527 }
36528 }
36529 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36530 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36531 if (objIsXray) {
36532 unwrappedObj.emplace(cx, obj);
36533 }
36534 if (objIsXray) {
36535 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36536 // we know Xrays have no dynamic unwrap behavior.
36537 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36538 if (!unwrappedObj.ref()) {
36539 return false;
36540 }
36541 }
36542 FastErrorResult rv;
36543 // NOTE: This assert does NOT call the function.
36544 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");
36545 MOZ_KnownLive(self)(self)->Overload8(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36546 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"
)), 0))
) {
36547 return false;
36548 }
36549 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36549); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36549); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36550 args.rval().setUndefined();
36551 return true;
36552 } while (false);
36553 }
36554 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36555 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36556 if (objIsXray) {
36557 unwrappedObj.emplace(cx, obj);
36558 }
36559 int32_t arg0;
36560 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36561 return false;
36562 }
36563 if (objIsXray) {
36564 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36565 // we know Xrays have no dynamic unwrap behavior.
36566 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36567 if (!unwrappedObj.ref()) {
36568 return false;
36569 }
36570 }
36571 FastErrorResult rv;
36572 // NOTE: This assert does NOT call the function.
36573 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");
36574 MOZ_KnownLive(self)(self)->Overload8(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36575 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"
)), 0))
) {
36576 return false;
36577 }
36578 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36578); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36578); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36579 args.rval().setUndefined();
36580 return true;
36581 break;
36582 }
36583 default: {
36584 // Using nsPrintfCString here would require including that
36585 // header. Let's not worry about it.
36586 nsAutoCString argCountStr;
36587 argCountStr.AppendPrintf("%u", args.length());
36588 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36589 }
36590 }
36591 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36591); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36591); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36592 return false;
36593}
36594
36595static const JSJitInfo overload8_methodinfo = {
36596 { (JSJitGetterOp)overload8 },
36597 { prototypes::id::TestJSImplInterface },
36598 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36599 JSJitInfo::Method,
36600 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36601 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36602 false, /* isInfallible. False in setters. */
36603 false, /* isMovable. Not relevant for setters. */
36604 false, /* isEliminatable. Not relevant for setters. */
36605 false, /* isAlwaysInSlot. Only relevant for getters. */
36606 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36607 false, /* isTypedMethod. Only relevant for methods. */
36608 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36609};
36610
36611MOZ_CAN_RUN_SCRIPT static bool
36612overload9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36613{
36614 BindingCallContext cx(cx_, "TestJSImplInterface.overload9");
36615 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36618( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36616 "TestJSImplInterface", "overload9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36618( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36617 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36618( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36618 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36618( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36619
36620 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36621 unsigned argcount = std::min(args.length(), 1u);
36622 switch (argcount) {
36623 case 1: {
36624 if (args[0].isNullOrUndefined()) {
36625 Nullable<int32_t> arg0;
36626 if (args[0].isNullOrUndefined()) {
36627 arg0.SetNull();
36628 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36629 return false;
36630 }
36631 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36632 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36633 if (objIsXray) {
36634 unwrappedObj.emplace(cx, obj);
36635 }
36636 if (objIsXray) {
36637 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36638 // we know Xrays have no dynamic unwrap behavior.
36639 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36640 if (!unwrappedObj.ref()) {
36641 return false;
36642 }
36643 }
36644 FastErrorResult rv;
36645 // NOTE: This assert does NOT call the function.
36646 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");
36647 MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36648 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36649 return false;
36650 }
36651 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36651); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36652 args.rval().setUndefined();
36653 return true;
36654 }
36655 if (args[0].isNumber()) {
36656 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36657 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36658 if (objIsXray) {
36659 unwrappedObj.emplace(cx, obj);
36660 }
36661 Nullable<int32_t> arg0;
36662 if (args[0].isNullOrUndefined()) {
36663 arg0.SetNull();
36664 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36665 return false;
36666 }
36667 if (objIsXray) {
36668 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36669 // we know Xrays have no dynamic unwrap behavior.
36670 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36671 if (!unwrappedObj.ref()) {
36672 return false;
36673 }
36674 }
36675 FastErrorResult rv;
36676 // NOTE: This assert does NOT call the function.
36677 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");
36678 MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36679 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36680 return false;
36681 }
36682 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36682); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36682); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36683 args.rval().setUndefined();
36684 return true;
36685 }
36686 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36687 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36688 if (objIsXray) {
36689 unwrappedObj.emplace(cx, obj);
36690 }
36691 binding_detail::FakeString<char16_t> arg0;
36692 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
36693 return false;
36694 }
36695 if (objIsXray) {
36696 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36697 // we know Xrays have no dynamic unwrap behavior.
36698 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36699 if (!unwrappedObj.ref()) {
36700 return false;
36701 }
36702 }
36703 FastErrorResult rv;
36704 // NOTE: This assert does NOT call the function.
36705 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");
36706 MOZ_KnownLive(self)(self)->Overload9(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36707 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36708 return false;
36709 }
36710 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36710); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36710); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36711 args.rval().setUndefined();
36712 return true;
36713 break;
36714 }
36715 default: {
36716 // Using nsPrintfCString here would require including that
36717 // header. Let's not worry about it.
36718 nsAutoCString argCountStr;
36719 argCountStr.AppendPrintf("%u", args.length());
36720 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36721 }
36722 }
36723 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36723); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36723); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36724 return false;
36725}
36726
36727static const JSJitInfo overload9_methodinfo = {
36728 { (JSJitGetterOp)overload9 },
36729 { prototypes::id::TestJSImplInterface },
36730 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36731 JSJitInfo::Method,
36732 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36733 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36734 false, /* isInfallible. False in setters. */
36735 false, /* isMovable. Not relevant for setters. */
36736 false, /* isEliminatable. Not relevant for setters. */
36737 false, /* isAlwaysInSlot. Only relevant for getters. */
36738 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36739 false, /* isTypedMethod. Only relevant for methods. */
36740 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36741};
36742
36743MOZ_CAN_RUN_SCRIPT static bool
36744overload10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36745{
36746 BindingCallContext cx(cx_, "TestJSImplInterface.overload10");
36747 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36750( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36748 "TestJSImplInterface", "overload10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36750( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36749 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36750( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36750 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36750( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36751
36752 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36753 unsigned argcount = std::min(args.length(), 1u);
36754 switch (argcount) {
36755 case 1: {
36756 if (args[0].isObject()) {
36757 do {
36758 JS::Rooted<JSObject*> arg0(cx);
36759#ifdef __clang__1
36760#pragma clang diagnostic push
36761#pragma clang diagnostic ignored "-Wunreachable-code"
36762#pragma clang diagnostic ignored "-Wunreachable-code-return"
36763#endif // __clang__
36764 if ((true) && !CallerSubsumes(args[0])) {
36765 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
36766 return false;
36767 }
36768#ifdef __clang__1
36769#pragma clang diagnostic pop
36770#endif // __clang__
36771 arg0 = &args[0].toObject();
36772 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36773 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36774 if (objIsXray) {
36775 unwrappedObj.emplace(cx, obj);
36776 }
36777 if (objIsXray) {
36778 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36779 // we know Xrays have no dynamic unwrap behavior.
36780 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36781 if (!unwrappedObj.ref()) {
36782 return false;
36783 }
36784 }
36785 FastErrorResult rv;
36786 // NOTE: This assert does NOT call the function.
36787 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");
36788 MOZ_KnownLive(self)(self)->Overload10(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36789 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"
)), 0))
) {
36790 return false;
36791 }
36792 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36792); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36792); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36793 args.rval().setUndefined();
36794 return true;
36795 } while (false);
36796 }
36797 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36798 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36799 if (objIsXray) {
36800 unwrappedObj.emplace(cx, obj);
36801 }
36802 Nullable<int32_t> arg0;
36803 if (args[0].isNullOrUndefined()) {
36804 arg0.SetNull();
36805 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36806 return false;
36807 }
36808 if (objIsXray) {
36809 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36810 // we know Xrays have no dynamic unwrap behavior.
36811 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36812 if (!unwrappedObj.ref()) {
36813 return false;
36814 }
36815 }
36816 FastErrorResult rv;
36817 // NOTE: This assert does NOT call the function.
36818 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");
36819 MOZ_KnownLive(self)(self)->Overload10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36820 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"
)), 0))
) {
36821 return false;
36822 }
36823 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36823); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36823); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36824 args.rval().setUndefined();
36825 return true;
36826 break;
36827 }
36828 default: {
36829 // Using nsPrintfCString here would require including that
36830 // header. Let's not worry about it.
36831 nsAutoCString argCountStr;
36832 argCountStr.AppendPrintf("%u", args.length());
36833 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36834 }
36835 }
36836 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36836); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36836); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36837 return false;
36838}
36839
36840static const JSJitInfo overload10_methodinfo = {
36841 { (JSJitGetterOp)overload10 },
36842 { prototypes::id::TestJSImplInterface },
36843 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36844 JSJitInfo::Method,
36845 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36846 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36847 false, /* isInfallible. False in setters. */
36848 false, /* isMovable. Not relevant for setters. */
36849 false, /* isEliminatable. Not relevant for setters. */
36850 false, /* isAlwaysInSlot. Only relevant for getters. */
36851 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36852 false, /* isTypedMethod. Only relevant for methods. */
36853 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36854};
36855
36856MOZ_CAN_RUN_SCRIPT static bool
36857overload11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36858{
36859 BindingCallContext cx(cx_, "TestJSImplInterface.overload11");
36860 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36863( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36861 "TestJSImplInterface", "overload11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36863( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36862 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36863( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36863 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36863( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36864
36865 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36866 unsigned argcount = std::min(args.length(), 1u);
36867 switch (argcount) {
36868 case 1: {
36869 if (args[0].isNumber()) {
36870 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36871 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36872 if (objIsXray) {
36873 unwrappedObj.emplace(cx, obj);
36874 }
36875 int32_t arg0;
36876 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36877 return false;
36878 }
36879 if (objIsXray) {
36880 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36881 // we know Xrays have no dynamic unwrap behavior.
36882 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36883 if (!unwrappedObj.ref()) {
36884 return false;
36885 }
36886 }
36887 FastErrorResult rv;
36888 // NOTE: This assert does NOT call the function.
36889 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");
36890 MOZ_KnownLive(self)(self)->Overload11(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36891 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"
)), 0))
) {
36892 return false;
36893 }
36894 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36894); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36894); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36895 args.rval().setUndefined();
36896 return true;
36897 }
36898 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36899 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36900 if (objIsXray) {
36901 unwrappedObj.emplace(cx, obj);
36902 }
36903 binding_detail::FakeString<char16_t> arg0;
36904 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
36905 return false;
36906 }
36907 if (objIsXray) {
36908 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36909 // we know Xrays have no dynamic unwrap behavior.
36910 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36911 if (!unwrappedObj.ref()) {
36912 return false;
36913 }
36914 }
36915 FastErrorResult rv;
36916 // NOTE: This assert does NOT call the function.
36917 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");
36918 MOZ_KnownLive(self)(self)->Overload11(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36919 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"
)), 0))
) {
36920 return false;
36921 }
36922 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36922); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36923 args.rval().setUndefined();
36924 return true;
36925 break;
36926 }
36927 default: {
36928 // Using nsPrintfCString here would require including that
36929 // header. Let's not worry about it.
36930 nsAutoCString argCountStr;
36931 argCountStr.AppendPrintf("%u", args.length());
36932 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36933 }
36934 }
36935 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36935); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 36935); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36936 return false;
36937}
36938
36939static const JSJitInfo overload11_methodinfo = {
36940 { (JSJitGetterOp)overload11 },
36941 { prototypes::id::TestJSImplInterface },
36942 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36943 JSJitInfo::Method,
36944 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36945 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36946 false, /* isInfallible. False in setters. */
36947 false, /* isMovable. Not relevant for setters. */
36948 false, /* isEliminatable. Not relevant for setters. */
36949 false, /* isAlwaysInSlot. Only relevant for getters. */
36950 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36951 false, /* isTypedMethod. Only relevant for methods. */
36952 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36953};
36954
36955MOZ_CAN_RUN_SCRIPT static bool
36956overload12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36957{
36958 BindingCallContext cx(cx_, "TestJSImplInterface.overload12");
36959 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36962( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36960 "TestJSImplInterface", "overload12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36962( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36961 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36962( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36962 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36962( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36963
36964 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36965 unsigned argcount = std::min(args.length(), 1u);
36966 switch (argcount) {
36967 case 1: {
36968 if (args[0].isNullOrUndefined()) {
36969 Nullable<bool> arg0;
36970 if (args[0].isNullOrUndefined()) {
36971 arg0.SetNull();
36972 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36973 return false;
36974 }
36975 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36976 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36977 if (objIsXray) {
36978 unwrappedObj.emplace(cx, obj);
36979 }
36980 if (objIsXray) {
36981 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36982 // we know Xrays have no dynamic unwrap behavior.
36983 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36984 if (!unwrappedObj.ref()) {
36985 return false;
36986 }
36987 }
36988 FastErrorResult rv;
36989 // NOTE: This assert does NOT call the function.
36990 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");
36991 MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36992 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
36993 return false;
36994 }
36995 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 36995); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
36996 args.rval().setUndefined();
36997 return true;
36998 }
36999 if (args[0].isBoolean()) {
37000 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37001 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37002 if (objIsXray) {
37003 unwrappedObj.emplace(cx, obj);
37004 }
37005 Nullable<bool> arg0;
37006 if (args[0].isNullOrUndefined()) {
37007 arg0.SetNull();
37008 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
37009 return false;
37010 }
37011 if (objIsXray) {
37012 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37013 // we know Xrays have no dynamic unwrap behavior.
37014 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37015 if (!unwrappedObj.ref()) {
37016 return false;
37017 }
37018 }
37019 FastErrorResult rv;
37020 // NOTE: This assert does NOT call the function.
37021 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");
37022 MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37023 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
37024 return false;
37025 }
37026 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37026); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37027 args.rval().setUndefined();
37028 return true;
37029 }
37030 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37031 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37032 if (objIsXray) {
37033 unwrappedObj.emplace(cx, obj);
37034 }
37035 int32_t arg0;
37036 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37037 return false;
37038 }
37039 if (objIsXray) {
37040 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37041 // we know Xrays have no dynamic unwrap behavior.
37042 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37043 if (!unwrappedObj.ref()) {
37044 return false;
37045 }
37046 }
37047 FastErrorResult rv;
37048 // NOTE: This assert does NOT call the function.
37049 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");
37050 MOZ_KnownLive(self)(self)->Overload12(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37051 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
37052 return false;
37053 }
37054 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37054); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37054); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37055 args.rval().setUndefined();
37056 return true;
37057 break;
37058 }
37059 default: {
37060 // Using nsPrintfCString here would require including that
37061 // header. Let's not worry about it.
37062 nsAutoCString argCountStr;
37063 argCountStr.AppendPrintf("%u", args.length());
37064 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37065 }
37066 }
37067 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37067); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37067); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37068 return false;
37069}
37070
37071static const JSJitInfo overload12_methodinfo = {
37072 { (JSJitGetterOp)overload12 },
37073 { prototypes::id::TestJSImplInterface },
37074 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37075 JSJitInfo::Method,
37076 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37077 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37078 false, /* isInfallible. False in setters. */
37079 false, /* isMovable. Not relevant for setters. */
37080 false, /* isEliminatable. Not relevant for setters. */
37081 false, /* isAlwaysInSlot. Only relevant for getters. */
37082 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37083 false, /* isTypedMethod. Only relevant for methods. */
37084 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37085};
37086
37087MOZ_CAN_RUN_SCRIPT static bool
37088overload13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37089{
37090 BindingCallContext cx(cx_, "TestJSImplInterface.overload13");
37091 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37094( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37092 "TestJSImplInterface", "overload13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37094( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37093 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37094( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37094 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37094( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37095
37096 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37097 unsigned argcount = std::min(args.length(), 1u);
37098 switch (argcount) {
37099 case 1: {
37100 if (args[0].isBoolean()) {
37101 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37102 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37103 if (objIsXray) {
37104 unwrappedObj.emplace(cx, obj);
37105 }
37106 bool arg0;
37107 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37108 return false;
37109 }
37110 if (objIsXray) {
37111 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37112 // we know Xrays have no dynamic unwrap behavior.
37113 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37114 if (!unwrappedObj.ref()) {
37115 return false;
37116 }
37117 }
37118 FastErrorResult rv;
37119 // NOTE: This assert does NOT call the function.
37120 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");
37121 MOZ_KnownLive(self)(self)->Overload13(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37122 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"
)), 0))
) {
37123 return false;
37124 }
37125 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37125); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37125); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37126 args.rval().setUndefined();
37127 return true;
37128 }
37129 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37130 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37131 if (objIsXray) {
37132 unwrappedObj.emplace(cx, obj);
37133 }
37134 Nullable<int32_t> arg0;
37135 if (args[0].isNullOrUndefined()) {
37136 arg0.SetNull();
37137 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
37138 return false;
37139 }
37140 if (objIsXray) {
37141 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37142 // we know Xrays have no dynamic unwrap behavior.
37143 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37144 if (!unwrappedObj.ref()) {
37145 return false;
37146 }
37147 }
37148 FastErrorResult rv;
37149 // NOTE: This assert does NOT call the function.
37150 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");
37151 MOZ_KnownLive(self)(self)->Overload13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37152 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"
)), 0))
) {
37153 return false;
37154 }
37155 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37155); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37155); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37156 args.rval().setUndefined();
37157 return true;
37158 break;
37159 }
37160 default: {
37161 // Using nsPrintfCString here would require including that
37162 // header. Let's not worry about it.
37163 nsAutoCString argCountStr;
37164 argCountStr.AppendPrintf("%u", args.length());
37165 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37166 }
37167 }
37168 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37168); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37168); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37169 return false;
37170}
37171
37172static const JSJitInfo overload13_methodinfo = {
37173 { (JSJitGetterOp)overload13 },
37174 { prototypes::id::TestJSImplInterface },
37175 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37176 JSJitInfo::Method,
37177 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37178 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37179 false, /* isInfallible. False in setters. */
37180 false, /* isMovable. Not relevant for setters. */
37181 false, /* isEliminatable. Not relevant for setters. */
37182 false, /* isAlwaysInSlot. Only relevant for getters. */
37183 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37184 false, /* isTypedMethod. Only relevant for methods. */
37185 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37186};
37187
37188MOZ_CAN_RUN_SCRIPT static bool
37189overload14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37190{
37191 BindingCallContext cx(cx_, "TestJSImplInterface.overload14");
37192 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37195( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37193 "TestJSImplInterface", "overload14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37195( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37194 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37195( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37195 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37195( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37196
37197 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37198 unsigned argcount = std::min(args.length(), 1u);
37199 switch (argcount) {
37200 case 0: {
37201 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37202 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37203 if (objIsXray) {
37204 unwrappedObj.emplace(cx, obj);
37205 }
37206 Optional<int32_t> arg0;
37207 if (args.hasDefined(0)) {
37208 arg0.Construct();
37209 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
37210 return false;
37211 }
37212 }
37213 if (objIsXray) {
37214 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37215 // we know Xrays have no dynamic unwrap behavior.
37216 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37217 if (!unwrappedObj.ref()) {
37218 return false;
37219 }
37220 }
37221 FastErrorResult rv;
37222 // NOTE: This assert does NOT call the function.
37223 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");
37224 MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37225 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37226 return false;
37227 }
37228 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37228); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37228); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37229 args.rval().setUndefined();
37230 return true;
37231 break;
37232 }
37233 case 1: {
37234 if (args[0].isObject()) {
37235 do {
37236 NonNull<mozilla::dom::TestInterface> arg0;
37237 {
37238 // Our JSContext should be in the right global to do unwrapping in.
37239 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx);
37240 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37241 break;
37242 }
37243 }
37244 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37245 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37246 if (objIsXray) {
37247 unwrappedObj.emplace(cx, obj);
37248 }
37249 if (objIsXray) {
37250 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37251 // we know Xrays have no dynamic unwrap behavior.
37252 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37253 if (!unwrappedObj.ref()) {
37254 return false;
37255 }
37256 }
37257 FastErrorResult rv;
37258 // NOTE: This assert does NOT call the function.
37259 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");
37260 MOZ_KnownLive(self)(self)->Overload14(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37261 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37262 return false;
37263 }
37264 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37264); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37264); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37265 args.rval().setUndefined();
37266 return true;
37267 } while (false);
37268 }
37269 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37270 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37271 if (objIsXray) {
37272 unwrappedObj.emplace(cx, obj);
37273 }
37274 Optional<int32_t> arg0;
37275 if (args.hasDefined(0)) {
37276 arg0.Construct();
37277 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
37278 return false;
37279 }
37280 }
37281 if (objIsXray) {
37282 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37283 // we know Xrays have no dynamic unwrap behavior.
37284 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37285 if (!unwrappedObj.ref()) {
37286 return false;
37287 }
37288 }
37289 FastErrorResult rv;
37290 // NOTE: This assert does NOT call the function.
37291 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");
37292 MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37293 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37294 return false;
37295 }
37296 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37296); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37296); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37297 args.rval().setUndefined();
37298 return true;
37299 break;
37300 }
37301 default: {
37302 // Using nsPrintfCString here would require including that
37303 // header. Let's not worry about it.
37304 nsAutoCString argCountStr;
37305 argCountStr.AppendPrintf("%u", args.length());
37306 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37307 }
37308 }
37309 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37309); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37309); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37310 return false;
37311}
37312
37313static const JSJitInfo overload14_methodinfo = {
37314 { (JSJitGetterOp)overload14 },
37315 { prototypes::id::TestJSImplInterface },
37316 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37317 JSJitInfo::Method,
37318 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37319 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37320 false, /* isInfallible. False in setters. */
37321 false, /* isMovable. Not relevant for setters. */
37322 false, /* isEliminatable. Not relevant for setters. */
37323 false, /* isAlwaysInSlot. Only relevant for getters. */
37324 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37325 false, /* isTypedMethod. Only relevant for methods. */
37326 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37327};
37328
37329MOZ_CAN_RUN_SCRIPT static bool
37330overload15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37331{
37332 BindingCallContext cx(cx_, "TestJSImplInterface.overload15");
37333 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37336( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37334 "TestJSImplInterface", "overload15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37336( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37335 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37336( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37336 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37336( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37337
37338 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37339 unsigned argcount = std::min(args.length(), 1u);
37340 switch (argcount) {
37341 case 0: {
37342 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37343 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37344 if (objIsXray) {
37345 unwrappedObj.emplace(cx, obj);
37346 }
37347 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37348 if (args.hasDefined(0)) {
37349 arg0.Construct();
37350 if (args[0].isObject()) {
37351 {
37352 // Our JSContext should be in the right global to do unwrapping in.
37353 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37354 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37355 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37356 return false;
37357 }
37358 }
37359 } else {
37360 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37361 return false;
37362 }
37363 }
37364 if (objIsXray) {
37365 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37366 // we know Xrays have no dynamic unwrap behavior.
37367 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37368 if (!unwrappedObj.ref()) {
37369 return false;
37370 }
37371 }
37372 FastErrorResult rv;
37373 // NOTE: This assert does NOT call the function.
37374 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");
37375 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37376 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37377 return false;
37378 }
37379 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37379); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37379); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37380 args.rval().setUndefined();
37381 return true;
37382 break;
37383 }
37384 case 1: {
37385 if (args[0].isUndefined()) {
37386 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37387 if (args.hasDefined(0)) {
37388 arg0.Construct();
37389 if (args[0].isObject()) {
37390 {
37391 // Our JSContext should be in the right global to do unwrapping in.
37392 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37393 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37394 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37395 return false;
37396 }
37397 }
37398 } else {
37399 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37400 return false;
37401 }
37402 }
37403 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37404 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37405 if (objIsXray) {
37406 unwrappedObj.emplace(cx, obj);
37407 }
37408 if (objIsXray) {
37409 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37410 // we know Xrays have no dynamic unwrap behavior.
37411 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37412 if (!unwrappedObj.ref()) {
37413 return false;
37414 }
37415 }
37416 FastErrorResult rv;
37417 // NOTE: This assert does NOT call the function.
37418 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");
37419 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37420 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37421 return false;
37422 }
37423 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37423); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37423); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37424 args.rval().setUndefined();
37425 return true;
37426 }
37427 if (args[0].isObject()) {
37428 do {
37429 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37430 if (args.hasDefined(0)) {
37431 arg0.Construct();
37432 {
37433 // Our JSContext should be in the right global to do unwrapping in.
37434 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37435 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37436 break;
37437 }
37438 }
37439 }
37440 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37441 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37442 if (objIsXray) {
37443 unwrappedObj.emplace(cx, obj);
37444 }
37445 if (objIsXray) {
37446 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37447 // we know Xrays have no dynamic unwrap behavior.
37448 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37449 if (!unwrappedObj.ref()) {
37450 return false;
37451 }
37452 }
37453 FastErrorResult rv;
37454 // NOTE: This assert does NOT call the function.
37455 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");
37456 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37457 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37458 return false;
37459 }
37460 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37460); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37460); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37461 args.rval().setUndefined();
37462 return true;
37463 } while (false);
37464 }
37465 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37466 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37467 if (objIsXray) {
37468 unwrappedObj.emplace(cx, obj);
37469 }
37470 int32_t arg0;
37471 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37472 return false;
37473 }
37474 if (objIsXray) {
37475 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37476 // we know Xrays have no dynamic unwrap behavior.
37477 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37478 if (!unwrappedObj.ref()) {
37479 return false;
37480 }
37481 }
37482 FastErrorResult rv;
37483 // NOTE: This assert does NOT call the function.
37484 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");
37485 MOZ_KnownLive(self)(self)->Overload15(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37486 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37487 return false;
37488 }
37489 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37489); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37489); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37490 args.rval().setUndefined();
37491 return true;
37492 break;
37493 }
37494 default: {
37495 // Using nsPrintfCString here would require including that
37496 // header. Let's not worry about it.
37497 nsAutoCString argCountStr;
37498 argCountStr.AppendPrintf("%u", args.length());
37499 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37500 }
37501 }
37502 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37502); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37502); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37503 return false;
37504}
37505
37506static const JSJitInfo overload15_methodinfo = {
37507 { (JSJitGetterOp)overload15 },
37508 { prototypes::id::TestJSImplInterface },
37509 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37510 JSJitInfo::Method,
37511 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37512 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37513 false, /* isInfallible. False in setters. */
37514 false, /* isMovable. Not relevant for setters. */
37515 false, /* isEliminatable. Not relevant for setters. */
37516 false, /* isAlwaysInSlot. Only relevant for getters. */
37517 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37518 false, /* isTypedMethod. Only relevant for methods. */
37519 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37520};
37521
37522MOZ_CAN_RUN_SCRIPT static bool
37523overload16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37524{
37525 BindingCallContext cx(cx_, "TestJSImplInterface.overload16");
37526 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37529( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37527 "TestJSImplInterface", "overload16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37529( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37528 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37529( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37529 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37529( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37530
37531 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37532 unsigned argcount = std::min(args.length(), 1u);
37533 switch (argcount) {
37534 case 0: {
37535 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37536 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37537 if (objIsXray) {
37538 unwrappedObj.emplace(cx, obj);
37539 }
37540 Optional<mozilla::dom::TestInterface*> arg0;
37541 if (args.hasDefined(0)) {
37542 arg0.Construct();
37543 if (args[0].isObject()) {
37544 {
37545 // Our JSContext should be in the right global to do unwrapping in.
37546 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37547 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37548 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37549 return false;
37550 }
37551 }
37552 } else if (args[0].isNullOrUndefined()) {
37553 arg0.Value() = nullptr;
37554 } else {
37555 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37556 return false;
37557 }
37558 }
37559 if (objIsXray) {
37560 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37561 // we know Xrays have no dynamic unwrap behavior.
37562 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37563 if (!unwrappedObj.ref()) {
37564 return false;
37565 }
37566 }
37567 FastErrorResult rv;
37568 // NOTE: This assert does NOT call the function.
37569 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");
37570 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37571 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37572 return false;
37573 }
37574 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37574); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37574); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37575 args.rval().setUndefined();
37576 return true;
37577 break;
37578 }
37579 case 1: {
37580 if (args[0].isNullOrUndefined()) {
37581 Optional<mozilla::dom::TestInterface*> arg0;
37582 if (args.hasDefined(0)) {
37583 arg0.Construct();
37584 arg0.Value() = nullptr;
37585 }
37586 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37587 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37588 if (objIsXray) {
37589 unwrappedObj.emplace(cx, obj);
37590 }
37591 if (objIsXray) {
37592 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37593 // we know Xrays have no dynamic unwrap behavior.
37594 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37595 if (!unwrappedObj.ref()) {
37596 return false;
37597 }
37598 }
37599 FastErrorResult rv;
37600 // NOTE: This assert does NOT call the function.
37601 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");
37602 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37603 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37604 return false;
37605 }
37606 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37606); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37606); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37607 args.rval().setUndefined();
37608 return true;
37609 }
37610 if (args[0].isObject()) {
37611 do {
37612 Optional<mozilla::dom::TestInterface*> arg0;
37613 if (args.hasDefined(0)) {
37614 arg0.Construct();
37615 {
37616 // Our JSContext should be in the right global to do unwrapping in.
37617 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37618 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37619 break;
37620 }
37621 }
37622 }
37623 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37624 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37625 if (objIsXray) {
37626 unwrappedObj.emplace(cx, obj);
37627 }
37628 if (objIsXray) {
37629 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37630 // we know Xrays have no dynamic unwrap behavior.
37631 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37632 if (!unwrappedObj.ref()) {
37633 return false;
37634 }
37635 }
37636 FastErrorResult rv;
37637 // NOTE: This assert does NOT call the function.
37638 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");
37639 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37640 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37641 return false;
37642 }
37643 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37643); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37643); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37644 args.rval().setUndefined();
37645 return true;
37646 } while (false);
37647 }
37648 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37649 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37650 if (objIsXray) {
37651 unwrappedObj.emplace(cx, obj);
37652 }
37653 int32_t arg0;
37654 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37655 return false;
37656 }
37657 if (objIsXray) {
37658 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37659 // we know Xrays have no dynamic unwrap behavior.
37660 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37661 if (!unwrappedObj.ref()) {
37662 return false;
37663 }
37664 }
37665 FastErrorResult rv;
37666 // NOTE: This assert does NOT call the function.
37667 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");
37668 MOZ_KnownLive(self)(self)->Overload16(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37669 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37670 return false;
37671 }
37672 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37672); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37673 args.rval().setUndefined();
37674 return true;
37675 break;
37676 }
37677 default: {
37678 // Using nsPrintfCString here would require including that
37679 // header. Let's not worry about it.
37680 nsAutoCString argCountStr;
37681 argCountStr.AppendPrintf("%u", args.length());
37682 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37683 }
37684 }
37685 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37685); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37685); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37686 return false;
37687}
37688
37689static const JSJitInfo overload16_methodinfo = {
37690 { (JSJitGetterOp)overload16 },
37691 { prototypes::id::TestJSImplInterface },
37692 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37693 JSJitInfo::Method,
37694 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37695 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37696 false, /* isInfallible. False in setters. */
37697 false, /* isMovable. Not relevant for setters. */
37698 false, /* isEliminatable. Not relevant for setters. */
37699 false, /* isAlwaysInSlot. Only relevant for getters. */
37700 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37701 false, /* isTypedMethod. Only relevant for methods. */
37702 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37703};
37704
37705MOZ_CAN_RUN_SCRIPT static bool
37706overload17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37707{
37708 BindingCallContext cx(cx_, "TestJSImplInterface.overload17");
37709 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37712( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37710 "TestJSImplInterface", "overload17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37712( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37711 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37712( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37712 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37712( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37713
37714 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37715 unsigned argcount = std::min(args.length(), 1u);
37716 switch (argcount) {
37717 case 1: {
37718 if (args[0].isObject()) {
37719 do {
37720 binding_detail::AutoSequence<int32_t> arg0;
37721 JS::ForOfIterator iter(cx);
37722 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
37723 return false;
37724 }
37725 if (!iter.valueIsIterable()) {
37726 break;
37727 }
37728 binding_detail::AutoSequence<int32_t> &arr = arg0;
37729 JS::Rooted<JS::Value> temp(cx);
37730 while (true) {
37731 bool done;
37732 if (!iter.next(&temp, &done)) {
37733 return false;
37734 }
37735 if (done) {
37736 break;
37737 }
37738 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
37739 if (!slotPtr) {
37740 JS_ReportOutOfMemory(cx);
37741 return false;
37742 }
37743 int32_t& slot = *slotPtr;
37744 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
37745 return false;
37746 }
37747 }
37748 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37749 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37750 if (objIsXray) {
37751 unwrappedObj.emplace(cx, obj);
37752 }
37753 if (objIsXray) {
37754 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37755 // we know Xrays have no dynamic unwrap behavior.
37756 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37757 if (!unwrappedObj.ref()) {
37758 return false;
37759 }
37760 }
37761 FastErrorResult rv;
37762 // NOTE: This assert does NOT call the function.
37763 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");
37764 MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37765 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"
)), 0))
) {
37766 return false;
37767 }
37768 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37768); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37768); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37769 args.rval().setUndefined();
37770 return true;
37771 } while (false);
37772 do {
37773 Record<nsString, int32_t> arg0;
37774 auto& recordEntries = arg0.Entries();
37775
37776 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
37777 JS::RootedVector<jsid> ids(cx);
37778 if (!js::GetPropertyKeys(cx, recordObj,
37779 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
37780 return false;
37781 }
37782 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
37783 JS_ReportOutOfMemory(cx);
37784 return false;
37785 }
37786 JS::Rooted<JS::Value> propNameValue(cx);
37787 JS::Rooted<JS::Value> temp(cx);
37788 JS::Rooted<jsid> curId(cx);
37789 JS::Rooted<JS::Value> idVal(cx);
37790 // Use a hashset to keep track of ids seen, to avoid
37791 // introducing nasty O(N^2) behavior scanning for them all the
37792 // time. Ideally we'd use a data structure with O(1) lookup
37793 // _and_ ordering for the MozMap, but we don't have one lying
37794 // around.
37795 nsTHashtable<nsStringHashKey> idsSeen;
37796 for (size_t i = 0; i < ids.length(); ++i) {
37797 curId = ids[i];
37798
37799 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
37800 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
37801 &desc)) {
37802 return false;
37803 }
37804
37805 if (desc.isNothing() || !desc->enumerable()) {
37806 continue;
37807 }
37808
37809 idVal = js::IdToValue(curId);
37810 nsString propName;
37811 // This will just throw if idVal is a Symbol, like the spec says
37812 // to do.
37813 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
37814 return false;
37815 }
37816
37817 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
37818 return false;
37819 }
37820
37821 Record<nsString, int32_t>::EntryType* entry;
37822 if (!idsSeen.EnsureInserted(propName)) {
37823 // Find the existing entry.
37824 auto idx = recordEntries.IndexOf(propName);
37825 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", 37826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 37826); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
37826 "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", 37826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 37826); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
37827 // Now blow it away to make it look like it was just added
37828 // to the array, because it's not obvious that it's
37829 // safe to write to its already-initialized mValue via our
37830 // normal codegen conversions. For example, the value
37831 // could be a union and this would change its type, but
37832 // codegen assumes we won't do that.
37833 entry = recordEntries.ReconstructElementAt(idx);
37834 } else {
37835 // Safe to do an infallible append here, because we did a
37836 // SetCapacity above to the right capacity.
37837 entry = recordEntries.AppendElement();
37838 }
37839 entry->mKey = propName;
37840 int32_t& slot = entry->mValue;
37841 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
37842 return false;
37843 }
37844 }
37845 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37846 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37847 if (objIsXray) {
37848 unwrappedObj.emplace(cx, obj);
37849 }
37850 if (objIsXray) {
37851 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37852 // we know Xrays have no dynamic unwrap behavior.
37853 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37854 if (!unwrappedObj.ref()) {
37855 return false;
37856 }
37857 }
37858 FastErrorResult rv;
37859 // NOTE: This assert does NOT call the function.
37860 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");
37861 MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37862 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"
)), 0))
) {
37863 return false;
37864 }
37865 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37865); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37865); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37866 args.rval().setUndefined();
37867 return true;
37868 } while (false);
37869 }
37870 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
37871 break;
37872 }
37873 default: {
37874 // Using nsPrintfCString here would require including that
37875 // header. Let's not worry about it.
37876 nsAutoCString argCountStr;
37877 argCountStr.AppendPrintf("%u", args.length());
37878 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37879 }
37880 }
37881 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37881); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 37881); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37882 return false;
37883}
37884
37885static const JSJitInfo overload17_methodinfo = {
37886 { (JSJitGetterOp)overload17 },
37887 { prototypes::id::TestJSImplInterface },
37888 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37889 JSJitInfo::Method,
37890 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37891 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37892 false, /* isInfallible. False in setters. */
37893 false, /* isMovable. Not relevant for setters. */
37894 false, /* isEliminatable. Not relevant for setters. */
37895 false, /* isAlwaysInSlot. Only relevant for getters. */
37896 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37897 false, /* isTypedMethod. Only relevant for methods. */
37898 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37899};
37900
37901MOZ_CAN_RUN_SCRIPT static bool
37902overload18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37903{
37904 BindingCallContext cx(cx_, "TestJSImplInterface.overload18");
37905 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37908( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37906 "TestJSImplInterface", "overload18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37908( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37907 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37908( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37908 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37908( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37909
37910 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37911 unsigned argcount = std::min(args.length(), 1u);
37912 switch (argcount) {
37913 case 1: {
37914 if (args[0].isObject()) {
37915 do {
37916 binding_detail::AutoSequence<nsString> arg0;
37917 JS::ForOfIterator iter(cx);
37918 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
37919 return false;
37920 }
37921 if (!iter.valueIsIterable()) {
37922 break;
37923 }
37924 binding_detail::AutoSequence<nsString> &arr = arg0;
37925 JS::Rooted<JS::Value> temp(cx);
37926 while (true) {
37927 bool done;
37928 if (!iter.next(&temp, &done)) {
37929 return false;
37930 }
37931 if (done) {
37932 break;
37933 }
37934 nsString* slotPtr = arr.AppendElement(mozilla::fallible);
37935 if (!slotPtr) {
37936 JS_ReportOutOfMemory(cx);
37937 return false;
37938 }
37939 nsString& slot = *slotPtr;
37940 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
37941 return false;
37942 }
37943 }
37944 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37945 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37946 if (objIsXray) {
37947 unwrappedObj.emplace(cx, obj);
37948 }
37949 if (objIsXray) {
37950 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37951 // we know Xrays have no dynamic unwrap behavior.
37952 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37953 if (!unwrappedObj.ref()) {
37954 return false;
37955 }
37956 }
37957 FastErrorResult rv;
37958 // NOTE: This assert does NOT call the function.
37959 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");
37960 MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37961 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"
)), 0))
) {
37962 return false;
37963 }
37964 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37964); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 37964); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
37965 args.rval().setUndefined();
37966 return true;
37967 } while (false);
37968 do {
37969 Record<nsString, nsString> arg0;
37970 auto& recordEntries = arg0.Entries();
37971
37972 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
37973 JS::RootedVector<jsid> ids(cx);
37974 if (!js::GetPropertyKeys(cx, recordObj,
37975 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
37976 return false;
37977 }
37978 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
37979 JS_ReportOutOfMemory(cx);
37980 return false;
37981 }
37982 JS::Rooted<JS::Value> propNameValue(cx);
37983 JS::Rooted<JS::Value> temp(cx);
37984 JS::Rooted<jsid> curId(cx);
37985 JS::Rooted<JS::Value> idVal(cx);
37986 // Use a hashset to keep track of ids seen, to avoid
37987 // introducing nasty O(N^2) behavior scanning for them all the
37988 // time. Ideally we'd use a data structure with O(1) lookup
37989 // _and_ ordering for the MozMap, but we don't have one lying
37990 // around.
37991 nsTHashtable<nsStringHashKey> idsSeen;
37992 for (size_t i = 0; i < ids.length(); ++i) {
37993 curId = ids[i];
37994
37995 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
37996 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
37997 &desc)) {
37998 return false;
37999 }
38000
38001 if (desc.isNothing() || !desc->enumerable()) {
38002 continue;
38003 }
38004
38005 idVal = js::IdToValue(curId);
38006 nsString propName;
38007 // This will just throw if idVal is a Symbol, like the spec says
38008 // to do.
38009 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
38010 return false;
38011 }
38012
38013 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
38014 return false;
38015 }
38016
38017 Record<nsString, nsString>::EntryType* entry;
38018 if (!idsSeen.EnsureInserted(propName)) {
38019 // Find the existing entry.
38020 auto idx = recordEntries.IndexOf(propName);
38021 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", 38022); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 38022); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
38022 "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", 38022); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 38022); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
38023 // Now blow it away to make it look like it was just added
38024 // to the array, because it's not obvious that it's
38025 // safe to write to its already-initialized mValue via our
38026 // normal codegen conversions. For example, the value
38027 // could be a union and this would change its type, but
38028 // codegen assumes we won't do that.
38029 entry = recordEntries.ReconstructElementAt(idx);
38030 } else {
38031 // Safe to do an infallible append here, because we did a
38032 // SetCapacity above to the right capacity.
38033 entry = recordEntries.AppendElement();
38034 }
38035 entry->mKey = propName;
38036 nsString& slot = entry->mValue;
38037 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
38038 return false;
38039 }
38040 }
38041 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38042 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38043 if (objIsXray) {
38044 unwrappedObj.emplace(cx, obj);
38045 }
38046 if (objIsXray) {
38047 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38048 // we know Xrays have no dynamic unwrap behavior.
38049 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38050 if (!unwrappedObj.ref()) {
38051 return false;
38052 }
38053 }
38054 FastErrorResult rv;
38055 // NOTE: This assert does NOT call the function.
38056 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");
38057 MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38058 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"
)), 0))
) {
38059 return false;
38060 }
38061 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38061); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38061); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38062 args.rval().setUndefined();
38063 return true;
38064 } while (false);
38065 }
38066 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
38067 break;
38068 }
38069 default: {
38070 // Using nsPrintfCString here would require including that
38071 // header. Let's not worry about it.
38072 nsAutoCString argCountStr;
38073 argCountStr.AppendPrintf("%u", args.length());
38074 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
38075 }
38076 }
38077 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 38077); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 38077); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
38078 return false;
38079}
38080
38081static const JSJitInfo overload18_methodinfo = {
38082 { (JSJitGetterOp)overload18 },
38083 { prototypes::id::TestJSImplInterface },
38084 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38085 JSJitInfo::Method,
38086 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38087 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38088 false, /* isInfallible. False in setters. */
38089 false, /* isMovable. Not relevant for setters. */
38090 false, /* isEliminatable. Not relevant for setters. */
38091 false, /* isAlwaysInSlot. Only relevant for getters. */
38092 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38093 false, /* isTypedMethod. Only relevant for methods. */
38094 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38095};
38096
38097MOZ_CAN_RUN_SCRIPT static bool
38098overload19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38099{
38100 BindingCallContext cx(cx_, "TestJSImplInterface.overload19");
38101 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38104( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38102 "TestJSImplInterface", "overload19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38104( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38103 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38104( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38104 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38104( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38105
38106 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38107 unsigned argcount = std::min(args.length(), 1u);
38108 switch (argcount) {
38109 case 0: {
38110 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38111 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38112 if (objIsXray) {
38113 unwrappedObj.emplace(cx, obj);
38114 }
38115 RootedDictionary<binding_detail::FastDict> arg0(cx);
38116 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
38117 return false;
38118 }
38119 if (objIsXray) {
38120 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38121 // we know Xrays have no dynamic unwrap behavior.
38122 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38123 if (!unwrappedObj.ref()) {
38124 return false;
38125 }
38126 }
38127 FastErrorResult rv;
38128 // NOTE: This assert does NOT call the function.
38129 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");
38130 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38131 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38132 return false;
38133 }
38134 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38134); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38134); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38135 args.rval().setUndefined();
38136 return true;
38137 break;
38138 }
38139 case 1: {
38140 if (args[0].isNullOrUndefined()) {
38141 RootedDictionary<binding_detail::FastDict> arg0(cx);
38142 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38143 return false;
38144 }
38145 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38146 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38147 if (objIsXray) {
38148 unwrappedObj.emplace(cx, obj);
38149 }
38150 if (objIsXray) {
38151 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38152 // we know Xrays have no dynamic unwrap behavior.
38153 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38154 if (!unwrappedObj.ref()) {
38155 return false;
38156 }
38157 }
38158 FastErrorResult rv;
38159 // NOTE: This assert does NOT call the function.
38160 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");
38161 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38162 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38163 return false;
38164 }
38165 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38165); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38165); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38166 args.rval().setUndefined();
38167 return true;
38168 }
38169 if (args[0].isObject()) {
38170 do {
38171 binding_detail::AutoSequence<int32_t> arg0;
38172 JS::ForOfIterator iter(cx);
38173 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
38174 return false;
38175 }
38176 if (!iter.valueIsIterable()) {
38177 break;
38178 }
38179 binding_detail::AutoSequence<int32_t> &arr = arg0;
38180 JS::Rooted<JS::Value> temp(cx);
38181 while (true) {
38182 bool done;
38183 if (!iter.next(&temp, &done)) {
38184 return false;
38185 }
38186 if (done) {
38187 break;
38188 }
38189 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
38190 if (!slotPtr) {
38191 JS_ReportOutOfMemory(cx);
38192 return false;
38193 }
38194 int32_t& slot = *slotPtr;
38195 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
38196 return false;
38197 }
38198 }
38199 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38200 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38201 if (objIsXray) {
38202 unwrappedObj.emplace(cx, obj);
38203 }
38204 if (objIsXray) {
38205 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38206 // we know Xrays have no dynamic unwrap behavior.
38207 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38208 if (!unwrappedObj.ref()) {
38209 return false;
38210 }
38211 }
38212 FastErrorResult rv;
38213 // NOTE: This assert does NOT call the function.
38214 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");
38215 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38216 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38217 return false;
38218 }
38219 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38219); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38219); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38220 args.rval().setUndefined();
38221 return true;
38222 } while (false);
38223 do {
38224 RootedDictionary<binding_detail::FastDict> arg0(cx);
38225 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38226 return false;
38227 }
38228 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38229 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38230 if (objIsXray) {
38231 unwrappedObj.emplace(cx, obj);
38232 }
38233 if (objIsXray) {
38234 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38235 // we know Xrays have no dynamic unwrap behavior.
38236 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38237 if (!unwrappedObj.ref()) {
38238 return false;
38239 }
38240 }
38241 FastErrorResult rv;
38242 // NOTE: This assert does NOT call the function.
38243 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");
38244 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38245 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38246 return false;
38247 }
38248 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38248); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38249 args.rval().setUndefined();
38250 return true;
38251 } while (false);
38252 }
38253 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
38254 break;
38255 }
38256 default: {
38257 // Using nsPrintfCString here would require including that
38258 // header. Let's not worry about it.
38259 nsAutoCString argCountStr;
38260 argCountStr.AppendPrintf("%u", args.length());
38261 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
38262 }
38263 }
38264 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 38264); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 38264); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
38265 return false;
38266}
38267
38268static const JSJitInfo overload19_methodinfo = {
38269 { (JSJitGetterOp)overload19 },
38270 { prototypes::id::TestJSImplInterface },
38271 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38272 JSJitInfo::Method,
38273 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38274 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38275 false, /* isInfallible. False in setters. */
38276 false, /* isMovable. Not relevant for setters. */
38277 false, /* isEliminatable. Not relevant for setters. */
38278 false, /* isAlwaysInSlot. Only relevant for getters. */
38279 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38280 false, /* isTypedMethod. Only relevant for methods. */
38281 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38282};
38283
38284MOZ_CAN_RUN_SCRIPT static bool
38285overload20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38286{
38287 BindingCallContext cx(cx_, "TestJSImplInterface.overload20");
38288 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38291( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38289 "TestJSImplInterface", "overload20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38291( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38290 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38291( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38291 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38291( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38292
38293 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38294 unsigned argcount = std::min(args.length(), 1u);
38295 switch (argcount) {
38296 case 0: {
38297 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38298 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38299 if (objIsXray) {
38300 unwrappedObj.emplace(cx, obj);
38301 }
38302 RootedDictionary<binding_detail::FastDict> arg0(cx);
38303 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
38304 return false;
38305 }
38306 if (objIsXray) {
38307 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38308 // we know Xrays have no dynamic unwrap behavior.
38309 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38310 if (!unwrappedObj.ref()) {
38311 return false;
38312 }
38313 }
38314 FastErrorResult rv;
38315 // NOTE: This assert does NOT call the function.
38316 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");
38317 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38318 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38319 return false;
38320 }
38321 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38321); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38321); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38322 args.rval().setUndefined();
38323 return true;
38324 break;
38325 }
38326 case 1: {
38327 if (args[0].isNullOrUndefined()) {
38328 RootedDictionary<binding_detail::FastDict> arg0(cx);
38329 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38330 return false;
38331 }
38332 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38333 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38334 if (objIsXray) {
38335 unwrappedObj.emplace(cx, obj);
38336 }
38337 if (objIsXray) {
38338 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38339 // we know Xrays have no dynamic unwrap behavior.
38340 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38341 if (!unwrappedObj.ref()) {
38342 return false;
38343 }
38344 }
38345 FastErrorResult rv;
38346 // NOTE: This assert does NOT call the function.
38347 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");
38348 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38349 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38350 return false;
38351 }
38352 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38352); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38352); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38353 args.rval().setUndefined();
38354 return true;
38355 }
38356 if (args[0].isObject()) {
38357 do {
38358 binding_detail::AutoSequence<int32_t> arg0;
38359 JS::ForOfIterator iter(cx);
38360 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
38361 return false;
38362 }
38363 if (!iter.valueIsIterable()) {
38364 break;
38365 }
38366 binding_detail::AutoSequence<int32_t> &arr = arg0;
38367 JS::Rooted<JS::Value> temp(cx);
38368 while (true) {
38369 bool done;
38370 if (!iter.next(&temp, &done)) {
38371 return false;
38372 }
38373 if (done) {
38374 break;
38375 }
38376 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
38377 if (!slotPtr) {
38378 JS_ReportOutOfMemory(cx);
38379 return false;
38380 }
38381 int32_t& slot = *slotPtr;
38382 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
38383 return false;
38384 }
38385 }
38386 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38387 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38388 if (objIsXray) {
38389 unwrappedObj.emplace(cx, obj);
38390 }
38391 if (objIsXray) {
38392 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38393 // we know Xrays have no dynamic unwrap behavior.
38394 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38395 if (!unwrappedObj.ref()) {
38396 return false;
38397 }
38398 }
38399 FastErrorResult rv;
38400 // NOTE: This assert does NOT call the function.
38401 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");
38402 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38403 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38404 return false;
38405 }
38406 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38406); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38406); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38407 args.rval().setUndefined();
38408 return true;
38409 } while (false);
38410 do {
38411 RootedDictionary<binding_detail::FastDict> arg0(cx);
38412 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38413 return false;
38414 }
38415 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38416 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38417 if (objIsXray) {
38418 unwrappedObj.emplace(cx, obj);
38419 }
38420 if (objIsXray) {
38421 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38422 // we know Xrays have no dynamic unwrap behavior.
38423 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38424 if (!unwrappedObj.ref()) {
38425 return false;
38426 }
38427 }
38428 FastErrorResult rv;
38429 // NOTE: This assert does NOT call the function.
38430 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");
38431 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38432 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38433 return false;
38434 }
38435 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38435); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38435); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38436 args.rval().setUndefined();
38437 return true;
38438 } while (false);
38439 }
38440 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
38441 break;
38442 }
38443 default: {
38444 // Using nsPrintfCString here would require including that
38445 // header. Let's not worry about it.
38446 nsAutoCString argCountStr;
38447 argCountStr.AppendPrintf("%u", args.length());
38448 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
38449 }
38450 }
38451 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 38451); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 38451); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
38452 return false;
38453}
38454
38455static const JSJitInfo overload20_methodinfo = {
38456 { (JSJitGetterOp)overload20 },
38457 { prototypes::id::TestJSImplInterface },
38458 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38459 JSJitInfo::Method,
38460 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38461 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38462 false, /* isInfallible. False in setters. */
38463 false, /* isMovable. Not relevant for setters. */
38464 false, /* isEliminatable. Not relevant for setters. */
38465 false, /* isAlwaysInSlot. Only relevant for getters. */
38466 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38467 false, /* isTypedMethod. Only relevant for methods. */
38468 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38469};
38470
38471MOZ_CAN_RUN_SCRIPT static bool
38472passVariadicThirdArg(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38473{
38474 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicThirdArg");
38475 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38478( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38476 "TestJSImplInterface", "passVariadicThirdArg", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38478( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38477 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38478( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38478 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38478( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38479
38480 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38481 if (!args.requireAtLeast(cx, "TestJSImplInterface.passVariadicThirdArg", 2)) {
38482 return false;
38483 }
38484 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38485 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38486 if (objIsXray) {
38487 unwrappedObj.emplace(cx, obj);
38488 }
38489 binding_detail::FakeString<char16_t> arg0;
38490 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
38491 return false;
38492 }
38493 int32_t arg1;
38494 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
38495 return false;
38496 }
38497 AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> arg2;
38498 if (args.length() > 2) {
38499 if (!arg2.SetCapacity(args.length() - 2, mozilla::fallible)) {
38500 JS_ReportOutOfMemory(cx);
38501 return false;
38502 }
38503 for (uint32_t variadicArg = 2; variadicArg < args.length(); ++variadicArg) {
38504 // OK to do infallible append here, since we ensured capacity already.
38505 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *arg2.AppendElement();
38506 if (args[variadicArg].isObject()) {
38507 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
38508 {
38509 // Our JSContext should be in the right global to do unwrapping in.
38510 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[variadicArg], slot, cx);
38511 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
38512 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 3", "TestJSImplInterface");
38513 return false;
38514 }
38515 }
38516 } else {
38517 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3");
38518 return false;
38519 }
38520 }
38521 }
38522 if (objIsXray) {
38523 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38524 // we know Xrays have no dynamic unwrap behavior.
38525 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38526 if (!unwrappedObj.ref()) {
38527 return false;
38528 }
38529 }
38530 FastErrorResult rv;
38531 // NOTE: This assert does NOT call the function.
38532 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");
38533 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)));
38534 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg"
)), 0))
) {
38535 return false;
38536 }
38537 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38537); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38537); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38538 args.rval().setUndefined();
38539 return true;
38540}
38541
38542static const JSJitInfo passVariadicThirdArg_methodinfo = {
38543 { (JSJitGetterOp)passVariadicThirdArg },
38544 { prototypes::id::TestJSImplInterface },
38545 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38546 JSJitInfo::Method,
38547 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38548 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38549 false, /* isInfallible. False in setters. */
38550 false, /* isMovable. Not relevant for setters. */
38551 false, /* isEliminatable. Not relevant for setters. */
38552 false, /* isAlwaysInSlot. Only relevant for getters. */
38553 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38554 false, /* isTypedMethod. Only relevant for methods. */
38555 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38556};
38557
38558MOZ_CAN_RUN_SCRIPT static bool
38559get_prefable1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38560{
38561 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38564( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38562 "TestJSImplInterface", "prefable1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38564( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38563 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38564( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38564 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38564( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38565
38566 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38567 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38568 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38569 if (objIsXray) {
38570 unwrappedObj.emplace(cx, obj);
38571 }
38572 if (objIsXray) {
38573 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38574 // we know Xrays have no dynamic unwrap behavior.
38575 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38576 if (!unwrappedObj.ref()) {
38577 return false;
38578 }
38579 }
38580 FastErrorResult rv;
38581 bool result(MOZ_KnownLive(self)(self)->GetPrefable1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38582 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter"
)), 0))
) {
38583 return false;
38584 }
38585 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38585); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38585); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38586 args.rval().setBoolean(result);
38587 return true;
38588}
38589
38590static const JSJitInfo prefable1_getterinfo = {
38591 { get_prefable1 },
38592 { prototypes::id::TestJSImplInterface },
38593 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38594 JSJitInfo::Getter,
38595 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38596 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38597 false, /* isInfallible. False in setters. */
38598 false, /* isMovable. Not relevant for setters. */
38599 false, /* isEliminatable. Not relevant for setters. */
38600 false, /* isAlwaysInSlot. Only relevant for getters. */
38601 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38602 false, /* isTypedMethod. Only relevant for methods. */
38603 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38604};
38605
38606MOZ_CAN_RUN_SCRIPT static bool
38607get_prefable2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38608{
38609 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38612( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38610 "TestJSImplInterface", "prefable2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38612( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38611 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38612( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38612 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38612( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38613
38614 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38615 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38616 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38617 if (objIsXray) {
38618 unwrappedObj.emplace(cx, obj);
38619 }
38620 if (objIsXray) {
38621 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38622 // we know Xrays have no dynamic unwrap behavior.
38623 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38624 if (!unwrappedObj.ref()) {
38625 return false;
38626 }
38627 }
38628 FastErrorResult rv;
38629 bool result(MOZ_KnownLive(self)(self)->GetPrefable2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38630 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter"
)), 0))
) {
38631 return false;
38632 }
38633 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38633); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38633); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38634 args.rval().setBoolean(result);
38635 return true;
38636}
38637
38638static const JSJitInfo prefable2_getterinfo = {
38639 { get_prefable2 },
38640 { prototypes::id::TestJSImplInterface },
38641 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38642 JSJitInfo::Getter,
38643 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38644 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38645 false, /* isInfallible. False in setters. */
38646 false, /* isMovable. Not relevant for setters. */
38647 false, /* isEliminatable. Not relevant for setters. */
38648 false, /* isAlwaysInSlot. Only relevant for getters. */
38649 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38650 false, /* isTypedMethod. Only relevant for methods. */
38651 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38652};
38653
38654MOZ_CAN_RUN_SCRIPT static bool
38655get_prefable3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38656{
38657 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38660( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38658 "TestJSImplInterface", "prefable3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38660( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38659 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38660( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38660 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38660( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38661
38662 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38663 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38664 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38665 if (objIsXray) {
38666 unwrappedObj.emplace(cx, obj);
38667 }
38668 if (objIsXray) {
38669 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38670 // we know Xrays have no dynamic unwrap behavior.
38671 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38672 if (!unwrappedObj.ref()) {
38673 return false;
38674 }
38675 }
38676 FastErrorResult rv;
38677 bool result(MOZ_KnownLive(self)(self)->GetPrefable3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38678 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter"
)), 0))
) {
38679 return false;
38680 }
38681 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38681); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38681); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38682 args.rval().setBoolean(result);
38683 return true;
38684}
38685
38686static const JSJitInfo prefable3_getterinfo = {
38687 { get_prefable3 },
38688 { prototypes::id::TestJSImplInterface },
38689 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38690 JSJitInfo::Getter,
38691 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38692 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38693 false, /* isInfallible. False in setters. */
38694 false, /* isMovable. Not relevant for setters. */
38695 false, /* isEliminatable. Not relevant for setters. */
38696 false, /* isAlwaysInSlot. Only relevant for getters. */
38697 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38698 false, /* isTypedMethod. Only relevant for methods. */
38699 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38700};
38701
38702MOZ_CAN_RUN_SCRIPT static bool
38703get_prefable4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38704{
38705 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38708( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38706 "TestJSImplInterface", "prefable4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38708( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38707 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38708( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38708 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38708( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38709
38710 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38711 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38712 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38713 if (objIsXray) {
38714 unwrappedObj.emplace(cx, obj);
38715 }
38716 if (objIsXray) {
38717 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38718 // we know Xrays have no dynamic unwrap behavior.
38719 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38720 if (!unwrappedObj.ref()) {
38721 return false;
38722 }
38723 }
38724 FastErrorResult rv;
38725 bool result(MOZ_KnownLive(self)(self)->GetPrefable4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38726 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter"
)), 0))
) {
38727 return false;
38728 }
38729 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38729); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38729); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38730 args.rval().setBoolean(result);
38731 return true;
38732}
38733
38734static const JSJitInfo prefable4_getterinfo = {
38735 { get_prefable4 },
38736 { prototypes::id::TestJSImplInterface },
38737 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38738 JSJitInfo::Getter,
38739 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38740 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38741 false, /* isInfallible. False in setters. */
38742 false, /* isMovable. Not relevant for setters. */
38743 false, /* isEliminatable. Not relevant for setters. */
38744 false, /* isAlwaysInSlot. Only relevant for getters. */
38745 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38746 false, /* isTypedMethod. Only relevant for methods. */
38747 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38748};
38749
38750MOZ_CAN_RUN_SCRIPT static bool
38751get_prefable5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38752{
38753 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38756( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38754 "TestJSImplInterface", "prefable5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38756( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38755 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38756( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38756 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38756( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38757
38758 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38759 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38760 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38761 if (objIsXray) {
38762 unwrappedObj.emplace(cx, obj);
38763 }
38764 if (objIsXray) {
38765 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38766 // we know Xrays have no dynamic unwrap behavior.
38767 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38768 if (!unwrappedObj.ref()) {
38769 return false;
38770 }
38771 }
38772 FastErrorResult rv;
38773 bool result(MOZ_KnownLive(self)(self)->GetPrefable5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38774 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter"
)), 0))
) {
38775 return false;
38776 }
38777 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38777); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38777); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38778 args.rval().setBoolean(result);
38779 return true;
38780}
38781
38782static const JSJitInfo prefable5_getterinfo = {
38783 { get_prefable5 },
38784 { prototypes::id::TestJSImplInterface },
38785 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38786 JSJitInfo::Getter,
38787 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38788 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38789 false, /* isInfallible. False in setters. */
38790 false, /* isMovable. Not relevant for setters. */
38791 false, /* isEliminatable. Not relevant for setters. */
38792 false, /* isAlwaysInSlot. Only relevant for getters. */
38793 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38794 false, /* isTypedMethod. Only relevant for methods. */
38795 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38796};
38797
38798MOZ_CAN_RUN_SCRIPT static bool
38799get_prefable6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38800{
38801 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38804( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38802 "TestJSImplInterface", "prefable6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38804( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38803 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38804( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38804 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38804( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38805
38806 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38807 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38808 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38809 if (objIsXray) {
38810 unwrappedObj.emplace(cx, obj);
38811 }
38812 if (objIsXray) {
38813 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38814 // we know Xrays have no dynamic unwrap behavior.
38815 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38816 if (!unwrappedObj.ref()) {
38817 return false;
38818 }
38819 }
38820 FastErrorResult rv;
38821 bool result(MOZ_KnownLive(self)(self)->GetPrefable6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38822 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter"
)), 0))
) {
38823 return false;
38824 }
38825 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38825); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38825); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38826 args.rval().setBoolean(result);
38827 return true;
38828}
38829
38830static const JSJitInfo prefable6_getterinfo = {
38831 { get_prefable6 },
38832 { prototypes::id::TestJSImplInterface },
38833 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38834 JSJitInfo::Getter,
38835 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38836 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38837 false, /* isInfallible. False in setters. */
38838 false, /* isMovable. Not relevant for setters. */
38839 false, /* isEliminatable. Not relevant for setters. */
38840 false, /* isAlwaysInSlot. Only relevant for getters. */
38841 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38842 false, /* isTypedMethod. Only relevant for methods. */
38843 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38844};
38845
38846MOZ_CAN_RUN_SCRIPT static bool
38847get_prefable7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38848{
38849 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38852( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38850 "TestJSImplInterface", "prefable7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38852( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38851 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38852( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38852 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38852( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38853
38854 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38855 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38856 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38857 if (objIsXray) {
38858 unwrappedObj.emplace(cx, obj);
38859 }
38860 if (objIsXray) {
38861 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38862 // we know Xrays have no dynamic unwrap behavior.
38863 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38864 if (!unwrappedObj.ref()) {
38865 return false;
38866 }
38867 }
38868 FastErrorResult rv;
38869 bool result(MOZ_KnownLive(self)(self)->GetPrefable7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38870 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter"
)), 0))
) {
38871 return false;
38872 }
38873 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38873); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38873); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38874 args.rval().setBoolean(result);
38875 return true;
38876}
38877
38878static const JSJitInfo prefable7_getterinfo = {
38879 { get_prefable7 },
38880 { prototypes::id::TestJSImplInterface },
38881 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38882 JSJitInfo::Getter,
38883 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38884 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38885 false, /* isInfallible. False in setters. */
38886 false, /* isMovable. Not relevant for setters. */
38887 false, /* isEliminatable. Not relevant for setters. */
38888 false, /* isAlwaysInSlot. Only relevant for getters. */
38889 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38890 false, /* isTypedMethod. Only relevant for methods. */
38891 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38892};
38893
38894MOZ_CAN_RUN_SCRIPT static bool
38895get_prefable8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38896{
38897 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38900( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38898 "TestJSImplInterface", "prefable8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38900( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38899 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38900( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38900 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38900( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38901
38902 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38903 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38904 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38905 if (objIsXray) {
38906 unwrappedObj.emplace(cx, obj);
38907 }
38908 if (objIsXray) {
38909 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38910 // we know Xrays have no dynamic unwrap behavior.
38911 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38912 if (!unwrappedObj.ref()) {
38913 return false;
38914 }
38915 }
38916 FastErrorResult rv;
38917 bool result(MOZ_KnownLive(self)(self)->GetPrefable8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38918 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter"
)), 0))
) {
38919 return false;
38920 }
38921 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38921); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38921); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38922 args.rval().setBoolean(result);
38923 return true;
38924}
38925
38926static const JSJitInfo prefable8_getterinfo = {
38927 { get_prefable8 },
38928 { prototypes::id::TestJSImplInterface },
38929 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38930 JSJitInfo::Getter,
38931 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38932 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38933 false, /* isInfallible. False in setters. */
38934 false, /* isMovable. Not relevant for setters. */
38935 false, /* isEliminatable. Not relevant for setters. */
38936 false, /* isAlwaysInSlot. Only relevant for getters. */
38937 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38938 false, /* isTypedMethod. Only relevant for methods. */
38939 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38940};
38941
38942MOZ_CAN_RUN_SCRIPT static bool
38943get_prefable9(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38944{
38945 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38948( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38946 "TestJSImplInterface", "prefable9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38948( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38947 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38948( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38948 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38948( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38949
38950 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38951 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38952 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38953 if (objIsXray) {
38954 unwrappedObj.emplace(cx, obj);
38955 }
38956 if (objIsXray) {
38957 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38958 // we know Xrays have no dynamic unwrap behavior.
38959 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38960 if (!unwrappedObj.ref()) {
38961 return false;
38962 }
38963 }
38964 FastErrorResult rv;
38965 bool result(MOZ_KnownLive(self)(self)->GetPrefable9(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38966 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter"
)), 0))
) {
38967 return false;
38968 }
38969 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38969); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 38969); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
38970 args.rval().setBoolean(result);
38971 return true;
38972}
38973
38974static const JSJitInfo prefable9_getterinfo = {
38975 { get_prefable9 },
38976 { prototypes::id::TestJSImplInterface },
38977 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38978 JSJitInfo::Getter,
38979 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38980 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38981 false, /* isInfallible. False in setters. */
38982 false, /* isMovable. Not relevant for setters. */
38983 false, /* isEliminatable. Not relevant for setters. */
38984 false, /* isAlwaysInSlot. Only relevant for getters. */
38985 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38986 false, /* isTypedMethod. Only relevant for methods. */
38987 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38988};
38989
38990MOZ_CAN_RUN_SCRIPT static bool
38991prefable10(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38992{
38993 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38996( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38994 "TestJSImplInterface", "prefable10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38996( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38995 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38996( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38996 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38996( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38997
38998 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38999 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39000 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39001 if (objIsXray) {
39002 unwrappedObj.emplace(cx, obj);
39003 }
39004 if (objIsXray) {
39005 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39006 // we know Xrays have no dynamic unwrap behavior.
39007 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39008 if (!unwrappedObj.ref()) {
39009 return false;
39010 }
39011 }
39012 FastErrorResult rv;
39013 // NOTE: This assert does NOT call the function.
39014 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");
39015 MOZ_KnownLive(self)(self)->Prefable10(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39016 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10"
)), 0))
) {
39017 return false;
39018 }
39019 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39019); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39019); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39020 args.rval().setUndefined();
39021 return true;
39022}
39023
39024static const JSJitInfo prefable10_methodinfo = {
39025 { (JSJitGetterOp)prefable10 },
39026 { prototypes::id::TestJSImplInterface },
39027 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39028 JSJitInfo::Method,
39029 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39030 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39031 false, /* isInfallible. False in setters. */
39032 false, /* isMovable. Not relevant for setters. */
39033 false, /* isEliminatable. Not relevant for setters. */
39034 false, /* isAlwaysInSlot. Only relevant for getters. */
39035 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39036 false, /* isTypedMethod. Only relevant for methods. */
39037 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39038};
39039
39040MOZ_CAN_RUN_SCRIPT static bool
39041prefable11(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39042{
39043 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39046( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39044 "TestJSImplInterface", "prefable11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39046( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39045 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39046( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39046 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39046( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39047
39048 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39049 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39050 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39051 if (objIsXray) {
39052 unwrappedObj.emplace(cx, obj);
39053 }
39054 if (objIsXray) {
39055 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39056 // we know Xrays have no dynamic unwrap behavior.
39057 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39058 if (!unwrappedObj.ref()) {
39059 return false;
39060 }
39061 }
39062 FastErrorResult rv;
39063 // NOTE: This assert does NOT call the function.
39064 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");
39065 MOZ_KnownLive(self)(self)->Prefable11(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39066 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11"
)), 0))
) {
39067 return false;
39068 }
39069 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39069); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39070 args.rval().setUndefined();
39071 return true;
39072}
39073
39074static const JSJitInfo prefable11_methodinfo = {
39075 { (JSJitGetterOp)prefable11 },
39076 { prototypes::id::TestJSImplInterface },
39077 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39078 JSJitInfo::Method,
39079 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39080 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39081 false, /* isInfallible. False in setters. */
39082 false, /* isMovable. Not relevant for setters. */
39083 false, /* isEliminatable. Not relevant for setters. */
39084 false, /* isAlwaysInSlot. Only relevant for getters. */
39085 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39086 false, /* isTypedMethod. Only relevant for methods. */
39087 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39088};
39089
39090MOZ_CAN_RUN_SCRIPT static bool
39091get_prefable12(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39092{
39093 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39096( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39094 "TestJSImplInterface", "prefable12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39096( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39095 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39096( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39096 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39096( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39097
39098 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39099 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39100 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39101 if (objIsXray) {
39102 unwrappedObj.emplace(cx, obj);
39103 }
39104 if (objIsXray) {
39105 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39106 // we know Xrays have no dynamic unwrap behavior.
39107 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39108 if (!unwrappedObj.ref()) {
39109 return false;
39110 }
39111 }
39112 FastErrorResult rv;
39113 bool result(MOZ_KnownLive(self)(self)->GetPrefable12(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39114 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter"
)), 0))
) {
39115 return false;
39116 }
39117 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39117); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39117); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39118 args.rval().setBoolean(result);
39119 return true;
39120}
39121
39122static const JSJitInfo prefable12_getterinfo = {
39123 { get_prefable12 },
39124 { prototypes::id::TestJSImplInterface },
39125 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39126 JSJitInfo::Getter,
39127 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39128 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39129 false, /* isInfallible. False in setters. */
39130 false, /* isMovable. Not relevant for setters. */
39131 false, /* isEliminatable. Not relevant for setters. */
39132 false, /* isAlwaysInSlot. Only relevant for getters. */
39133 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39134 false, /* isTypedMethod. Only relevant for methods. */
39135 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39136};
39137
39138MOZ_CAN_RUN_SCRIPT static bool
39139prefable13(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39140{
39141 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39144( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39142 "TestJSImplInterface", "prefable13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39144( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39143 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39144( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39144 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39144( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39145
39146 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39147 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39148 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39149 if (objIsXray) {
39150 unwrappedObj.emplace(cx, obj);
39151 }
39152 if (objIsXray) {
39153 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39154 // we know Xrays have no dynamic unwrap behavior.
39155 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39156 if (!unwrappedObj.ref()) {
39157 return false;
39158 }
39159 }
39160 FastErrorResult rv;
39161 // NOTE: This assert does NOT call the function.
39162 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");
39163 MOZ_KnownLive(self)(self)->Prefable13(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39164 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13"
)), 0))
) {
39165 return false;
39166 }
39167 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39167); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39167); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39168 args.rval().setUndefined();
39169 return true;
39170}
39171
39172static const JSJitInfo prefable13_methodinfo = {
39173 { (JSJitGetterOp)prefable13 },
39174 { prototypes::id::TestJSImplInterface },
39175 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39176 JSJitInfo::Method,
39177 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39178 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39179 false, /* isInfallible. False in setters. */
39180 false, /* isMovable. Not relevant for setters. */
39181 false, /* isEliminatable. Not relevant for setters. */
39182 false, /* isAlwaysInSlot. Only relevant for getters. */
39183 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39184 false, /* isTypedMethod. Only relevant for methods. */
39185 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39186};
39187
39188MOZ_CAN_RUN_SCRIPT static bool
39189get_prefable14(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39190{
39191 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39194( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39192 "TestJSImplInterface", "prefable14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39194( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39193 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39194( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39194 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39194( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39195
39196 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39197 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39198 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39199 if (objIsXray) {
39200 unwrappedObj.emplace(cx, obj);
39201 }
39202 if (objIsXray) {
39203 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39204 // we know Xrays have no dynamic unwrap behavior.
39205 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39206 if (!unwrappedObj.ref()) {
39207 return false;
39208 }
39209 }
39210 FastErrorResult rv;
39211 bool result(MOZ_KnownLive(self)(self)->GetPrefable14(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39212 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter"
)), 0))
) {
39213 return false;
39214 }
39215 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39215); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39215); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39216 args.rval().setBoolean(result);
39217 return true;
39218}
39219
39220static const JSJitInfo prefable14_getterinfo = {
39221 { get_prefable14 },
39222 { prototypes::id::TestJSImplInterface },
39223 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39224 JSJitInfo::Getter,
39225 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39226 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39227 false, /* isInfallible. False in setters. */
39228 false, /* isMovable. Not relevant for setters. */
39229 false, /* isEliminatable. Not relevant for setters. */
39230 false, /* isAlwaysInSlot. Only relevant for getters. */
39231 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39232 false, /* isTypedMethod. Only relevant for methods. */
39233 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39234};
39235
39236MOZ_CAN_RUN_SCRIPT static bool
39237get_prefable15(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39238{
39239 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39242( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39240 "TestJSImplInterface", "prefable15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39242( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39241 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39242( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39242 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39242( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39243
39244 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39245 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39246 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39247 if (objIsXray) {
39248 unwrappedObj.emplace(cx, obj);
39249 }
39250 if (objIsXray) {
39251 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39252 // we know Xrays have no dynamic unwrap behavior.
39253 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39254 if (!unwrappedObj.ref()) {
39255 return false;
39256 }
39257 }
39258 FastErrorResult rv;
39259 bool result(MOZ_KnownLive(self)(self)->GetPrefable15(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39260 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter"
)), 0))
) {
39261 return false;
39262 }
39263 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39263); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39264 args.rval().setBoolean(result);
39265 return true;
39266}
39267
39268static const JSJitInfo prefable15_getterinfo = {
39269 { get_prefable15 },
39270 { prototypes::id::TestJSImplInterface },
39271 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39272 JSJitInfo::Getter,
39273 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39274 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39275 false, /* isInfallible. False in setters. */
39276 false, /* isMovable. Not relevant for setters. */
39277 false, /* isEliminatable. Not relevant for setters. */
39278 false, /* isAlwaysInSlot. Only relevant for getters. */
39279 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39280 false, /* isTypedMethod. Only relevant for methods. */
39281 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39282};
39283
39284MOZ_CAN_RUN_SCRIPT static bool
39285get_prefable16(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39286{
39287 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39290( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39288 "TestJSImplInterface", "prefable16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39290( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39289 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39290( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39290 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39290( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39291
39292 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39293 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39294 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39295 if (objIsXray) {
39296 unwrappedObj.emplace(cx, obj);
39297 }
39298 if (objIsXray) {
39299 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39300 // we know Xrays have no dynamic unwrap behavior.
39301 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39302 if (!unwrappedObj.ref()) {
39303 return false;
39304 }
39305 }
39306 FastErrorResult rv;
39307 bool result(MOZ_KnownLive(self)(self)->GetPrefable16(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39308 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter"
)), 0))
) {
39309 return false;
39310 }
39311 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39311); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39311); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39312 args.rval().setBoolean(result);
39313 return true;
39314}
39315
39316static const JSJitInfo prefable16_getterinfo = {
39317 { get_prefable16 },
39318 { prototypes::id::TestJSImplInterface },
39319 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39320 JSJitInfo::Getter,
39321 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39322 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39323 false, /* isInfallible. False in setters. */
39324 false, /* isMovable. Not relevant for setters. */
39325 false, /* isEliminatable. Not relevant for setters. */
39326 false, /* isAlwaysInSlot. Only relevant for getters. */
39327 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39328 false, /* isTypedMethod. Only relevant for methods. */
39329 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39330};
39331
39332MOZ_CAN_RUN_SCRIPT static bool
39333prefable17(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39334{
39335 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39338( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39336 "TestJSImplInterface", "prefable17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39338( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39337 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39338( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39338 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39338( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39339
39340 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39341 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39342 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39343 if (objIsXray) {
39344 unwrappedObj.emplace(cx, obj);
39345 }
39346 if (objIsXray) {
39347 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39348 // we know Xrays have no dynamic unwrap behavior.
39349 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39350 if (!unwrappedObj.ref()) {
39351 return false;
39352 }
39353 }
39354 FastErrorResult rv;
39355 // NOTE: This assert does NOT call the function.
39356 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");
39357 MOZ_KnownLive(self)(self)->Prefable17(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39358 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17"
)), 0))
) {
39359 return false;
39360 }
39361 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39361); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39361); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39362 args.rval().setUndefined();
39363 return true;
39364}
39365
39366static const JSJitInfo prefable17_methodinfo = {
39367 { (JSJitGetterOp)prefable17 },
39368 { prototypes::id::TestJSImplInterface },
39369 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39370 JSJitInfo::Method,
39371 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39372 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39373 false, /* isInfallible. False in setters. */
39374 false, /* isMovable. Not relevant for setters. */
39375 false, /* isEliminatable. Not relevant for setters. */
39376 false, /* isAlwaysInSlot. Only relevant for getters. */
39377 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39378 false, /* isTypedMethod. Only relevant for methods. */
39379 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39380};
39381
39382MOZ_CAN_RUN_SCRIPT static bool
39383prefable18(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39384{
39385 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39388( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39386 "TestJSImplInterface", "prefable18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39388( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39387 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39388( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39388 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39388( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39389
39390 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39391 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39392 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39393 if (objIsXray) {
39394 unwrappedObj.emplace(cx, obj);
39395 }
39396 if (objIsXray) {
39397 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39398 // we know Xrays have no dynamic unwrap behavior.
39399 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39400 if (!unwrappedObj.ref()) {
39401 return false;
39402 }
39403 }
39404 FastErrorResult rv;
39405 // NOTE: This assert does NOT call the function.
39406 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");
39407 MOZ_KnownLive(self)(self)->Prefable18(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39408 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18"
)), 0))
) {
39409 return false;
39410 }
39411 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39411); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39411); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39412 args.rval().setUndefined();
39413 return true;
39414}
39415
39416static const JSJitInfo prefable18_methodinfo = {
39417 { (JSJitGetterOp)prefable18 },
39418 { prototypes::id::TestJSImplInterface },
39419 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39420 JSJitInfo::Method,
39421 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39422 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39423 false, /* isInfallible. False in setters. */
39424 false, /* isMovable. Not relevant for setters. */
39425 false, /* isEliminatable. Not relevant for setters. */
39426 false, /* isAlwaysInSlot. Only relevant for getters. */
39427 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39428 false, /* isTypedMethod. Only relevant for methods. */
39429 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39430};
39431
39432MOZ_CAN_RUN_SCRIPT static bool
39433prefable19(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39434{
39435 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39438( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39436 "TestJSImplInterface", "prefable19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39438( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39437 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39438( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39438 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39438( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39439
39440 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39441 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39442 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39443 if (objIsXray) {
39444 unwrappedObj.emplace(cx, obj);
39445 }
39446 if (objIsXray) {
39447 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39448 // we know Xrays have no dynamic unwrap behavior.
39449 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39450 if (!unwrappedObj.ref()) {
39451 return false;
39452 }
39453 }
39454 FastErrorResult rv;
39455 // NOTE: This assert does NOT call the function.
39456 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");
39457 MOZ_KnownLive(self)(self)->Prefable19(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39458 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19"
)), 0))
) {
39459 return false;
39460 }
39461 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39461); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39461); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39462 args.rval().setUndefined();
39463 return true;
39464}
39465
39466static const JSJitInfo prefable19_methodinfo = {
39467 { (JSJitGetterOp)prefable19 },
39468 { prototypes::id::TestJSImplInterface },
39469 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39470 JSJitInfo::Method,
39471 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39472 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39473 false, /* isInfallible. False in setters. */
39474 false, /* isMovable. Not relevant for setters. */
39475 false, /* isEliminatable. Not relevant for setters. */
39476 false, /* isAlwaysInSlot. Only relevant for getters. */
39477 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39478 false, /* isTypedMethod. Only relevant for methods. */
39479 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39480};
39481
39482MOZ_CAN_RUN_SCRIPT static bool
39483prefable20(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39484{
39485 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39488( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39486 "TestJSImplInterface", "prefable20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39488( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39487 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39488( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39488 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39488( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39489
39490 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39491 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39492 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39493 if (objIsXray) {
39494 unwrappedObj.emplace(cx, obj);
39495 }
39496 if (objIsXray) {
39497 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39498 // we know Xrays have no dynamic unwrap behavior.
39499 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39500 if (!unwrappedObj.ref()) {
39501 return false;
39502 }
39503 }
39504 FastErrorResult rv;
39505 // NOTE: This assert does NOT call the function.
39506 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");
39507 MOZ_KnownLive(self)(self)->Prefable20(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39508 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20"
)), 0))
) {
39509 return false;
39510 }
39511 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39511); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39511); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39512 args.rval().setUndefined();
39513 return true;
39514}
39515
39516static const JSJitInfo prefable20_methodinfo = {
39517 { (JSJitGetterOp)prefable20 },
39518 { prototypes::id::TestJSImplInterface },
39519 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39520 JSJitInfo::Method,
39521 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39522 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39523 false, /* isInfallible. False in setters. */
39524 false, /* isMovable. Not relevant for setters. */
39525 false, /* isEliminatable. Not relevant for setters. */
39526 false, /* isAlwaysInSlot. Only relevant for getters. */
39527 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39528 false, /* isTypedMethod. Only relevant for methods. */
39529 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39530};
39531
39532MOZ_CAN_RUN_SCRIPT static bool
39533get_conditionalOnSecureContext1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39534{
39535 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39538( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39536 "TestJSImplInterface", "conditionalOnSecureContext1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39538( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39537 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39538( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39538 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39538( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39539
39540 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39541 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39542 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39543 if (objIsXray) {
39544 unwrappedObj.emplace(cx, obj);
39545 }
39546 if (objIsXray) {
39547 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39548 // we know Xrays have no dynamic unwrap behavior.
39549 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39550 if (!unwrappedObj.ref()) {
39551 return false;
39552 }
39553 }
39554 FastErrorResult rv;
39555 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39556 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter"
)), 0))
) {
39557 return false;
39558 }
39559 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39559); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39559); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39560 args.rval().setBoolean(result);
39561 return true;
39562}
39563
39564static const JSJitInfo conditionalOnSecureContext1_getterinfo = {
39565 { get_conditionalOnSecureContext1 },
39566 { prototypes::id::TestJSImplInterface },
39567 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39568 JSJitInfo::Getter,
39569 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39570 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39571 false, /* isInfallible. False in setters. */
39572 false, /* isMovable. Not relevant for setters. */
39573 false, /* isEliminatable. Not relevant for setters. */
39574 false, /* isAlwaysInSlot. Only relevant for getters. */
39575 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39576 false, /* isTypedMethod. Only relevant for methods. */
39577 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39578};
39579
39580MOZ_CAN_RUN_SCRIPT static bool
39581get_conditionalOnSecureContext2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39582{
39583 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39586( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39584 "TestJSImplInterface", "conditionalOnSecureContext2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39586( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39585 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39586( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39586 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39586( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39587
39588 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39589 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39590 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39591 if (objIsXray) {
39592 unwrappedObj.emplace(cx, obj);
39593 }
39594 if (objIsXray) {
39595 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39596 // we know Xrays have no dynamic unwrap behavior.
39597 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39598 if (!unwrappedObj.ref()) {
39599 return false;
39600 }
39601 }
39602 FastErrorResult rv;
39603 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39604 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter"
)), 0))
) {
39605 return false;
39606 }
39607 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39607); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39608 args.rval().setBoolean(result);
39609 return true;
39610}
39611
39612static const JSJitInfo conditionalOnSecureContext2_getterinfo = {
39613 { get_conditionalOnSecureContext2 },
39614 { prototypes::id::TestJSImplInterface },
39615 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39616 JSJitInfo::Getter,
39617 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39618 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39619 false, /* isInfallible. False in setters. */
39620 false, /* isMovable. Not relevant for setters. */
39621 false, /* isEliminatable. Not relevant for setters. */
39622 false, /* isAlwaysInSlot. Only relevant for getters. */
39623 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39624 false, /* isTypedMethod. Only relevant for methods. */
39625 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39626};
39627
39628MOZ_CAN_RUN_SCRIPT static bool
39629get_conditionalOnSecureContext3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39630{
39631 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39634( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39632 "TestJSImplInterface", "conditionalOnSecureContext3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39634( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39633 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39634( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39634 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39634( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39635
39636 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39637 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39638 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39639 if (objIsXray) {
39640 unwrappedObj.emplace(cx, obj);
39641 }
39642 if (objIsXray) {
39643 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39644 // we know Xrays have no dynamic unwrap behavior.
39645 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39646 if (!unwrappedObj.ref()) {
39647 return false;
39648 }
39649 }
39650 FastErrorResult rv;
39651 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39652 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter"
)), 0))
) {
39653 return false;
39654 }
39655 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39655); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39655); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39656 args.rval().setBoolean(result);
39657 return true;
39658}
39659
39660static const JSJitInfo conditionalOnSecureContext3_getterinfo = {
39661 { get_conditionalOnSecureContext3 },
39662 { prototypes::id::TestJSImplInterface },
39663 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39664 JSJitInfo::Getter,
39665 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39666 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39667 false, /* isInfallible. False in setters. */
39668 false, /* isMovable. Not relevant for setters. */
39669 false, /* isEliminatable. Not relevant for setters. */
39670 false, /* isAlwaysInSlot. Only relevant for getters. */
39671 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39672 false, /* isTypedMethod. Only relevant for methods. */
39673 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39674};
39675
39676MOZ_CAN_RUN_SCRIPT static bool
39677get_conditionalOnSecureContext4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39678{
39679 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39682( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39680 "TestJSImplInterface", "conditionalOnSecureContext4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39682( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39681 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39682( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39682 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39682( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39683
39684 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39685 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39686 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39687 if (objIsXray) {
39688 unwrappedObj.emplace(cx, obj);
39689 }
39690 if (objIsXray) {
39691 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39692 // we know Xrays have no dynamic unwrap behavior.
39693 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39694 if (!unwrappedObj.ref()) {
39695 return false;
39696 }
39697 }
39698 FastErrorResult rv;
39699 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39700 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter"
)), 0))
) {
39701 return false;
39702 }
39703 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39703); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39703); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39704 args.rval().setBoolean(result);
39705 return true;
39706}
39707
39708static const JSJitInfo conditionalOnSecureContext4_getterinfo = {
39709 { get_conditionalOnSecureContext4 },
39710 { prototypes::id::TestJSImplInterface },
39711 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39712 JSJitInfo::Getter,
39713 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39714 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39715 false, /* isInfallible. False in setters. */
39716 false, /* isMovable. Not relevant for setters. */
39717 false, /* isEliminatable. Not relevant for setters. */
39718 false, /* isAlwaysInSlot. Only relevant for getters. */
39719 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39720 false, /* isTypedMethod. Only relevant for methods. */
39721 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39722};
39723
39724MOZ_CAN_RUN_SCRIPT static bool
39725conditionalOnSecureContext5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39726{
39727 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39730( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39728 "TestJSImplInterface", "conditionalOnSecureContext5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39730( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39729 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39730( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39730 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39730( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39731
39732 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39733 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39734 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39735 if (objIsXray) {
39736 unwrappedObj.emplace(cx, obj);
39737 }
39738 if (objIsXray) {
39739 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39740 // we know Xrays have no dynamic unwrap behavior.
39741 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39742 if (!unwrappedObj.ref()) {
39743 return false;
39744 }
39745 }
39746 FastErrorResult rv;
39747 // NOTE: This assert does NOT call the function.
39748 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");
39749 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39750 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5"
)), 0))
) {
39751 return false;
39752 }
39753 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39753); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39753); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39754 args.rval().setUndefined();
39755 return true;
39756}
39757
39758static const JSJitInfo conditionalOnSecureContext5_methodinfo = {
39759 { (JSJitGetterOp)conditionalOnSecureContext5 },
39760 { prototypes::id::TestJSImplInterface },
39761 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39762 JSJitInfo::Method,
39763 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39764 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39765 false, /* isInfallible. False in setters. */
39766 false, /* isMovable. Not relevant for setters. */
39767 false, /* isEliminatable. Not relevant for setters. */
39768 false, /* isAlwaysInSlot. Only relevant for getters. */
39769 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39770 false, /* isTypedMethod. Only relevant for methods. */
39771 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39772};
39773
39774MOZ_CAN_RUN_SCRIPT static bool
39775conditionalOnSecureContext6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39776{
39777 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39780( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39778 "TestJSImplInterface", "conditionalOnSecureContext6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39780( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39779 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39780( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39780 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39780( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39781
39782 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39783 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39784 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39785 if (objIsXray) {
39786 unwrappedObj.emplace(cx, obj);
39787 }
39788 if (objIsXray) {
39789 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39790 // we know Xrays have no dynamic unwrap behavior.
39791 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39792 if (!unwrappedObj.ref()) {
39793 return false;
39794 }
39795 }
39796 FastErrorResult rv;
39797 // NOTE: This assert does NOT call the function.
39798 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");
39799 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39800 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6"
)), 0))
) {
39801 return false;
39802 }
39803 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39803); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39803); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39804 args.rval().setUndefined();
39805 return true;
39806}
39807
39808static const JSJitInfo conditionalOnSecureContext6_methodinfo = {
39809 { (JSJitGetterOp)conditionalOnSecureContext6 },
39810 { prototypes::id::TestJSImplInterface },
39811 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39812 JSJitInfo::Method,
39813 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39814 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39815 false, /* isInfallible. False in setters. */
39816 false, /* isMovable. Not relevant for setters. */
39817 false, /* isEliminatable. Not relevant for setters. */
39818 false, /* isAlwaysInSlot. Only relevant for getters. */
39819 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39820 false, /* isTypedMethod. Only relevant for methods. */
39821 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39822};
39823
39824MOZ_CAN_RUN_SCRIPT static bool
39825conditionalOnSecureContext7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39826{
39827 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39830( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39828 "TestJSImplInterface", "conditionalOnSecureContext7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39830( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39829 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39830( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39830 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39830( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39831
39832 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39833 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39834 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39835 if (objIsXray) {
39836 unwrappedObj.emplace(cx, obj);
39837 }
39838 if (objIsXray) {
39839 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39840 // we know Xrays have no dynamic unwrap behavior.
39841 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39842 if (!unwrappedObj.ref()) {
39843 return false;
39844 }
39845 }
39846 FastErrorResult rv;
39847 // NOTE: This assert does NOT call the function.
39848 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");
39849 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39850 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7"
)), 0))
) {
39851 return false;
39852 }
39853 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39853); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39853); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39854 args.rval().setUndefined();
39855 return true;
39856}
39857
39858static const JSJitInfo conditionalOnSecureContext7_methodinfo = {
39859 { (JSJitGetterOp)conditionalOnSecureContext7 },
39860 { prototypes::id::TestJSImplInterface },
39861 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39862 JSJitInfo::Method,
39863 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39864 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39865 false, /* isInfallible. False in setters. */
39866 false, /* isMovable. Not relevant for setters. */
39867 false, /* isEliminatable. Not relevant for setters. */
39868 false, /* isAlwaysInSlot. Only relevant for getters. */
39869 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39870 false, /* isTypedMethod. Only relevant for methods. */
39871 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39872};
39873
39874MOZ_CAN_RUN_SCRIPT static bool
39875conditionalOnSecureContext8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39876{
39877 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39880( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39878 "TestJSImplInterface", "conditionalOnSecureContext8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39880( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39879 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39880( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39880 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39880( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39881
39882 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39883 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39884 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39885 if (objIsXray) {
39886 unwrappedObj.emplace(cx, obj);
39887 }
39888 if (objIsXray) {
39889 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39890 // we know Xrays have no dynamic unwrap behavior.
39891 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39892 if (!unwrappedObj.ref()) {
39893 return false;
39894 }
39895 }
39896 FastErrorResult rv;
39897 // NOTE: This assert does NOT call the function.
39898 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");
39899 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39900 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8"
)), 0))
) {
39901 return false;
39902 }
39903 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39903); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39903); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39904 args.rval().setUndefined();
39905 return true;
39906}
39907
39908static const JSJitInfo conditionalOnSecureContext8_methodinfo = {
39909 { (JSJitGetterOp)conditionalOnSecureContext8 },
39910 { prototypes::id::TestJSImplInterface },
39911 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39912 JSJitInfo::Method,
39913 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39914 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39915 false, /* isInfallible. False in setters. */
39916 false, /* isMovable. Not relevant for setters. */
39917 false, /* isEliminatable. Not relevant for setters. */
39918 false, /* isAlwaysInSlot. Only relevant for getters. */
39919 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39920 false, /* isTypedMethod. Only relevant for methods. */
39921 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39922};
39923
39924MOZ_CAN_RUN_SCRIPT static bool
39925get_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39926{
39927 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39930( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39928 "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39930( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39929 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39930( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39930 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39930( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39931
39932 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39933 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39934 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39935 if (objIsXray) {
39936 unwrappedObj.emplace(cx, obj);
39937 }
39938 if (objIsXray) {
39939 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39940 // we know Xrays have no dynamic unwrap behavior.
39941 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39942 if (!unwrappedObj.ref()) {
39943 return false;
39944 }
39945 }
39946 FastErrorResult rv;
39947 int32_t result(MOZ_KnownLive(self)(self)->GetAttrWithLenientThis(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39948 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter"
)), 0))
) {
39949 return false;
39950 }
39951 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39951); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39951); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39952 args.rval().setInt32(int32_t(result));
39953 return true;
39954}
39955
39956MOZ_CAN_RUN_SCRIPT static bool
39957set_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
39958{
39959 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39962( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39960 "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39962( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39961 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject39962( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39962 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39962( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39963
39964 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39965 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39966 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39967 if (objIsXray) {
39968 unwrappedObj.emplace(cx, obj);
39969 }
39970 int32_t arg0;
39971 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
39972 return false;
39973 }
39974 if (objIsXray) {
39975 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39976 // we know Xrays have no dynamic unwrap behavior.
39977 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39978 if (!unwrappedObj.ref()) {
39979 return false;
39980 }
39981 }
39982 FastErrorResult rv;
39983 // NOTE: This assert does NOT call the function.
39984 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");
39985 MOZ_KnownLive(self)(self)->SetAttrWithLenientThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39986 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter"
)), 0))
) {
39987 return false;
39988 }
39989 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39989); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 39989); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
39990
39991 return true;
39992}
39993
39994static const JSJitInfo attrWithLenientThis_getterinfo = {
39995 { get_attrWithLenientThis },
39996 { prototypes::id::TestJSImplInterface },
39997 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39998 JSJitInfo::Getter,
39999 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40000 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
40001 false, /* isInfallible. False in setters. */
40002 false, /* isMovable. Not relevant for setters. */
40003 false, /* isEliminatable. Not relevant for setters. */
40004 false, /* isAlwaysInSlot. Only relevant for getters. */
40005 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40006 false, /* isTypedMethod. Only relevant for methods. */
40007 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40008};
40009static const JSJitInfo attrWithLenientThis_setterinfo = {
40010 { (JSJitGetterOp)set_attrWithLenientThis },
40011 { prototypes::id::TestJSImplInterface },
40012 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40013 JSJitInfo::Setter,
40014 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40015 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40016 false, /* isInfallible. False in setters. */
40017 false, /* isMovable. Not relevant for setters. */
40018 false, /* isEliminatable. Not relevant for setters. */
40019 false, /* isAlwaysInSlot. Only relevant for getters. */
40020 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40021 false, /* isTypedMethod. Only relevant for methods. */
40022 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40023};
40024
40025MOZ_CAN_RUN_SCRIPT static bool
40026passRenamedInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40027{
40028 BindingCallContext cx(cx_, "TestJSImplInterface.passRenamedInterface");
40029 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40032( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40030 "TestJSImplInterface", "passRenamedInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40032( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40031 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40032( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40032 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40032( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40033
40034 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40035 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRenamedInterface", 1)) {
40036 return false;
40037 }
40038 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40039 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40040 if (objIsXray) {
40041 unwrappedObj.emplace(cx, obj);
40042 }
40043 NonNull<nsRenamedInterface> arg0;
40044 if (args[0].isObject()) {
40045 {
40046 // Our JSContext should be in the right global to do unwrapping in.
40047 nsresult rv = UnwrapObject<prototypes::id::TestRenamedInterface, nsRenamedInterface>(args[0], arg0, cx);
40048 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
40049 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestRenamedInterface");
40050 return false;
40051 }
40052 }
40053 } else {
40054 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
40055 return false;
40056 }
40057 if (objIsXray) {
40058 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40059 // we know Xrays have no dynamic unwrap behavior.
40060 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40061 if (!unwrappedObj.ref()) {
40062 return false;
40063 }
40064 }
40065 FastErrorResult rv;
40066 // NOTE: This assert does NOT call the function.
40067 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");
40068 MOZ_KnownLive(self)(self)->PassRenamedInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40069 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface"
)), 0))
) {
40070 return false;
40071 }
40072 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40072); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40072); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40073 args.rval().setUndefined();
40074 return true;
40075}
40076
40077static const JSJitInfo passRenamedInterface_methodinfo = {
40078 { (JSJitGetterOp)passRenamedInterface },
40079 { prototypes::id::TestJSImplInterface },
40080 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40081 JSJitInfo::Method,
40082 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40083 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40084 false, /* isInfallible. False in setters. */
40085 false, /* isMovable. Not relevant for setters. */
40086 false, /* isEliminatable. Not relevant for setters. */
40087 false, /* isAlwaysInSlot. Only relevant for getters. */
40088 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40089 false, /* isTypedMethod. Only relevant for methods. */
40090 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40091};
40092
40093MOZ_CAN_RUN_SCRIPT static bool
40094get_putForwardsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40095{
40096 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40097 "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40098 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40099 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40099( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40100
40101 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40102 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40103 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40104 if (objIsXray) {
40105 unwrappedObj.emplace(cx, obj);
40106 }
40107 if (objIsXray) {
40108 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40109 // we know Xrays have no dynamic unwrap behavior.
40110 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40111 if (!unwrappedObj.ref()) {
40112 return false;
40113 }
40114 }
40115 FastErrorResult rv;
40116 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40117 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter"
)), 0))
) {
40118 return false;
40119 }
40120 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40120); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40120); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40121 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40122 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40122); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40122); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40123 return false;
40124 }
40125 return true;
40126}
40127
40128MOZ_CAN_RUN_SCRIPT static bool
40129set_putForwardsAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40130{
40131 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr setter");
40132 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40133 "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40134 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40135 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40135( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40136
40137 JS::Rooted<JS::Value> v(cx);
40138 if (!JS_GetProperty(cx, obj, "putForwardsAttr", &v)) {
40139 return false;
40140 }
40141
40142 if (!v.isObject()) {
40143 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr");
40144 }
40145
40146 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40147 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40148}
40149
40150static const JSJitInfo putForwardsAttr_getterinfo = {
40151 { get_putForwardsAttr },
40152 { prototypes::id::TestJSImplInterface },
40153 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40154 JSJitInfo::Getter,
40155 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40156 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40157 false, /* isInfallible. False in setters. */
40158 false, /* isMovable. Not relevant for setters. */
40159 false, /* isEliminatable. Not relevant for setters. */
40160 false, /* isAlwaysInSlot. Only relevant for getters. */
40161 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40162 false, /* isTypedMethod. Only relevant for methods. */
40163 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40164};
40165static const JSJitInfo putForwardsAttr_setterinfo = {
40166 { (JSJitGetterOp)set_putForwardsAttr },
40167 { prototypes::id::TestJSImplInterface },
40168 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40169 JSJitInfo::Setter,
40170 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40171 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40172 false, /* isInfallible. False in setters. */
40173 false, /* isMovable. Not relevant for setters. */
40174 false, /* isEliminatable. Not relevant for setters. */
40175 false, /* isAlwaysInSlot. Only relevant for getters. */
40176 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40177 false, /* isTypedMethod. Only relevant for methods. */
40178 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40179};
40180
40181MOZ_CAN_RUN_SCRIPT static bool
40182get_putForwardsAttr2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40183{
40184 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40185 "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40186 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40187 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40187( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40188
40189 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40190 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40191 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40192 if (objIsXray) {
40193 unwrappedObj.emplace(cx, obj);
40194 }
40195 if (objIsXray) {
40196 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40197 // we know Xrays have no dynamic unwrap behavior.
40198 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40199 if (!unwrappedObj.ref()) {
40200 return false;
40201 }
40202 }
40203 FastErrorResult rv;
40204 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40205 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 getter"
)), 0))
) {
40206 return false;
40207 }
40208 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40208); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40208); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40209 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40210 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40210); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40210); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40211 return false;
40212 }
40213 return true;
40214}
40215
40216MOZ_CAN_RUN_SCRIPT static bool
40217set_putForwardsAttr2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40218{
40219 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr2 setter");
40220 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40221 "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40222 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40223 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40223( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40224
40225 JS::Rooted<JS::Value> v(cx);
40226 if (!JS_GetProperty(cx, obj, "putForwardsAttr2", &v)) {
40227 return false;
40228 }
40229
40230 if (!v.isObject()) {
40231 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr2");
40232 }
40233
40234 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40235 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40236}
40237
40238static const JSJitInfo putForwardsAttr2_getterinfo = {
40239 { get_putForwardsAttr2 },
40240 { prototypes::id::TestJSImplInterface },
40241 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40242 JSJitInfo::Getter,
40243 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40244 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40245 false, /* isInfallible. False in setters. */
40246 false, /* isMovable. Not relevant for setters. */
40247 false, /* isEliminatable. Not relevant for setters. */
40248 false, /* isAlwaysInSlot. Only relevant for getters. */
40249 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40250 false, /* isTypedMethod. Only relevant for methods. */
40251 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40252};
40253static const JSJitInfo putForwardsAttr2_setterinfo = {
40254 { (JSJitGetterOp)set_putForwardsAttr2 },
40255 { prototypes::id::TestJSImplInterface },
40256 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40257 JSJitInfo::Setter,
40258 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40259 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40260 false, /* isInfallible. False in setters. */
40261 false, /* isMovable. Not relevant for setters. */
40262 false, /* isEliminatable. Not relevant for setters. */
40263 false, /* isAlwaysInSlot. Only relevant for getters. */
40264 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40265 false, /* isTypedMethod. Only relevant for methods. */
40266 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40267};
40268
40269MOZ_CAN_RUN_SCRIPT static bool
40270get_putForwardsAttr3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40271{
40272 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40273 "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40274 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40275 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40275( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40276
40277 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40278 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40279 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40280 if (objIsXray) {
40281 unwrappedObj.emplace(cx, obj);
40282 }
40283 if (objIsXray) {
40284 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40285 // we know Xrays have no dynamic unwrap behavior.
40286 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40287 if (!unwrappedObj.ref()) {
40288 return false;
40289 }
40290 }
40291 FastErrorResult rv;
40292 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40293 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 getter"
)), 0))
) {
40294 return false;
40295 }
40296 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40296); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40296); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40297 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40298 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40298); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40299 return false;
40300 }
40301 return true;
40302}
40303
40304MOZ_CAN_RUN_SCRIPT static bool
40305set_putForwardsAttr3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40306{
40307 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr3 setter");
40308 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40311( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40309 "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40311( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40310 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40311( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40311 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40311( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40312
40313 JS::Rooted<JS::Value> v(cx);
40314 if (!JS_GetProperty(cx, obj, "putForwardsAttr3", &v)) {
40315 return false;
40316 }
40317
40318 if (!v.isObject()) {
40319 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr3");
40320 }
40321
40322 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40323 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40324}
40325
40326static const JSJitInfo putForwardsAttr3_getterinfo = {
40327 { get_putForwardsAttr3 },
40328 { prototypes::id::TestJSImplInterface },
40329 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40330 JSJitInfo::Getter,
40331 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40332 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40333 false, /* isInfallible. False in setters. */
40334 false, /* isMovable. Not relevant for setters. */
40335 false, /* isEliminatable. Not relevant for setters. */
40336 false, /* isAlwaysInSlot. Only relevant for getters. */
40337 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40338 false, /* isTypedMethod. Only relevant for methods. */
40339 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40340};
40341static const JSJitInfo putForwardsAttr3_setterinfo = {
40342 { (JSJitGetterOp)set_putForwardsAttr3 },
40343 { prototypes::id::TestJSImplInterface },
40344 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40345 JSJitInfo::Setter,
40346 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40347 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40348 false, /* isInfallible. False in setters. */
40349 false, /* isMovable. Not relevant for setters. */
40350 false, /* isEliminatable. Not relevant for setters. */
40351 false, /* isAlwaysInSlot. Only relevant for getters. */
40352 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40353 false, /* isTypedMethod. Only relevant for methods. */
40354 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40355};
40356
40357MOZ_CAN_RUN_SCRIPT static bool
40358throwingMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40359{
40360 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40363( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40361 "TestJSImplInterface", "throwingMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40363( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40362 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40363( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40363 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40363( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40364
40365 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40366 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40367 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40368 if (objIsXray) {
40369 unwrappedObj.emplace(cx, obj);
40370 }
40371 if (objIsXray) {
40372 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40373 // we know Xrays have no dynamic unwrap behavior.
40374 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40375 if (!unwrappedObj.ref()) {
40376 return false;
40377 }
40378 }
40379 FastErrorResult rv;
40380 // NOTE: This assert does NOT call the function.
40381 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");
40382 MOZ_KnownLive(self)(self)->ThrowingMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40383 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod"
)), 0))
) {
40384 return false;
40385 }
40386 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40386); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40386); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40387 args.rval().setUndefined();
40388 return true;
40389}
40390
40391static const JSJitInfo throwingMethod_methodinfo = {
40392 { (JSJitGetterOp)throwingMethod },
40393 { prototypes::id::TestJSImplInterface },
40394 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40395 JSJitInfo::Method,
40396 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40397 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40398 false, /* isInfallible. False in setters. */
40399 false, /* isMovable. Not relevant for setters. */
40400 false, /* isEliminatable. Not relevant for setters. */
40401 false, /* isAlwaysInSlot. Only relevant for getters. */
40402 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40403 false, /* isTypedMethod. Only relevant for methods. */
40404 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40405};
40406
40407MOZ_CAN_RUN_SCRIPT static bool
40408get_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40409{
40410 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40413( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40411 "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40413( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40412 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40413( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40413 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40413( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40414
40415 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40416 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40417 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40418 if (objIsXray) {
40419 unwrappedObj.emplace(cx, obj);
40420 }
40421 if (objIsXray) {
40422 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40423 // we know Xrays have no dynamic unwrap behavior.
40424 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40425 if (!unwrappedObj.ref()) {
40426 return false;
40427 }
40428 }
40429 FastErrorResult rv;
40430 bool result(MOZ_KnownLive(self)(self)->GetThrowingAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40431 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter"
)), 0))
) {
40432 return false;
40433 }
40434 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40434); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40434); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40435 args.rval().setBoolean(result);
40436 return true;
40437}
40438
40439MOZ_CAN_RUN_SCRIPT static bool
40440set_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40441{
40442 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40445( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40443 "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40445( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40444 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40445( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40445 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40445( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40446
40447 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40448 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40449 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40450 if (objIsXray) {
40451 unwrappedObj.emplace(cx, obj);
40452 }
40453 bool arg0;
40454 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40455 return false;
40456 }
40457 if (objIsXray) {
40458 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40459 // we know Xrays have no dynamic unwrap behavior.
40460 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40461 if (!unwrappedObj.ref()) {
40462 return false;
40463 }
40464 }
40465 FastErrorResult rv;
40466 // NOTE: This assert does NOT call the function.
40467 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");
40468 MOZ_KnownLive(self)(self)->SetThrowingAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40469 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter"
)), 0))
) {
40470 return false;
40471 }
40472 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40472); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40472); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40473
40474 return true;
40475}
40476
40477static const JSJitInfo throwingAttr_getterinfo = {
40478 { get_throwingAttr },
40479 { prototypes::id::TestJSImplInterface },
40480 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40481 JSJitInfo::Getter,
40482 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40483 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40484 false, /* isInfallible. False in setters. */
40485 false, /* isMovable. Not relevant for setters. */
40486 false, /* isEliminatable. Not relevant for setters. */
40487 false, /* isAlwaysInSlot. Only relevant for getters. */
40488 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40489 false, /* isTypedMethod. Only relevant for methods. */
40490 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40491};
40492static const JSJitInfo throwingAttr_setterinfo = {
40493 { (JSJitGetterOp)set_throwingAttr },
40494 { prototypes::id::TestJSImplInterface },
40495 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40496 JSJitInfo::Setter,
40497 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40498 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40499 false, /* isInfallible. False in setters. */
40500 false, /* isMovable. Not relevant for setters. */
40501 false, /* isEliminatable. Not relevant for setters. */
40502 false, /* isAlwaysInSlot. Only relevant for getters. */
40503 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40504 false, /* isTypedMethod. Only relevant for methods. */
40505 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40506};
40507
40508MOZ_CAN_RUN_SCRIPT static bool
40509get_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40510{
40511 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40514( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40512 "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40514( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40513 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40514( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40514 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40514( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40515
40516 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40517 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40518 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40519 if (objIsXray) {
40520 unwrappedObj.emplace(cx, obj);
40521 }
40522 if (objIsXray) {
40523 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40524 // we know Xrays have no dynamic unwrap behavior.
40525 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40526 if (!unwrappedObj.ref()) {
40527 return false;
40528 }
40529 }
40530 FastErrorResult rv;
40531 bool result(MOZ_KnownLive(self)(self)->GetThrowingGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40532 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter"
)), 0))
) {
40533 return false;
40534 }
40535 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40535); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40535); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40536 args.rval().setBoolean(result);
40537 return true;
40538}
40539
40540MOZ_CAN_RUN_SCRIPT static bool
40541set_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40542{
40543 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40546( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40544 "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40546( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40545 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40546( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40546 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40546( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40547
40548 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40549 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40550 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40551 if (objIsXray) {
40552 unwrappedObj.emplace(cx, obj);
40553 }
40554 bool arg0;
40555 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40556 return false;
40557 }
40558 if (objIsXray) {
40559 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40560 // we know Xrays have no dynamic unwrap behavior.
40561 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40562 if (!unwrappedObj.ref()) {
40563 return false;
40564 }
40565 }
40566 FastErrorResult rv;
40567 // NOTE: This assert does NOT call the function.
40568 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");
40569 MOZ_KnownLive(self)(self)->SetThrowingGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40570 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter"
)), 0))
) {
40571 return false;
40572 }
40573 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40573); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40573); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40574
40575 return true;
40576}
40577
40578static const JSJitInfo throwingGetterAttr_getterinfo = {
40579 { get_throwingGetterAttr },
40580 { prototypes::id::TestJSImplInterface },
40581 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40582 JSJitInfo::Getter,
40583 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40584 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40585 false, /* isInfallible. False in setters. */
40586 false, /* isMovable. Not relevant for setters. */
40587 false, /* isEliminatable. Not relevant for setters. */
40588 false, /* isAlwaysInSlot. Only relevant for getters. */
40589 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40590 false, /* isTypedMethod. Only relevant for methods. */
40591 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40592};
40593static const JSJitInfo throwingGetterAttr_setterinfo = {
40594 { (JSJitGetterOp)set_throwingGetterAttr },
40595 { prototypes::id::TestJSImplInterface },
40596 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40597 JSJitInfo::Setter,
40598 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40599 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40600 false, /* isInfallible. False in setters. */
40601 false, /* isMovable. Not relevant for setters. */
40602 false, /* isEliminatable. Not relevant for setters. */
40603 false, /* isAlwaysInSlot. Only relevant for getters. */
40604 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40605 false, /* isTypedMethod. Only relevant for methods. */
40606 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40607};
40608
40609MOZ_CAN_RUN_SCRIPT static bool
40610get_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40611{
40612 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40615( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40613 "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40615( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40614 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40615( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40615 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40615( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40616
40617 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40618 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40619 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40620 if (objIsXray) {
40621 unwrappedObj.emplace(cx, obj);
40622 }
40623 if (objIsXray) {
40624 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40625 // we know Xrays have no dynamic unwrap behavior.
40626 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40627 if (!unwrappedObj.ref()) {
40628 return false;
40629 }
40630 }
40631 FastErrorResult rv;
40632 bool result(MOZ_KnownLive(self)(self)->GetThrowingSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40633 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter"
)), 0))
) {
40634 return false;
40635 }
40636 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40636); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40636); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40637 args.rval().setBoolean(result);
40638 return true;
40639}
40640
40641MOZ_CAN_RUN_SCRIPT static bool
40642set_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40643{
40644 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40647( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40645 "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40647( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40646 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40647( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40647 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40647( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40648
40649 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40650 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40651 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40652 if (objIsXray) {
40653 unwrappedObj.emplace(cx, obj);
40654 }
40655 bool arg0;
40656 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40657 return false;
40658 }
40659 if (objIsXray) {
40660 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40661 // we know Xrays have no dynamic unwrap behavior.
40662 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40663 if (!unwrappedObj.ref()) {
40664 return false;
40665 }
40666 }
40667 FastErrorResult rv;
40668 // NOTE: This assert does NOT call the function.
40669 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");
40670 MOZ_KnownLive(self)(self)->SetThrowingSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40671 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter"
)), 0))
) {
40672 return false;
40673 }
40674 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40674); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40674); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40675
40676 return true;
40677}
40678
40679static const JSJitInfo throwingSetterAttr_getterinfo = {
40680 { get_throwingSetterAttr },
40681 { prototypes::id::TestJSImplInterface },
40682 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40683 JSJitInfo::Getter,
40684 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40685 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40686 false, /* isInfallible. False in setters. */
40687 false, /* isMovable. Not relevant for setters. */
40688 false, /* isEliminatable. Not relevant for setters. */
40689 false, /* isAlwaysInSlot. Only relevant for getters. */
40690 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40691 false, /* isTypedMethod. Only relevant for methods. */
40692 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40693};
40694static const JSJitInfo throwingSetterAttr_setterinfo = {
40695 { (JSJitGetterOp)set_throwingSetterAttr },
40696 { prototypes::id::TestJSImplInterface },
40697 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40698 JSJitInfo::Setter,
40699 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40700 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40701 false, /* isInfallible. False in setters. */
40702 false, /* isMovable. Not relevant for setters. */
40703 false, /* isEliminatable. Not relevant for setters. */
40704 false, /* isAlwaysInSlot. Only relevant for getters. */
40705 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40706 false, /* isTypedMethod. Only relevant for methods. */
40707 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40708};
40709
40710MOZ_CAN_RUN_SCRIPT static bool
40711canOOMMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40712{
40713 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40716( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40714 "TestJSImplInterface", "canOOMMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40716( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40715 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40716( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40716 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40716( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40717
40718 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40719 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40720 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40721 if (objIsXray) {
40722 unwrappedObj.emplace(cx, obj);
40723 }
40724 if (objIsXray) {
40725 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40726 // we know Xrays have no dynamic unwrap behavior.
40727 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40728 if (!unwrappedObj.ref()) {
40729 return false;
40730 }
40731 }
40732 FastErrorResult rv;
40733 // NOTE: This assert does NOT call the function.
40734 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");
40735 MOZ_KnownLive(self)(self)->CanOOMMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40736 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod"
)), 0))
) {
40737 return false;
40738 }
40739 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40739); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40739); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40740 args.rval().setUndefined();
40741 return true;
40742}
40743
40744static const JSJitInfo canOOMMethod_methodinfo = {
40745 { (JSJitGetterOp)canOOMMethod },
40746 { prototypes::id::TestJSImplInterface },
40747 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40748 JSJitInfo::Method,
40749 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40750 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40751 false, /* isInfallible. False in setters. */
40752 false, /* isMovable. Not relevant for setters. */
40753 false, /* isEliminatable. Not relevant for setters. */
40754 false, /* isAlwaysInSlot. Only relevant for getters. */
40755 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40756 false, /* isTypedMethod. Only relevant for methods. */
40757 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40758};
40759
40760MOZ_CAN_RUN_SCRIPT static bool
40761get_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40762{
40763 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40766( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40764 "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40766( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40765 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40766( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40766 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40766( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40767
40768 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40769 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40770 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40771 if (objIsXray) {
40772 unwrappedObj.emplace(cx, obj);
40773 }
40774 if (objIsXray) {
40775 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40776 // we know Xrays have no dynamic unwrap behavior.
40777 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40778 if (!unwrappedObj.ref()) {
40779 return false;
40780 }
40781 }
40782 FastErrorResult rv;
40783 bool result(MOZ_KnownLive(self)(self)->GetCanOOMAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40784 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter"
)), 0))
) {
40785 return false;
40786 }
40787 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40787); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40787); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40788 args.rval().setBoolean(result);
40789 return true;
40790}
40791
40792MOZ_CAN_RUN_SCRIPT static bool
40793set_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40794{
40795 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40798( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40796 "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40798( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40797 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40798( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40798 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40798( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40799
40800 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40801 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40802 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40803 if (objIsXray) {
40804 unwrappedObj.emplace(cx, obj);
40805 }
40806 bool arg0;
40807 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40808 return false;
40809 }
40810 if (objIsXray) {
40811 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40812 // we know Xrays have no dynamic unwrap behavior.
40813 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40814 if (!unwrappedObj.ref()) {
40815 return false;
40816 }
40817 }
40818 FastErrorResult rv;
40819 // NOTE: This assert does NOT call the function.
40820 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");
40821 MOZ_KnownLive(self)(self)->SetCanOOMAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40822 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter"
)), 0))
) {
40823 return false;
40824 }
40825 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40825); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40825); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40826
40827 return true;
40828}
40829
40830static const JSJitInfo canOOMAttr_getterinfo = {
40831 { get_canOOMAttr },
40832 { prototypes::id::TestJSImplInterface },
40833 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40834 JSJitInfo::Getter,
40835 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40836 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40837 false, /* isInfallible. False in setters. */
40838 false, /* isMovable. Not relevant for setters. */
40839 false, /* isEliminatable. Not relevant for setters. */
40840 false, /* isAlwaysInSlot. Only relevant for getters. */
40841 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40842 false, /* isTypedMethod. Only relevant for methods. */
40843 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40844};
40845static const JSJitInfo canOOMAttr_setterinfo = {
40846 { (JSJitGetterOp)set_canOOMAttr },
40847 { prototypes::id::TestJSImplInterface },
40848 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40849 JSJitInfo::Setter,
40850 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40851 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40852 false, /* isInfallible. False in setters. */
40853 false, /* isMovable. Not relevant for setters. */
40854 false, /* isEliminatable. Not relevant for setters. */
40855 false, /* isAlwaysInSlot. Only relevant for getters. */
40856 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40857 false, /* isTypedMethod. Only relevant for methods. */
40858 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40859};
40860
40861MOZ_CAN_RUN_SCRIPT static bool
40862get_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40863{
40864 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40867( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40865 "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40867( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40866 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40867( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40867 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40867( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40868
40869 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40870 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40871 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40872 if (objIsXray) {
40873 unwrappedObj.emplace(cx, obj);
40874 }
40875 if (objIsXray) {
40876 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40877 // we know Xrays have no dynamic unwrap behavior.
40878 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40879 if (!unwrappedObj.ref()) {
40880 return false;
40881 }
40882 }
40883 FastErrorResult rv;
40884 bool result(MOZ_KnownLive(self)(self)->GetCanOOMGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40885 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter"
)), 0))
) {
40886 return false;
40887 }
40888 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40888); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40888); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40889 args.rval().setBoolean(result);
40890 return true;
40891}
40892
40893MOZ_CAN_RUN_SCRIPT static bool
40894set_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40895{
40896 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40899( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40897 "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40899( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40898 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40899( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40899 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40899( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40900
40901 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40902 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40903 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40904 if (objIsXray) {
40905 unwrappedObj.emplace(cx, obj);
40906 }
40907 bool arg0;
40908 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40909 return false;
40910 }
40911 if (objIsXray) {
40912 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40913 // we know Xrays have no dynamic unwrap behavior.
40914 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40915 if (!unwrappedObj.ref()) {
40916 return false;
40917 }
40918 }
40919 FastErrorResult rv;
40920 // NOTE: This assert does NOT call the function.
40921 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");
40922 MOZ_KnownLive(self)(self)->SetCanOOMGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40923 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter"
)), 0))
) {
40924 return false;
40925 }
40926 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40926); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40927
40928 return true;
40929}
40930
40931static const JSJitInfo canOOMGetterAttr_getterinfo = {
40932 { get_canOOMGetterAttr },
40933 { prototypes::id::TestJSImplInterface },
40934 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40935 JSJitInfo::Getter,
40936 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40937 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40938 false, /* isInfallible. False in setters. */
40939 false, /* isMovable. Not relevant for setters. */
40940 false, /* isEliminatable. Not relevant for setters. */
40941 false, /* isAlwaysInSlot. Only relevant for getters. */
40942 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40943 false, /* isTypedMethod. Only relevant for methods. */
40944 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40945};
40946static const JSJitInfo canOOMGetterAttr_setterinfo = {
40947 { (JSJitGetterOp)set_canOOMGetterAttr },
40948 { prototypes::id::TestJSImplInterface },
40949 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40950 JSJitInfo::Setter,
40951 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40952 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40953 false, /* isInfallible. False in setters. */
40954 false, /* isMovable. Not relevant for setters. */
40955 false, /* isEliminatable. Not relevant for setters. */
40956 false, /* isAlwaysInSlot. Only relevant for getters. */
40957 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40958 false, /* isTypedMethod. Only relevant for methods. */
40959 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40960};
40961
40962MOZ_CAN_RUN_SCRIPT static bool
40963get_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40964{
40965 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40968( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40966 "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40968( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40967 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40968( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40968 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40968( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40969
40970 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40971 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40972 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40973 if (objIsXray) {
40974 unwrappedObj.emplace(cx, obj);
40975 }
40976 if (objIsXray) {
40977 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40978 // we know Xrays have no dynamic unwrap behavior.
40979 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40980 if (!unwrappedObj.ref()) {
40981 return false;
40982 }
40983 }
40984 FastErrorResult rv;
40985 bool result(MOZ_KnownLive(self)(self)->GetCanOOMSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40986 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter"
)), 0))
) {
40987 return false;
40988 }
40989 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40989); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 40989); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
40990 args.rval().setBoolean(result);
40991 return true;
40992}
40993
40994MOZ_CAN_RUN_SCRIPT static bool
40995set_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40996{
40997 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41000( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40998 "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41000( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40999 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41000( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41000 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41000( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41001
41002 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41003 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41004 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41005 if (objIsXray) {
41006 unwrappedObj.emplace(cx, obj);
41007 }
41008 bool arg0;
41009 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41010 return false;
41011 }
41012 if (objIsXray) {
41013 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41014 // we know Xrays have no dynamic unwrap behavior.
41015 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41016 if (!unwrappedObj.ref()) {
41017 return false;
41018 }
41019 }
41020 FastErrorResult rv;
41021 // NOTE: This assert does NOT call the function.
41022 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");
41023 MOZ_KnownLive(self)(self)->SetCanOOMSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41024 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter"
)), 0))
) {
41025 return false;
41026 }
41027 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41027); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41027); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41028
41029 return true;
41030}
41031
41032static const JSJitInfo canOOMSetterAttr_getterinfo = {
41033 { get_canOOMSetterAttr },
41034 { prototypes::id::TestJSImplInterface },
41035 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41036 JSJitInfo::Getter,
41037 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41038 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
41039 false, /* isInfallible. False in setters. */
41040 false, /* isMovable. Not relevant for setters. */
41041 false, /* isEliminatable. Not relevant for setters. */
41042 false, /* isAlwaysInSlot. Only relevant for getters. */
41043 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41044 false, /* isTypedMethod. Only relevant for methods. */
41045 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41046};
41047static const JSJitInfo canOOMSetterAttr_setterinfo = {
41048 { (JSJitGetterOp)set_canOOMSetterAttr },
41049 { prototypes::id::TestJSImplInterface },
41050 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41051 JSJitInfo::Setter,
41052 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41053 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41054 false, /* isInfallible. False in setters. */
41055 false, /* isMovable. Not relevant for setters. */
41056 false, /* isEliminatable. Not relevant for setters. */
41057 false, /* isAlwaysInSlot. Only relevant for getters. */
41058 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41059 false, /* isTypedMethod. Only relevant for methods. */
41060 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41061};
41062
41063MOZ_CAN_RUN_SCRIPT static bool
41064ceReactionsMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41065{
41066 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41069( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41067 "TestJSImplInterface", "ceReactionsMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41069( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41068 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41069( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41069 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41069( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41070
41071 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41072 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41073 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41074 if (objIsXray) {
41075 unwrappedObj.emplace(cx, obj);
41076 }
41077 if (objIsXray) {
41078 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41079 // we know Xrays have no dynamic unwrap behavior.
41080 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41081 if (!unwrappedObj.ref()) {
41082 return false;
41083 }
41084 }
41085 Maybe<AutoCEReaction> ceReaction;
41086 DocGroup* docGroup = self->GetDocGroup();
41087 if (docGroup) {
41088 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41089 }
41090 FastErrorResult rv;
41091 // NOTE: This assert does NOT call the function.
41092 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");
41093 MOZ_KnownLive(self)(self)->CeReactionsMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41094 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod"
)), 0))
) {
41095 return false;
41096 }
41097 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41097); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41097); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41098 args.rval().setUndefined();
41099 return true;
41100}
41101
41102static const JSJitInfo ceReactionsMethod_methodinfo = {
41103 { (JSJitGetterOp)ceReactionsMethod },
41104 { prototypes::id::TestJSImplInterface },
41105 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41106 JSJitInfo::Method,
41107 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41108 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41109 false, /* isInfallible. False in setters. */
41110 false, /* isMovable. Not relevant for setters. */
41111 false, /* isEliminatable. Not relevant for setters. */
41112 false, /* isAlwaysInSlot. Only relevant for getters. */
41113 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41114 false, /* isTypedMethod. Only relevant for methods. */
41115 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41116};
41117
41118MOZ_CAN_RUN_SCRIPT static bool
41119ceReactionsMethodOverload(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41120{
41121 BindingCallContext cx(cx_, "TestJSImplInterface.ceReactionsMethodOverload");
41122 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41125( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41123 "TestJSImplInterface", "ceReactionsMethodOverload", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41125( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41124 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41125( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41125 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41125( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
41126
41127 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41128 unsigned argcount = std::min(args.length(), 1u);
41129 switch (argcount) {
41130 case 0: {
41131 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41132 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41133 if (objIsXray) {
41134 unwrappedObj.emplace(cx, obj);
41135 }
41136 if (objIsXray) {
41137 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41138 // we know Xrays have no dynamic unwrap behavior.
41139 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41140 if (!unwrappedObj.ref()) {
41141 return false;
41142 }
41143 }
41144 Maybe<AutoCEReaction> ceReaction;
41145 DocGroup* docGroup = self->GetDocGroup();
41146 if (docGroup) {
41147 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41148 }
41149 FastErrorResult rv;
41150 // NOTE: This assert does NOT call the function.
41151 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");
41152 MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"
)), 0))
) {
41154 return false;
41155 }
41156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41156); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41157 args.rval().setUndefined();
41158 return true;
41159 break;
41160 }
41161 case 1: {
41162 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41163 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41164 if (objIsXray) {
41165 unwrappedObj.emplace(cx, obj);
41166 }
41167 binding_detail::FakeString<char16_t> arg0;
41168 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
41169 return false;
41170 }
41171 if (objIsXray) {
41172 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41173 // we know Xrays have no dynamic unwrap behavior.
41174 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41175 if (!unwrappedObj.ref()) {
41176 return false;
41177 }
41178 }
41179 Maybe<AutoCEReaction> ceReaction;
41180 DocGroup* docGroup = self->GetDocGroup();
41181 if (docGroup) {
41182 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41183 }
41184 FastErrorResult rv;
41185 // NOTE: This assert does NOT call the function.
41186 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");
41187 MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41188 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"
)), 0))
) {
41189 return false;
41190 }
41191 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41191); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41191); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41192 args.rval().setUndefined();
41193 return true;
41194 break;
41195 }
41196 default: {
41197 // Using nsPrintfCString here would require including that
41198 // header. Let's not worry about it.
41199 nsAutoCString argCountStr;
41200 argCountStr.AppendPrintf("%u", args.length());
41201 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
41202 }
41203 }
41204 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 41204); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { MOZ_CrashSequence(__null, 41204); __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
41205 return false;
41206}
41207
41208static const JSJitInfo ceReactionsMethodOverload_methodinfo = {
41209 { (JSJitGetterOp)ceReactionsMethodOverload },
41210 { prototypes::id::TestJSImplInterface },
41211 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41212 JSJitInfo::Method,
41213 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41214 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41215 false, /* isInfallible. False in setters. */
41216 false, /* isMovable. Not relevant for setters. */
41217 false, /* isEliminatable. Not relevant for setters. */
41218 false, /* isAlwaysInSlot. Only relevant for getters. */
41219 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41220 false, /* isTypedMethod. Only relevant for methods. */
41221 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41222};
41223
41224MOZ_CAN_RUN_SCRIPT static bool
41225get_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41226{
41227 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41230( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41228 "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41230( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41229 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41230( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41230 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41230( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41231
41232 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41233 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41234 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41235 if (objIsXray) {
41236 unwrappedObj.emplace(cx, obj);
41237 }
41238 if (objIsXray) {
41239 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41240 // we know Xrays have no dynamic unwrap behavior.
41241 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41242 if (!unwrappedObj.ref()) {
41243 return false;
41244 }
41245 }
41246 FastErrorResult rv;
41247 bool result(MOZ_KnownLive(self)(self)->GetCeReactionsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41248 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter"
)), 0))
) {
41249 return false;
41250 }
41251 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41251); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41251); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41252 args.rval().setBoolean(result);
41253 return true;
41254}
41255
41256MOZ_CAN_RUN_SCRIPT static bool
41257set_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41258{
41259 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41262( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41260 "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41262( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41261 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41262( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41262 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41262( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41263
41264 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41265 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41266 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41267 if (objIsXray) {
41268 unwrappedObj.emplace(cx, obj);
41269 }
41270 bool arg0;
41271 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41272 return false;
41273 }
41274 if (objIsXray) {
41275 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41276 // we know Xrays have no dynamic unwrap behavior.
41277 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41278 if (!unwrappedObj.ref()) {
41279 return false;
41280 }
41281 }
41282 Maybe<AutoCEReaction> ceReaction;
41283 DocGroup* docGroup = self->GetDocGroup();
41284 if (docGroup) {
41285 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41286 }
41287 FastErrorResult rv;
41288 // NOTE: This assert does NOT call the function.
41289 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");
41290 MOZ_KnownLive(self)(self)->SetCeReactionsAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41291 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter"
)), 0))
) {
41292 return false;
41293 }
41294 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41294); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41294); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41295
41296 return true;
41297}
41298
41299static const JSJitInfo ceReactionsAttr_getterinfo = {
41300 { get_ceReactionsAttr },
41301 { prototypes::id::TestJSImplInterface },
41302 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41303 JSJitInfo::Getter,
41304 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41305 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
41306 false, /* isInfallible. False in setters. */
41307 false, /* isMovable. Not relevant for setters. */
41308 false, /* isEliminatable. Not relevant for setters. */
41309 false, /* isAlwaysInSlot. Only relevant for getters. */
41310 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41311 false, /* isTypedMethod. Only relevant for methods. */
41312 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41313};
41314static const JSJitInfo ceReactionsAttr_setterinfo = {
41315 { (JSJitGetterOp)set_ceReactionsAttr },
41316 { prototypes::id::TestJSImplInterface },
41317 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41318 JSJitInfo::Setter,
41319 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41320 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41321 false, /* isInfallible. False in setters. */
41322 false, /* isMovable. Not relevant for setters. */
41323 false, /* isEliminatable. Not relevant for setters. */
41324 false, /* isAlwaysInSlot. Only relevant for getters. */
41325 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41326 false, /* isTypedMethod. Only relevant for methods. */
41327 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41328};
41329
41330MOZ_CAN_RUN_SCRIPT static bool
41331passArgsWithDefaults(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41332{
41333 BindingCallContext cx(cx_, "TestJSImplInterface.passArgsWithDefaults");
41334 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41337( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41335 "TestJSImplInterface", "passArgsWithDefaults", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41337( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41336 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41337( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41337 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41337( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41338
41339 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41340 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41341 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41342 if (objIsXray) {
41343 unwrappedObj.emplace(cx, obj);
41344 }
41345 Optional<int32_t> arg0;
41346 if (args.hasDefined(0)) {
41347 arg0.Construct();
41348 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
41349 return false;
41350 }
41351 }
41352 mozilla::dom::TestInterface* arg1;
41353 if (args.hasDefined(1)) {
41354 if (args[1].isObject()) {
41355 {
41356 // Our JSContext should be in the right global to do unwrapping in.
41357 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[1], arg1, cx);
41358 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
41359 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestInterface");
41360 return false;
41361 }
41362 }
41363 } else if (args[1].isNullOrUndefined()) {
41364 arg1 = nullptr;
41365 } else {
41366 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
41367 return false;
41368 }
41369 } else {
41370 arg1 = nullptr;
41371 }
41372 RootedDictionary<binding_detail::FastDict> arg2(cx);
41373 if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", true)) {
41374 return false;
41375 }
41376 double arg3;
41377 if (args.hasDefined(3)) {
41378 if (!ValueToPrimitive<double, eDefault>(cx, args[3], "Argument 4", &arg3)) {
41379 return false;
41380 } else if (!std::isfinite(arg3)) {
41381 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 4");
41382 return false;
41383 }
41384 } else {
41385 arg3 = 5.0;
41386 }
41387 Optional<float> arg4;
41388 if (args.hasDefined(4)) {
41389 arg4.Construct();
41390 if (!ValueToPrimitive<float, eDefault>(cx, args[4], "Argument 5", &arg4.Value())) {
41391 return false;
41392 } else if (!std::isfinite(arg4.Value())) {
41393 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5");
41394 return false;
41395 }
41396 }
41397 if (objIsXray) {
41398 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41399 // we know Xrays have no dynamic unwrap behavior.
41400 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41401 if (!unwrappedObj.ref()) {
41402 return false;
41403 }
41404 }
41405 FastErrorResult rv;
41406 // NOTE: This assert does NOT call the function.
41407 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");
41408 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)));
41409 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults"
)), 0))
) {
41410 return false;
41411 }
41412 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41412); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41412); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41413 args.rval().setUndefined();
41414 return true;
41415}
41416
41417static const JSJitInfo passArgsWithDefaults_methodinfo = {
41418 { (JSJitGetterOp)passArgsWithDefaults },
41419 { prototypes::id::TestJSImplInterface },
41420 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41421 JSJitInfo::Method,
41422 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41423 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41424 false, /* isInfallible. False in setters. */
41425 false, /* isMovable. Not relevant for setters. */
41426 false, /* isEliminatable. Not relevant for setters. */
41427 false, /* isAlwaysInSlot. Only relevant for getters. */
41428 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41429 false, /* isTypedMethod. Only relevant for methods. */
41430 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41431};
41432
41433MOZ_CAN_RUN_SCRIPT static bool
41434get_toJSONShouldSkipThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41435{
41436 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41439( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41437 "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41439( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41438 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41439( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41439 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41439( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41440
41441 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41442 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41443 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41444 if (objIsXray) {
41445 unwrappedObj.emplace(cx, obj);
41446 }
41447 if (objIsXray) {
41448 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41449 // we know Xrays have no dynamic unwrap behavior.
41450 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41451 if (!unwrappedObj.ref()) {
41452 return false;
41453 }
41454 }
41455 FastErrorResult rv;
41456 JS::Rooted<JS::Value> result(cx);
41457 // NOTE: This assert does NOT call the function.
41458 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");
41459 MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41460 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter"
)), 0))
) {
41461 return false;
41462 }
41463 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41463); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41463); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41464 JS::ExposeValueToActiveJS(result);
41465 args.rval().set(result);
41466 if (!MaybeWrapValue(cx, args.rval())) {
41467 return false;
41468 }
41469 return true;
41470}
41471
41472MOZ_CAN_RUN_SCRIPT static bool
41473set_toJSONShouldSkipThis(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41474{
41475 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis setter");
41476 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41479( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41477 "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41479( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41478 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41479( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41479 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41479( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41480
41481 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41482 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41483 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41484 if (objIsXray) {
41485 unwrappedObj.emplace(cx, obj);
41486 }
41487 JS::Rooted<JS::Value> arg0(cx);
41488#ifdef __clang__1
41489#pragma clang diagnostic push
41490#pragma clang diagnostic ignored "-Wunreachable-code"
41491#pragma clang diagnostic ignored "-Wunreachable-code-return"
41492#endif // __clang__
41493 if ((true) && !CallerSubsumes(args[0])) {
41494 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value being assigned");
41495 return false;
41496 }
41497#ifdef __clang__1
41498#pragma clang diagnostic pop
41499#endif // __clang__
41500 arg0 = args[0];
41501 if (objIsXray) {
41502 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41503 // we know Xrays have no dynamic unwrap behavior.
41504 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41505 if (!unwrappedObj.ref()) {
41506 return false;
41507 }
41508 }
41509 FastErrorResult rv;
41510 // NOTE: This assert does NOT call the function.
41511 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");
41512 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41513 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter"
)), 0))
) {
41514 return false;
41515 }
41516 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41516); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41516); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41517
41518 return true;
41519}
41520
41521static const JSJitInfo toJSONShouldSkipThis_getterinfo = {
41522 { get_toJSONShouldSkipThis },
41523 { prototypes::id::TestJSImplInterface },
41524 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41525 JSJitInfo::Getter,
41526 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41527 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
41528 false, /* isInfallible. False in setters. */
41529 false, /* isMovable. Not relevant for setters. */
41530 false, /* isEliminatable. Not relevant for setters. */
41531 false, /* isAlwaysInSlot. Only relevant for getters. */
41532 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41533 false, /* isTypedMethod. Only relevant for methods. */
41534 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41535};
41536static const JSJitInfo toJSONShouldSkipThis_setterinfo = {
41537 { (JSJitGetterOp)set_toJSONShouldSkipThis },
41538 { prototypes::id::TestJSImplInterface },
41539 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41540 JSJitInfo::Setter,
41541 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41542 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41543 false, /* isInfallible. False in setters. */
41544 false, /* isMovable. Not relevant for setters. */
41545 false, /* isEliminatable. Not relevant for setters. */
41546 false, /* isAlwaysInSlot. Only relevant for getters. */
41547 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41548 false, /* isTypedMethod. Only relevant for methods. */
41549 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41550};
41551
41552MOZ_CAN_RUN_SCRIPT static bool
41553get_toJSONShouldSkipThis2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41554{
41555 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41558( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41556 "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41558( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41557 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41558( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41558 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41558( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41559
41560 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41561 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41562 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41563 if (objIsXray) {
41564 unwrappedObj.emplace(cx, obj);
41565 }
41566 if (objIsXray) {
41567 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41568 // we know Xrays have no dynamic unwrap behavior.
41569 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41570 if (!unwrappedObj.ref()) {
41571 return false;
41572 }
41573 }
41574 FastErrorResult rv;
41575 auto result(StrongOrRawPtr<mozilla::dom::TestParentInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
41576 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter"
)), 0))
) {
41577 return false;
41578 }
41579 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41579); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41579); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41580 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
41581 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41581); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41581); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41582 return false;
41583 }
41584 return true;
41585}
41586
41587MOZ_CAN_RUN_SCRIPT static bool
41588set_toJSONShouldSkipThis2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41589{
41590 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis2 setter");
41591 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41594( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41592 "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41594( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41593 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41594( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41594 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41594( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41595
41596 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41597 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41598 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41599 if (objIsXray) {
41600 unwrappedObj.emplace(cx, obj);
41601 }
41602 NonNull<mozilla::dom::TestParentInterface> arg0;
41603 if (args[0].isObject()) {
41604 {
41605 // Our JSContext should be in the right global to do unwrapping in.
41606 nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(args[0], arg0, cx);
41607 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
41608 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestParentInterface");
41609 return false;
41610 }
41611 }
41612 } else {
41613 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
41614 return false;
41615 }
41616 if (objIsXray) {
41617 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41618 // we know Xrays have no dynamic unwrap behavior.
41619 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41620 if (!unwrappedObj.ref()) {
41621 return false;
41622 }
41623 }
41624 FastErrorResult rv;
41625 // NOTE: This assert does NOT call the function.
41626 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");
41627 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41628 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter"
)), 0))
) {
41629 return false;
41630 }
41631 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41631); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41631); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41632
41633 return true;
41634}
41635
41636static const JSJitInfo toJSONShouldSkipThis2_getterinfo = {
41637 { get_toJSONShouldSkipThis2 },
41638 { prototypes::id::TestJSImplInterface },
41639 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41640 JSJitInfo::Getter,
41641 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41642 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
41643 false, /* isInfallible. False in setters. */
41644 false, /* isMovable. Not relevant for setters. */
41645 false, /* isEliminatable. Not relevant for setters. */
41646 false, /* isAlwaysInSlot. Only relevant for getters. */
41647 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41648 false, /* isTypedMethod. Only relevant for methods. */
41649 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41650};
41651static const JSJitInfo toJSONShouldSkipThis2_setterinfo = {
41652 { (JSJitGetterOp)set_toJSONShouldSkipThis2 },
41653 { prototypes::id::TestJSImplInterface },
41654 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41655 JSJitInfo::Setter,
41656 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41657 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41658 false, /* isInfallible. False in setters. */
41659 false, /* isMovable. Not relevant for setters. */
41660 false, /* isEliminatable. Not relevant for setters. */
41661 false, /* isAlwaysInSlot. Only relevant for getters. */
41662 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41663 false, /* isTypedMethod. Only relevant for methods. */
41664 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41665};
41666
41667MOZ_CAN_RUN_SCRIPT static bool
41668get_toJSONShouldSkipThis3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41669{
41670 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41673( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41671 "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41673( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41672 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41673( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41673 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41673( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41674
41675 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41676 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41677 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41678 if (objIsXray) {
41679 unwrappedObj.emplace(cx, obj);
41680 }
41681 if (objIsXray) {
41682 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41683 // we know Xrays have no dynamic unwrap behavior.
41684 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41685 if (!unwrappedObj.ref()) {
41686 return false;
41687 }
41688 }
41689 FastErrorResult rv;
41690 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
41691 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter"
)), 0))
) {
41692 return false;
41693 }
41694 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41694); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41695 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
41696 if (!MaybeWrapObjectValue(cx, args.rval())) {
41697 return false;
41698 }
41699 return true;
41700}
41701
41702MOZ_CAN_RUN_SCRIPT static bool
41703set_toJSONShouldSkipThis3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41704{
41705 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis3 setter");
41706 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41709( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41707 "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41709( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41708 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41709( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41709 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41709( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41710
41711 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41712 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41713 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41714 if (objIsXray) {
41715 unwrappedObj.emplace(cx, obj);
41716 }
41717 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
41718 if (args[0].isObject()) {
41719 { // scope for tempRoot and tempGlobalRoot if needed
41720 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
41721 }
41722 } else {
41723 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
41724 return false;
41725 }
41726 if (objIsXray) {
41727 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41728 // we know Xrays have no dynamic unwrap behavior.
41729 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41730 if (!unwrappedObj.ref()) {
41731 return false;
41732 }
41733 }
41734 FastErrorResult rv;
41735 // NOTE: This assert does NOT call the function.
41736 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");
41737 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41738 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter"
)), 0))
) {
41739 return false;
41740 }
41741 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41741); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41741); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41742
41743 return true;
41744}
41745
41746static const JSJitInfo toJSONShouldSkipThis3_getterinfo = {
41747 { get_toJSONShouldSkipThis3 },
41748 { prototypes::id::TestJSImplInterface },
41749 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41750 JSJitInfo::Getter,
41751 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41752 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
41753 false, /* isInfallible. False in setters. */
41754 false, /* isMovable. Not relevant for setters. */
41755 false, /* isEliminatable. Not relevant for setters. */
41756 false, /* isAlwaysInSlot. Only relevant for getters. */
41757 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41758 false, /* isTypedMethod. Only relevant for methods. */
41759 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41760};
41761static const JSJitInfo toJSONShouldSkipThis3_setterinfo = {
41762 { (JSJitGetterOp)set_toJSONShouldSkipThis3 },
41763 { prototypes::id::TestJSImplInterface },
41764 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41765 JSJitInfo::Setter,
41766 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41767 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41768 false, /* isInfallible. False in setters. */
41769 false, /* isMovable. Not relevant for setters. */
41770 false, /* isEliminatable. Not relevant for setters. */
41771 false, /* isAlwaysInSlot. Only relevant for getters. */
41772 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41773 false, /* isTypedMethod. Only relevant for methods. */
41774 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41775};
41776
41777MOZ_CAN_RUN_SCRIPT static bool
41778get_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41779{
41780 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41783( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41781 "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41783( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41782 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41783( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41783 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41783( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41784
41785 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41786 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41787 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41788 if (objIsXray) {
41789 unwrappedObj.emplace(cx, obj);
41790 }
41791 if (objIsXray) {
41792 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41793 // we know Xrays have no dynamic unwrap behavior.
41794 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41795 if (!unwrappedObj.ref()) {
41796 return false;
41797 }
41798 }
41799 FastErrorResult rv;
41800 int8_t result(MOZ_KnownLive(self)(self)->GetDashed_attribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41801 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter"
)), 0))
) {
41802 return false;
41803 }
41804 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41804); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41804); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41805 args.rval().setInt32(int32_t(result));
41806 return true;
41807}
41808
41809MOZ_CAN_RUN_SCRIPT static bool
41810set_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41811{
41812 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41815( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41813 "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41815( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41814 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41815( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41815 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41815( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41816
41817 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41818 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41819 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41820 if (objIsXray) {
41821 unwrappedObj.emplace(cx, obj);
41822 }
41823 int8_t arg0;
41824 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41825 return false;
41826 }
41827 if (objIsXray) {
41828 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41829 // we know Xrays have no dynamic unwrap behavior.
41830 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41831 if (!unwrappedObj.ref()) {
41832 return false;
41833 }
41834 }
41835 FastErrorResult rv;
41836 // NOTE: This assert does NOT call the function.
41837 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");
41838 MOZ_KnownLive(self)(self)->SetDashed_attribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41839 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter"
)), 0))
) {
41840 return false;
41841 }
41842 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41842); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41842); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41843
41844 return true;
41845}
41846
41847static const JSJitInfo dashed_attribute_getterinfo = {
41848 { get_dashed_attribute },
41849 { prototypes::id::TestJSImplInterface },
41850 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41851 JSJitInfo::Getter,
41852 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41853 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
41854 false, /* isInfallible. False in setters. */
41855 false, /* isMovable. Not relevant for setters. */
41856 false, /* isEliminatable. Not relevant for setters. */
41857 false, /* isAlwaysInSlot. Only relevant for getters. */
41858 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41859 false, /* isTypedMethod. Only relevant for methods. */
41860 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41861};
41862static const JSJitInfo dashed_attribute_setterinfo = {
41863 { (JSJitGetterOp)set_dashed_attribute },
41864 { prototypes::id::TestJSImplInterface },
41865 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41866 JSJitInfo::Setter,
41867 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41868 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41869 false, /* isInfallible. False in setters. */
41870 false, /* isMovable. Not relevant for setters. */
41871 false, /* isEliminatable. Not relevant for setters. */
41872 false, /* isAlwaysInSlot. Only relevant for getters. */
41873 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41874 false, /* isTypedMethod. Only relevant for methods. */
41875 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41876};
41877
41878MOZ_CAN_RUN_SCRIPT static bool
41879dashed_method(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41880{
41881 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41884( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41882 "TestJSImplInterface", "dashed-method", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41884( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41883 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41884( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41884 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41884( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41885
41886 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41887 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41888 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41889 if (objIsXray) {
41890 unwrappedObj.emplace(cx, obj);
41891 }
41892 if (objIsXray) {
41893 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41894 // we know Xrays have no dynamic unwrap behavior.
41895 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41896 if (!unwrappedObj.ref()) {
41897 return false;
41898 }
41899 }
41900 FastErrorResult rv;
41901 // NOTE: This assert does NOT call the function.
41902 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");
41903 MOZ_KnownLive(self)(self)->Dashed_method(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41904 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method"
)), 0))
) {
41905 return false;
41906 }
41907 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41907); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41907); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41908 args.rval().setUndefined();
41909 return true;
41910}
41911
41912static const JSJitInfo dashed_method_methodinfo = {
41913 { (JSJitGetterOp)dashed_method },
41914 { prototypes::id::TestJSImplInterface },
41915 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41916 JSJitInfo::Method,
41917 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41918 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41919 false, /* isInfallible. False in setters. */
41920 false, /* isMovable. Not relevant for setters. */
41921 false, /* isEliminatable. Not relevant for setters. */
41922 false, /* isAlwaysInSlot. Only relevant for getters. */
41923 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41924 false, /* isTypedMethod. Only relevant for methods. */
41925 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41926};
41927
41928MOZ_CAN_RUN_SCRIPT static bool
41929get_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41930{
41931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41934( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41932 "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41934( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41934( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41934( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41935
41936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41939 if (objIsXray) {
41940 unwrappedObj.emplace(cx, obj);
41941 }
41942 if (objIsXray) {
41943 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41944 // we know Xrays have no dynamic unwrap behavior.
41945 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41946 if (!unwrappedObj.ref()) {
41947 return false;
41948 }
41949 }
41950 FastErrorResult rv;
41951 bool result(MOZ_KnownLive(self)(self)->GetNonEnumerableAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41952 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter"
)), 0))
) {
41953 return false;
41954 }
41955 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41955); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41955); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41956 args.rval().setBoolean(result);
41957 return true;
41958}
41959
41960MOZ_CAN_RUN_SCRIPT static bool
41961set_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41962{
41963 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41966( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41964 "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41966( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41965 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41966( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41966 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41966( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41967
41968 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41969 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41970 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41971 if (objIsXray) {
41972 unwrappedObj.emplace(cx, obj);
41973 }
41974 bool arg0;
41975 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41976 return false;
41977 }
41978 if (objIsXray) {
41979 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41980 // we know Xrays have no dynamic unwrap behavior.
41981 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41982 if (!unwrappedObj.ref()) {
41983 return false;
41984 }
41985 }
41986 FastErrorResult rv;
41987 // NOTE: This assert does NOT call the function.
41988 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");
41989 MOZ_KnownLive(self)(self)->SetNonEnumerableAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41990 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter"
)), 0))
) {
41991 return false;
41992 }
41993 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41993); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 41993); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
41994
41995 return true;
41996}
41997
41998static const JSJitInfo nonEnumerableAttr_getterinfo = {
41999 { get_nonEnumerableAttr },
42000 { prototypes::id::TestJSImplInterface },
42001 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42002 JSJitInfo::Getter,
42003 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42004 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
42005 false, /* isInfallible. False in setters. */
42006 false, /* isMovable. Not relevant for setters. */
42007 false, /* isEliminatable. Not relevant for setters. */
42008 false, /* isAlwaysInSlot. Only relevant for getters. */
42009 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42010 false, /* isTypedMethod. Only relevant for methods. */
42011 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42012};
42013static const JSJitInfo nonEnumerableAttr_setterinfo = {
42014 { (JSJitGetterOp)set_nonEnumerableAttr },
42015 { prototypes::id::TestJSImplInterface },
42016 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42017 JSJitInfo::Setter,
42018 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42019 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42020 false, /* isInfallible. False in setters. */
42021 false, /* isMovable. Not relevant for setters. */
42022 false, /* isEliminatable. Not relevant for setters. */
42023 false, /* isAlwaysInSlot. Only relevant for getters. */
42024 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42025 false, /* isTypedMethod. Only relevant for methods. */
42026 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42027};
42028
42029MOZ_CAN_RUN_SCRIPT static bool
42030nonEnumerableMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42031{
42032 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42035( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42033 "TestJSImplInterface", "nonEnumerableMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42035( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42034 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42035( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42035 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42035( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42036
42037 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42038 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42039 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42040 if (objIsXray) {
42041 unwrappedObj.emplace(cx, obj);
42042 }
42043 if (objIsXray) {
42044 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42045 // we know Xrays have no dynamic unwrap behavior.
42046 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42047 if (!unwrappedObj.ref()) {
42048 return false;
42049 }
42050 }
42051 FastErrorResult rv;
42052 // NOTE: This assert does NOT call the function.
42053 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");
42054 MOZ_KnownLive(self)(self)->NonEnumerableMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42055 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod"
)), 0))
) {
42056 return false;
42057 }
42058 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42058); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42058); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42059 args.rval().setUndefined();
42060 return true;
42061}
42062
42063static const JSJitInfo nonEnumerableMethod_methodinfo = {
42064 { (JSJitGetterOp)nonEnumerableMethod },
42065 { prototypes::id::TestJSImplInterface },
42066 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42067 JSJitInfo::Method,
42068 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42069 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42070 false, /* isInfallible. False in setters. */
42071 false, /* isMovable. Not relevant for setters. */
42072 false, /* isEliminatable. Not relevant for setters. */
42073 false, /* isAlwaysInSlot. Only relevant for getters. */
42074 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42075 false, /* isTypedMethod. Only relevant for methods. */
42076 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42077};
42078
42079MOZ_CAN_RUN_SCRIPT static bool
42080get_allowSharedArrayBufferViewTypedef(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42081{
42082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42085( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42083 "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42085( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42085( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42085( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42086
42087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42088 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42089 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42090 if (objIsXray) {
42091 unwrappedObj.emplace(cx, obj);
42092 }
42093 if (objIsXray) {
42094 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42095 // we know Xrays have no dynamic unwrap behavior.
42096 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42097 if (!unwrappedObj.ref()) {
42098 return false;
42099 }
42100 }
42101 FastErrorResult rv;
42102 JS::Rooted<JSObject*> result(cx);
42103 // NOTE: This assert does NOT call the function.
42104 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");
42105 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferViewTypedef(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42106 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter"
)), 0))
) {
42107 return false;
42108 }
42109 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42109); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42109); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42110 JS::ExposeObjectToActiveJS(result);
42111 args.rval().setObject(*result);
42112 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42113 return false;
42114 }
42115 return true;
42116}
42117
42118MOZ_CAN_RUN_SCRIPT static bool
42119set_allowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42120{
42121 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter");
42122 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42125( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42123 "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42125( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42124 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42125( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42125 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42125( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42126
42127 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42128 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42129 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42130 if (objIsXray) {
42131 unwrappedObj.emplace(cx, obj);
42132 }
42133 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42134 if (args[0].isObject()) {
42135 if (!arg0.Init(&args[0].toObject())) {
42136 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView");
42137 return false;
42138 }
42139 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42140 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42141 return false;
42142 }
42143 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42144 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42145 return false;
42146 }
42147 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
42148 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
42149 return false;
42150 }
42151 } else {
42152 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42153 return false;
42154 }
42155 if (objIsXray) {
42156 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42157 // we know Xrays have no dynamic unwrap behavior.
42158 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42159 if (!unwrappedObj.ref()) {
42160 return false;
42161 }
42162 }
42163 FastErrorResult rv;
42164 // NOTE: This assert does NOT call the function.
42165 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");
42166 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42167 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"
)), 0))
) {
42168 return false;
42169 }
42170 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42170); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42170); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42171
42172 return true;
42173}
42174
42175static const JSJitInfo allowSharedArrayBufferViewTypedef_getterinfo = {
42176 { get_allowSharedArrayBufferViewTypedef },
42177 { prototypes::id::TestJSImplInterface },
42178 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42179 JSJitInfo::Getter,
42180 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42181 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42182 false, /* isInfallible. False in setters. */
42183 false, /* isMovable. Not relevant for setters. */
42184 false, /* isEliminatable. Not relevant for setters. */
42185 false, /* isAlwaysInSlot. Only relevant for getters. */
42186 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42187 false, /* isTypedMethod. Only relevant for methods. */
42188 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42189};
42190static const JSJitInfo allowSharedArrayBufferViewTypedef_setterinfo = {
42191 { (JSJitGetterOp)set_allowSharedArrayBufferViewTypedef },
42192 { prototypes::id::TestJSImplInterface },
42193 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42194 JSJitInfo::Setter,
42195 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42196 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42197 false, /* isInfallible. False in setters. */
42198 false, /* isMovable. Not relevant for setters. */
42199 false, /* isEliminatable. Not relevant for setters. */
42200 false, /* isAlwaysInSlot. Only relevant for getters. */
42201 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42202 false, /* isTypedMethod. Only relevant for methods. */
42203 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42204};
42205
42206MOZ_CAN_RUN_SCRIPT static bool
42207get_allowSharedArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42208{
42209 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42212( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42210 "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42212( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42211 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42212( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42212 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42212( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42213
42214 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42215 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42216 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42217 if (objIsXray) {
42218 unwrappedObj.emplace(cx, obj);
42219 }
42220 if (objIsXray) {
42221 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42222 // we know Xrays have no dynamic unwrap behavior.
42223 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42224 if (!unwrappedObj.ref()) {
42225 return false;
42226 }
42227 }
42228 FastErrorResult rv;
42229 JS::Rooted<JSObject*> result(cx);
42230 // NOTE: This assert does NOT call the function.
42231 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");
42232 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42233 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter"
)), 0))
) {
42234 return false;
42235 }
42236 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42236); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42236); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42237 JS::ExposeObjectToActiveJS(result);
42238 args.rval().setObject(*result);
42239 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42240 return false;
42241 }
42242 return true;
42243}
42244
42245MOZ_CAN_RUN_SCRIPT static bool
42246set_allowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42247{
42248 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferView setter");
42249 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42252( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42250 "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42252( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42251 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42252( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42252 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42252( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42253
42254 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42255 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42256 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42257 if (objIsXray) {
42258 unwrappedObj.emplace(cx, obj);
42259 }
42260 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42261 if (args[0].isObject()) {
42262 if (!arg0.Init(&args[0].toObject())) {
42263 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView");
42264 return false;
42265 }
42266 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42267 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42268 return false;
42269 }
42270 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42271 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42272 return false;
42273 }
42274 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
42275 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
42276 return false;
42277 }
42278 } else {
42279 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42280 return false;
42281 }
42282 if (objIsXray) {
42283 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42284 // we know Xrays have no dynamic unwrap behavior.
42285 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42286 if (!unwrappedObj.ref()) {
42287 return false;
42288 }
42289 }
42290 FastErrorResult rv;
42291 // NOTE: This assert does NOT call the function.
42292 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");
42293 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42294 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter"
)), 0))
) {
42295 return false;
42296 }
42297 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42297); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42297); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42298
42299 return true;
42300}
42301
42302static const JSJitInfo allowSharedArrayBufferView_getterinfo = {
42303 { get_allowSharedArrayBufferView },
42304 { prototypes::id::TestJSImplInterface },
42305 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42306 JSJitInfo::Getter,
42307 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42308 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42309 false, /* isInfallible. False in setters. */
42310 false, /* isMovable. Not relevant for setters. */
42311 false, /* isEliminatable. Not relevant for setters. */
42312 false, /* isAlwaysInSlot. Only relevant for getters. */
42313 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42314 false, /* isTypedMethod. Only relevant for methods. */
42315 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42316};
42317static const JSJitInfo allowSharedArrayBufferView_setterinfo = {
42318 { (JSJitGetterOp)set_allowSharedArrayBufferView },
42319 { prototypes::id::TestJSImplInterface },
42320 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42321 JSJitInfo::Setter,
42322 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42323 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42324 false, /* isInfallible. False in setters. */
42325 false, /* isMovable. Not relevant for setters. */
42326 false, /* isEliminatable. Not relevant for setters. */
42327 false, /* isAlwaysInSlot. Only relevant for getters. */
42328 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42329 false, /* isTypedMethod. Only relevant for methods. */
42330 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42331};
42332
42333MOZ_CAN_RUN_SCRIPT static bool
42334get_allowSharedNullableArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42335{
42336 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42339( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42337 "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42339( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42338 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42339( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42339 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42339( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42340
42341 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42342 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42343 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42344 if (objIsXray) {
42345 unwrappedObj.emplace(cx, obj);
42346 }
42347 if (objIsXray) {
42348 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42349 // we know Xrays have no dynamic unwrap behavior.
42350 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42351 if (!unwrappedObj.ref()) {
42352 return false;
42353 }
42354 }
42355 FastErrorResult rv;
42356 JS::Rooted<JSObject*> result(cx);
42357 // NOTE: This assert does NOT call the function.
42358 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");
42359 MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42360 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter"
)), 0))
) {
42361 return false;
42362 }
42363 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42363); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42363); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42364 if (result) {
42365 JS::ExposeObjectToActiveJS(result);
42366 }
42367 args.rval().setObjectOrNull(result);
42368 if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) {
42369 return false;
42370 }
42371 return true;
42372}
42373
42374MOZ_CAN_RUN_SCRIPT static bool
42375set_allowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42376{
42377 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBufferView setter");
42378 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42381( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42379 "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42381( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42380 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42381( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42381 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42381( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42382
42383 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42384 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42385 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42386 if (objIsXray) {
42387 unwrappedObj.emplace(cx, obj);
42388 }
42389 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx);
42390 if (args[0].isObject()) {
42391 if (!arg0.SetValue().Init(&args[0].toObject())) {
42392 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferViewOrNull");
42393 return false;
42394 }
42395 if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) {
42396 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42397 return false;
42398 }
42399 if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) {
42400 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42401 return false;
42402 }
42403 if (JS::IsImmutableArrayBufferView(arg0.SetValue().Obj())) {
42404 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
42405 return false;
42406 }
42407 } else if (args[0].isNullOrUndefined()) {
42408 arg0.SetNull();
42409 } else {
42410 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42411 return false;
42412 }
42413 if (objIsXray) {
42414 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42415 // we know Xrays have no dynamic unwrap behavior.
42416 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42417 if (!unwrappedObj.ref()) {
42418 return false;
42419 }
42420 }
42421 FastErrorResult rv;
42422 // NOTE: This assert does NOT call the function.
42423 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");
42424 MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42425 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"
)), 0))
) {
42426 return false;
42427 }
42428 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42428); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42428); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42429
42430 return true;
42431}
42432
42433static const JSJitInfo allowSharedNullableArrayBufferView_getterinfo = {
42434 { get_allowSharedNullableArrayBufferView },
42435 { prototypes::id::TestJSImplInterface },
42436 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42437 JSJitInfo::Getter,
42438 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42439 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
42440 false, /* isInfallible. False in setters. */
42441 false, /* isMovable. Not relevant for setters. */
42442 false, /* isEliminatable. Not relevant for setters. */
42443 false, /* isAlwaysInSlot. Only relevant for getters. */
42444 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42445 false, /* isTypedMethod. Only relevant for methods. */
42446 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42447};
42448static const JSJitInfo allowSharedNullableArrayBufferView_setterinfo = {
42449 { (JSJitGetterOp)set_allowSharedNullableArrayBufferView },
42450 { prototypes::id::TestJSImplInterface },
42451 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42452 JSJitInfo::Setter,
42453 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42454 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42455 false, /* isInfallible. False in setters. */
42456 false, /* isMovable. Not relevant for setters. */
42457 false, /* isEliminatable. Not relevant for setters. */
42458 false, /* isAlwaysInSlot. Only relevant for getters. */
42459 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42460 false, /* isTypedMethod. Only relevant for methods. */
42461 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42462};
42463
42464MOZ_CAN_RUN_SCRIPT static bool
42465get_allowSharedArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42466{
42467 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42470( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42468 "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42470( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42469 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42470( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42470 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42470( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42471
42472 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42473 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42474 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42475 if (objIsXray) {
42476 unwrappedObj.emplace(cx, obj);
42477 }
42478 if (objIsXray) {
42479 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42480 // we know Xrays have no dynamic unwrap behavior.
42481 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42482 if (!unwrappedObj.ref()) {
42483 return false;
42484 }
42485 }
42486 FastErrorResult rv;
42487 JS::Rooted<JSObject*> result(cx);
42488 // NOTE: This assert does NOT call the function.
42489 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");
42490 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42491 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter"
)), 0))
) {
42492 return false;
42493 }
42494 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42494); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42494); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42495 JS::ExposeObjectToActiveJS(result);
42496 args.rval().setObject(*result);
42497 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42498 return false;
42499 }
42500 return true;
42501}
42502
42503MOZ_CAN_RUN_SCRIPT static bool
42504set_allowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42505{
42506 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBuffer setter");
42507 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42510( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42508 "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42510( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42509 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42510( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42510 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42510( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42511
42512 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42513 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42514 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42515 if (objIsXray) {
42516 unwrappedObj.emplace(cx, obj);
42517 }
42518 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
42519 if (args[0].isObject()) {
42520 if (!arg0.Init(&args[0].toObject())) {
42521 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBuffer");
42522 return false;
42523 }
42524 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
42525 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42526 return false;
42527 }
42528 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
42529 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42530 return false;
42531 }
42532 if (JS::IsImmutableArrayBufferMaybeShared(arg0.Obj())) {
42533 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
42534 return false;
42535 }
42536 } else {
42537 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42538 return false;
42539 }
42540 if (objIsXray) {
42541 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42542 // we know Xrays have no dynamic unwrap behavior.
42543 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42544 if (!unwrappedObj.ref()) {
42545 return false;
42546 }
42547 }
42548 FastErrorResult rv;
42549 // NOTE: This assert does NOT call the function.
42550 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");
42551 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42552 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter"
)), 0))
) {
42553 return false;
42554 }
42555 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42555); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42555); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42556
42557 return true;
42558}
42559
42560static const JSJitInfo allowSharedArrayBuffer_getterinfo = {
42561 { get_allowSharedArrayBuffer },
42562 { prototypes::id::TestJSImplInterface },
42563 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42564 JSJitInfo::Getter,
42565 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42566 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42567 false, /* isInfallible. False in setters. */
42568 false, /* isMovable. Not relevant for setters. */
42569 false, /* isEliminatable. Not relevant for setters. */
42570 false, /* isAlwaysInSlot. Only relevant for getters. */
42571 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42572 false, /* isTypedMethod. Only relevant for methods. */
42573 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42574};
42575static const JSJitInfo allowSharedArrayBuffer_setterinfo = {
42576 { (JSJitGetterOp)set_allowSharedArrayBuffer },
42577 { prototypes::id::TestJSImplInterface },
42578 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42579 JSJitInfo::Setter,
42580 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42581 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42582 false, /* isInfallible. False in setters. */
42583 false, /* isMovable. Not relevant for setters. */
42584 false, /* isEliminatable. Not relevant for setters. */
42585 false, /* isAlwaysInSlot. Only relevant for getters. */
42586 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42587 false, /* isTypedMethod. Only relevant for methods. */
42588 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42589};
42590
42591MOZ_CAN_RUN_SCRIPT static bool
42592get_allowSharedNullableArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42593{
42594 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42597( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42595 "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42597( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42596 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42597( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42597 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42597( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42598
42599 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42600 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42601 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42602 if (objIsXray) {
42603 unwrappedObj.emplace(cx, obj);
42604 }
42605 if (objIsXray) {
42606 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42607 // we know Xrays have no dynamic unwrap behavior.
42608 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42609 if (!unwrappedObj.ref()) {
42610 return false;
42611 }
42612 }
42613 FastErrorResult rv;
42614 JS::Rooted<JSObject*> result(cx);
42615 // NOTE: This assert does NOT call the function.
42616 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");
42617 MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42618 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter"
)), 0))
) {
42619 return false;
42620 }
42621 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42621); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42621); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42622 if (result) {
42623 JS::ExposeObjectToActiveJS(result);
42624 }
42625 args.rval().setObjectOrNull(result);
42626 if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) {
42627 return false;
42628 }
42629 return true;
42630}
42631
42632MOZ_CAN_RUN_SCRIPT static bool
42633set_allowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42634{
42635 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBuffer setter");
42636 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42639( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42637 "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42639( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42638 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42639( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42639 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42639( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42640
42641 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42642 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42643 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42644 if (objIsXray) {
42645 unwrappedObj.emplace(cx, obj);
42646 }
42647 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
42648 if (args[0].isObject()) {
42649 if (!arg0.SetValue().Init(&args[0].toObject())) {
42650 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferOrNull");
42651 return false;
42652 }
42653 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42654 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42655 return false;
42656 }
42657 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42658 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42659 return false;
42660 }
42661 if (JS::IsImmutableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42662 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Value being assigned");
42663 return false;
42664 }
42665 } else if (args[0].isNullOrUndefined()) {
42666 arg0.SetNull();
42667 } else {
42668 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42669 return false;
42670 }
42671 if (objIsXray) {
42672 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42673 // we know Xrays have no dynamic unwrap behavior.
42674 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42675 if (!unwrappedObj.ref()) {
42676 return false;
42677 }
42678 }
42679 FastErrorResult rv;
42680 // NOTE: This assert does NOT call the function.
42681 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");
42682 MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42683 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"
)), 0))
) {
42684 return false;
42685 }
42686 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42686); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42686); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42687
42688 return true;
42689}
42690
42691static const JSJitInfo allowSharedNullableArrayBuffer_getterinfo = {
42692 { get_allowSharedNullableArrayBuffer },
42693 { prototypes::id::TestJSImplInterface },
42694 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42695 JSJitInfo::Getter,
42696 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42697 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
42698 false, /* isInfallible. False in setters. */
42699 false, /* isMovable. Not relevant for setters. */
42700 false, /* isEliminatable. Not relevant for setters. */
42701 false, /* isAlwaysInSlot. Only relevant for getters. */
42702 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42703 false, /* isTypedMethod. Only relevant for methods. */
42704 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42705};
42706static const JSJitInfo allowSharedNullableArrayBuffer_setterinfo = {
42707 { (JSJitGetterOp)set_allowSharedNullableArrayBuffer },
42708 { prototypes::id::TestJSImplInterface },
42709 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42710 JSJitInfo::Setter,
42711 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42712 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42713 false, /* isInfallible. False in setters. */
42714 false, /* isMovable. Not relevant for setters. */
42715 false, /* isEliminatable. Not relevant for setters. */
42716 false, /* isAlwaysInSlot. Only relevant for getters. */
42717 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42718 false, /* isTypedMethod. Only relevant for methods. */
42719 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42720};
42721
42722MOZ_CAN_RUN_SCRIPT static bool
42723passAllowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42724{
42725 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef");
42726 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42729( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42727 "TestJSImplInterface", "passAllowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42729( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42728 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42729( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42729 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42729( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42730
42731 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42732 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", 1)) {
42733 return false;
42734 }
42735 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42736 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42737 if (objIsXray) {
42738 unwrappedObj.emplace(cx, obj);
42739 }
42740 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42741 if (args[0].isObject()) {
42742 if (!arg0.Init(&args[0].toObject())) {
42743 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
42744 return false;
42745 }
42746 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42747 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42748 return false;
42749 }
42750 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42751 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42752 return false;
42753 }
42754 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
42755 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
42756 return false;
42757 }
42758 } else {
42759 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42760 return false;
42761 }
42762 if (objIsXray) {
42763 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42764 // we know Xrays have no dynamic unwrap behavior.
42765 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42766 if (!unwrappedObj.ref()) {
42767 return false;
42768 }
42769 }
42770 FastErrorResult rv;
42771 // NOTE: This assert does NOT call the function.
42772 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");
42773 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42774 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"
)), 0))
) {
42775 return false;
42776 }
42777 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42777); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42777); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42778 args.rval().setUndefined();
42779 return true;
42780}
42781
42782static const JSJitInfo passAllowSharedArrayBufferViewTypedef_methodinfo = {
42783 { (JSJitGetterOp)passAllowSharedArrayBufferViewTypedef },
42784 { prototypes::id::TestJSImplInterface },
42785 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42786 JSJitInfo::Method,
42787 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42788 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42789 false, /* isInfallible. False in setters. */
42790 false, /* isMovable. Not relevant for setters. */
42791 false, /* isEliminatable. Not relevant for setters. */
42792 false, /* isAlwaysInSlot. Only relevant for getters. */
42793 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42794 false, /* isTypedMethod. Only relevant for methods. */
42795 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42796};
42797
42798MOZ_CAN_RUN_SCRIPT static bool
42799passAllowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42800{
42801 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferView");
42802 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42805( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42803 "TestJSImplInterface", "passAllowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42805( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42804 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42805( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42805 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42805( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42806
42807 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42808 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferView", 1)) {
42809 return false;
42810 }
42811 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42812 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42813 if (objIsXray) {
42814 unwrappedObj.emplace(cx, obj);
42815 }
42816 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42817 if (args[0].isObject()) {
42818 if (!arg0.Init(&args[0].toObject())) {
42819 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
42820 return false;
42821 }
42822 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42823 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42824 return false;
42825 }
42826 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42827 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42828 return false;
42829 }
42830 if (JS::IsImmutableArrayBufferView(arg0.Obj())) {
42831 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
42832 return false;
42833 }
42834 } else {
42835 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42836 return false;
42837 }
42838 if (objIsXray) {
42839 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42840 // we know Xrays have no dynamic unwrap behavior.
42841 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42842 if (!unwrappedObj.ref()) {
42843 return false;
42844 }
42845 }
42846 FastErrorResult rv;
42847 // NOTE: This assert does NOT call the function.
42848 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");
42849 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42850 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView"
)), 0))
) {
42851 return false;
42852 }
42853 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42853); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42853); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42854 args.rval().setUndefined();
42855 return true;
42856}
42857
42858static const JSJitInfo passAllowSharedArrayBufferView_methodinfo = {
42859 { (JSJitGetterOp)passAllowSharedArrayBufferView },
42860 { prototypes::id::TestJSImplInterface },
42861 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42862 JSJitInfo::Method,
42863 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42864 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42865 false, /* isInfallible. False in setters. */
42866 false, /* isMovable. Not relevant for setters. */
42867 false, /* isEliminatable. Not relevant for setters. */
42868 false, /* isAlwaysInSlot. Only relevant for getters. */
42869 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42870 false, /* isTypedMethod. Only relevant for methods. */
42871 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42872};
42873
42874MOZ_CAN_RUN_SCRIPT static bool
42875passAllowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42876{
42877 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBufferView");
42878 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42881( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42879 "TestJSImplInterface", "passAllowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42881( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42880 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42881( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42881 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42881( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42882
42883 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42884 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", 1)) {
42885 return false;
42886 }
42887 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42888 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42889 if (objIsXray) {
42890 unwrappedObj.emplace(cx, obj);
42891 }
42892 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx);
42893 if (args[0].isObject()) {
42894 if (!arg0.SetValue().Init(&args[0].toObject())) {
42895 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferViewOrNull");
42896 return false;
42897 }
42898 if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) {
42899 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42900 return false;
42901 }
42902 if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) {
42903 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42904 return false;
42905 }
42906 if (JS::IsImmutableArrayBufferView(arg0.SetValue().Obj())) {
42907 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
42908 return false;
42909 }
42910 } else if (args[0].isNullOrUndefined()) {
42911 arg0.SetNull();
42912 } else {
42913 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42914 return false;
42915 }
42916 if (objIsXray) {
42917 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42918 // we know Xrays have no dynamic unwrap behavior.
42919 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42920 if (!unwrappedObj.ref()) {
42921 return false;
42922 }
42923 }
42924 FastErrorResult rv;
42925 // NOTE: This assert does NOT call the function.
42926 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");
42927 MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42928 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"
)), 0))
) {
42929 return false;
42930 }
42931 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42931); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 42931); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
42932 args.rval().setUndefined();
42933 return true;
42934}
42935
42936static const JSJitInfo passAllowSharedNullableArrayBufferView_methodinfo = {
42937 { (JSJitGetterOp)passAllowSharedNullableArrayBufferView },
42938 { prototypes::id::TestJSImplInterface },
42939 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42940 JSJitInfo::Method,
42941 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42942 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42943 false, /* isInfallible. False in setters. */
42944 false, /* isMovable. Not relevant for setters. */
42945 false, /* isEliminatable. Not relevant for setters. */
42946 false, /* isAlwaysInSlot. Only relevant for getters. */
42947 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42948 false, /* isTypedMethod. Only relevant for methods. */
42949 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42950};
42951
42952MOZ_CAN_RUN_SCRIPT static bool
42953passAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42954{
42955 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBuffer");
42956 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42959( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42957 "TestJSImplInterface", "passAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42959( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42958 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42959( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42959 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42959( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42960
42961 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42962 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBuffer", 1)) {
42963 return false;
42964 }
42965 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42966 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42967 if (objIsXray) {
42968 unwrappedObj.emplace(cx, obj);
42969 }
42970 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
42971 if (args[0].isObject()) {
42972 if (!arg0.Init(&args[0].toObject())) {
42973 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
42974 return false;
42975 }
42976 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
42977 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42978 return false;
42979 }
42980 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
42981 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42982 return false;
42983 }
42984 if (JS::IsImmutableArrayBufferMaybeShared(arg0.Obj())) {
42985 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
42986 return false;
42987 }
42988 } else {
42989 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42990 return false;
42991 }
42992 if (objIsXray) {
42993 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42994 // we know Xrays have no dynamic unwrap behavior.
42995 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42996 if (!unwrappedObj.ref()) {
42997 return false;
42998 }
42999 }
43000 FastErrorResult rv;
43001 // NOTE: This assert does NOT call the function.
43002 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");
43003 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43004 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer"
)), 0))
) {
43005 return false;
43006 }
43007 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43007); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 43007); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
43008 args.rval().setUndefined();
43009 return true;
43010}
43011
43012static const JSJitInfo passAllowSharedArrayBuffer_methodinfo = {
43013 { (JSJitGetterOp)passAllowSharedArrayBuffer },
43014 { prototypes::id::TestJSImplInterface },
43015 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43016 JSJitInfo::Method,
43017 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43018 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43019 false, /* isInfallible. False in setters. */
43020 false, /* isMovable. Not relevant for setters. */
43021 false, /* isEliminatable. Not relevant for setters. */
43022 false, /* isAlwaysInSlot. Only relevant for getters. */
43023 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43024 false, /* isTypedMethod. Only relevant for methods. */
43025 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43026};
43027
43028MOZ_CAN_RUN_SCRIPT static bool
43029passAllowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43030{
43031 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBuffer");
43032 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43035( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43033 "TestJSImplInterface", "passAllowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43035( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43034 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43035( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43035 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43035( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
43036
43037 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43038 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", 1)) {
43039 return false;
43040 }
43041 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
43042 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
43043 if (objIsXray) {
43044 unwrappedObj.emplace(cx, obj);
43045 }
43046 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
43047 if (args[0].isObject()) {
43048 if (!arg0.SetValue().Init(&args[0].toObject())) {
43049 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
43050 return false;
43051 }
43052 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
43053 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
43054 return false;
43055 }
43056 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
43057 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
43058 return false;
43059 }
43060 if (JS::IsImmutableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
43061 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 1");
43062 return false;
43063 }
43064 } else if (args[0].isNullOrUndefined()) {
43065 arg0.SetNull();
43066 } else {
43067 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
43068 return false;
43069 }
43070 if (objIsXray) {
43071 // Since our object is an Xray, we can just CheckedUnwrapStatic:
43072 // we know Xrays have no dynamic unwrap behavior.
43073 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43074 if (!unwrappedObj.ref()) {
43075 return false;
43076 }
43077 }
43078 FastErrorResult rv;
43079 // NOTE: This assert does NOT call the function.
43080 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");
43081 MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43082 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"
)), 0))
) {
43083 return false;
43084 }
43085 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43085); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 43085); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
43086 args.rval().setUndefined();
43087 return true;
43088}
43089
43090static const JSJitInfo passAllowSharedNullableArrayBuffer_methodinfo = {
43091 { (JSJitGetterOp)passAllowSharedNullableArrayBuffer },
43092 { prototypes::id::TestJSImplInterface },
43093 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43094 JSJitInfo::Method,
43095 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43096 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43097 false, /* isInfallible. False in setters. */
43098 false, /* isMovable. Not relevant for setters. */
43099 false, /* isEliminatable. Not relevant for setters. */
43100 false, /* isAlwaysInSlot. Only relevant for getters. */
43101 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43102 false, /* isTypedMethod. Only relevant for methods. */
43103 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43104};
43105
43106MOZ_CAN_RUN_SCRIPT static bool
43107passUnionArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43108{
43109 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionArrayBuffer");
43110 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43113( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
43111 "TestJSImplInterface", "passUnionArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43113( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
43112 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43113( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
43113 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43113( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
43114
43115 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43116 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionArrayBuffer", 1)) {
43117 return false;
43118 }
43119 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
43120 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
43121 if (objIsXray) {
43122 unwrappedObj.emplace(cx, obj);
43123 }
43124 StringOrArrayBuffer arg0;
43125 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
43126 return false;
43127 }
43128 if (objIsXray) {
43129 // Since our object is an Xray, we can just CheckedUnwrapStatic:
43130 // we know Xrays have no dynamic unwrap behavior.
43131 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43132 if (!unwrappedObj.ref()) {
43133 return false;
43134 }
43135 }
43136 FastErrorResult rv;
43137 // NOTE: This assert does NOT call the function.
43138 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");
43139 MOZ_KnownLive(self)(self)->PassUnionArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43140 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer"
)), 0))
) {
43141 return false;
43142 }
43143 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43143); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 43143); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
43144 args.rval().setUndefined();
43145 return true;
43146}
43147
43148static const JSJitInfo passUnionArrayBuffer_methodinfo = {
43149 { (JSJitGetterOp)passUnionArrayBuffer },
43150 { prototypes::id::TestJSImplInterface },
43151 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43152 JSJitInfo::Method,
43153 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43154 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43155 false, /* isInfallible. False in setters. */
43156 false, /* isMovable. Not relevant for setters. */
43157 false, /* isEliminatable. Not relevant for setters. */
43158 false, /* isAlwaysInSlot. Only relevant for getters. */
43159 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43160 false, /* isTypedMethod. Only relevant for methods. */
43161 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43162};
43163
43164MOZ_CAN_RUN_SCRIPT static bool
43165passUnionAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43166{
43167 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionAllowSharedArrayBuffer");
43168 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43171( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43169 "TestJSImplInterface", "passUnionAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43171( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43170 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43171( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43171 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43171( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
43172
43173 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43174 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", 1)) {
43175 return false;
43176 }
43177 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
43178 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
43179 if (objIsXray) {
43180 unwrappedObj.emplace(cx, obj);
43181 }
43182 StringOrMaybeSharedArrayBuffer arg0;
43183 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
43184 return false;
43185 }
43186 if (objIsXray) {
43187 // Since our object is an Xray, we can just CheckedUnwrapStatic:
43188 // we know Xrays have no dynamic unwrap behavior.
43189 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43190 if (!unwrappedObj.ref()) {
43191 return false;
43192 }
43193 }
43194 FastErrorResult rv;
43195 // NOTE: This assert does NOT call the function.
43196 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");
43197 MOZ_KnownLive(self)(self)->PassUnionAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43198 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"
)), 0))
) {
43199 return false;
43200 }
43201 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43201); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 43201); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
43202 args.rval().setUndefined();
43203 return true;
43204}
43205
43206static const JSJitInfo passUnionAllowSharedArrayBuffer_methodinfo = {
43207 { (JSJitGetterOp)passUnionAllowSharedArrayBuffer },
43208 { prototypes::id::TestJSImplInterface },
43209 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43210 JSJitInfo::Method,
43211 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43212 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43213 false, /* isInfallible. False in setters. */
43214 false, /* isMovable. Not relevant for setters. */
43215 false, /* isEliminatable. Not relevant for setters. */
43216 false, /* isAlwaysInSlot. Only relevant for getters. */
43217 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43218 false, /* isTypedMethod. Only relevant for methods. */
43219 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43220};
43221
43222MOZ_CAN_RUN_SCRIPT static bool
43223passAllowSharedInt8ArrayOrInt16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43224{
43225 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedInt8ArrayOrInt16Array");
43226 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43229( cx, "TestJSImplInterface"
, "passAllowSharedInt8ArrayOrInt16Array", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43227 "TestJSImplInterface", "passAllowSharedInt8ArrayOrInt16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43229( cx, "TestJSImplInterface"
, "passAllowSharedInt8ArrayOrInt16Array", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43228 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43229( cx, "TestJSImplInterface"
, "passAllowSharedInt8ArrayOrInt16Array", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43229 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43229( cx, "TestJSImplInterface"
, "passAllowSharedInt8ArrayOrInt16Array", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
43230
43231 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43232 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedInt8ArrayOrInt16Array", 1)) {
43233 return false;
43234 }
43235 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
43236 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
43237 if (objIsXray) {
43238 unwrappedObj.emplace(cx, obj);
43239 }
43240 MaybeSharedInt8ArrayOrMaybeSharedInt16Array arg0;
43241 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
43242 return false;
43243 }
43244 if (objIsXray) {
43245 // Since our object is an Xray, we can just CheckedUnwrapStatic:
43246 // we know Xrays have no dynamic unwrap behavior.
43247 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43248 if (!unwrappedObj.ref()) {
43249 return false;
43250 }
43251 }
43252 FastErrorResult rv;
43253 // NOTE: This assert does NOT call the function.
43254 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedInt8ArrayOrInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
43255 MOZ_KnownLive(self)(self)->PassAllowSharedInt8ArrayOrInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43256 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedInt8ArrayOrInt16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedInt8ArrayOrInt16Array"
)), 0))
) {
43257 return false;
43258 }
43259 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43259); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 43259); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
43260 args.rval().setUndefined();
43261 return true;
43262}
43263
43264static const JSJitInfo passAllowSharedInt8ArrayOrInt16Array_methodinfo = {
43265 { (JSJitGetterOp)passAllowSharedInt8ArrayOrInt16Array },
43266 { prototypes::id::TestJSImplInterface },
43267 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43268 JSJitInfo::Method,
43269 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43270 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43271 false, /* isInfallible. False in setters. */
43272 false, /* isMovable. Not relevant for setters. */
43273 false, /* isEliminatable. Not relevant for setters. */
43274 false, /* isAlwaysInSlot. Only relevant for getters. */
43275 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43276 false, /* isTypedMethod. Only relevant for methods. */
43277 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43278};
43279
43280MOZ_CAN_RUN_SCRIPT static bool
43281toJSON(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43282{
43283 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43286( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43284 "TestJSImplInterface", "toJSON", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43286( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43285 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43286( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43286 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43286( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
43287
43288 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43289 JS::Rooted<JSObject*> result(cx, JS_NewPlainObject(cx));
43290 if (!result) {
43291 return false;
43292 }
43293 if (!TestJSImplInterface_Binding::CollectJSONAttributes(cx, obj, MOZ_KnownLive(self)(self), result)) {
43294 return false;
43295 }
43296 args.rval().setObject(*result);
43297 return true;
43298}
43299
43300static const JSJitInfo toJSON_methodinfo = {
43301 { (JSJitGetterOp)toJSON },
43302 { prototypes::id::TestJSImplInterface },
43303 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43304 JSJitInfo::Method,
43305 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43306 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
43307 false, /* isInfallible. False in setters. */
43308 false, /* isMovable. Not relevant for setters. */
43309 false, /* isEliminatable. Not relevant for setters. */
43310 false, /* isAlwaysInSlot. Only relevant for getters. */
43311 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43312 false, /* isTypedMethod. Only relevant for methods. */
43313 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43314};
43315
43316static void
43317_finalize(JS::GCContext* gcx, JSObject* obj)
43318{
43319 mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj);
43320 if (self) {
43321 JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue());
43322 ClearWrapper(self, self, obj);
43323 if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
43324 JS::RemoveAssociatedMemory(obj, mallocBytes,
43325 JS::MemoryUse::DOMBinding);
43326 }
43327 AddForDeferredFinalization<mozilla::dom::TestJSImplInterface>(self);
43328 }
43329}
43330
43331MOZ_GLOBINIT static const JSFunctionSpec sChromeStaticMethods_specs[] = {
43332 JS_FNSPEC("_create", TestJSImplInterface::_Create, nullptr, 2, 0, nullptr){JSFunctionSpec::Name("_create"), {TestJSImplInterface::_Create
, nullptr}, 2, 0, nullptr}
,
43333 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43334};
43335
43336
43337static const Prefable<const JSFunctionSpec> sChromeStaticMethods[] = {
43338 { nullptr, &sChromeStaticMethods_specs[0] },
43339 { nullptr, nullptr }
43340};
43341
43342static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43343 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43344static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43345 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43346
43347MOZ_GLOBINIT static const JSFunctionSpec sMethods_specs[] = {
43348 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}
,
43349 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}
,
43350 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}
,
43351 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}
,
43352 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}
,
43353 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}
,
43354 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}
,
43355 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}
,
43356 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}
,
43357 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}
,
43358 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}
,
43359 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}
,
43360 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}
,
43361 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}
,
43362 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
}
,
43363 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}
,
43364 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}
,
43365 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}
,
43366 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}
,
43367 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}
,
43368 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}
,
43369 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
}
,
43370 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}
,
43371 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}
,
43372 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}
,
43373 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}
,
43374 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
}
,
43375 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}
,
43376 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}
,
43377 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}
,
43378 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}
,
43379 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}
,
43380 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}
,
43381 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}
,
43382 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}
,
43383 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}
,
43384 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}
,
43385 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}
,
43386 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}
,
43387 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}
,
43388 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}
,
43389 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}
,
43390 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}
,
43391 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}
,
43392 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}
,
43393 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}
,
43394 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}
,
43395 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}
,
43396 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}
,
43397 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}
,
43398 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}
,
43399 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}
,
43400 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}
,
43401 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}
,
43402 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}
,
43403 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}
,
43404 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}
,
43405 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}
,
43406 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}
,
43407 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}
,
43408 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}
,
43409 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}
,
43410 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
}
,
43411 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}
,
43412 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}
,
43413 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}
,
43414 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}
,
43415 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}
,
43416 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}
,
43417 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}
,
43418 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}
,
43419 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}
,
43420 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}
,
43421 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}
,
43422 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}
,
43423 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}
,
43424 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}
,
43425 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}
,
43426 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}
,
43427 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}
,
43428 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
}
,
43429 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}
,
43430 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}
,
43431 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}
,
43432 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}
,
43433 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}
,
43434 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}
,
43435 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}
,
43436 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}
,
43437 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}
,
43438 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}
,
43439 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}
,
43440 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}
,
43441 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}
,
43442 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}
,
43443 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}
,
43444 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}
,
43445 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}
,
43446 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}
,
43447 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}
,
43448 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}
,
43449 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}
,
43450 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}
,
43451 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}
,
43452 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}
,
43453 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}
,
43454 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}
,
43455 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}
,
43456 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}
,
43457 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}
,
43458 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}
,
43459 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}
,
43460 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}
,
43461 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}
,
43462 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}
,
43463 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}
,
43464 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}
,
43465 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}
,
43466 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}
,
43467 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}
,
43468 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}
,
43469 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}
,
43470 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}
,
43471 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}
,
43472 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}
,
43473 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}
,
43474 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}
,
43475 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}
,
43476 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}
,
43477 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}
,
43478 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}
,
43479 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}
,
43480 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}
,
43481 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}
,
43482 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}
,
43483 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
}
,
43484 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}
,
43485 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}
,
43486 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}
,
43487 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}
,
43488 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}
,
43489 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}
,
43490 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}
,
43491 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}
,
43492 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}
,
43493 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}
,
43494 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
}
,
43495 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
}
,
43496 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
}
,
43497 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
}
,
43498 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}
,
43499 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}
,
43500 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}
,
43501 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}
,
43502 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}
,
43503 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}
,
43504 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}
,
43505 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}
,
43506 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}
,
43507 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}
,
43508 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}
,
43509 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}
,
43510 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}
,
43511 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}
,
43512 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}
,
43513 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}
,
43514 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}
,
43515 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}
,
43516 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}
,
43517 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
}
,
43518 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}
,
43519 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}
,
43520 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}
,
43521 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}
,
43522 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}
,
43523 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}
,
43524 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}
,
43525 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}
,
43526 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}
,
43527 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
}
,
43528 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}
,
43529 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}
,
43530 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}
,
43531 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}
,
43532 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}
,
43533 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}
,
43534 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}
,
43535 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}
,
43536 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}
,
43537 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}
,
43538 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}
,
43539 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}
,
43540 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}
,
43541 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}
,
43542 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}
,
43543 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}
,
43544 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}
,
43545 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
}
,
43546 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}
,
43547 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}
,
43548 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}
,
43549 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}
,
43550 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}
,
43551 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}
,
43552 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}
,
43553 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}
,
43554 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}
,
43555 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}
,
43556 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}
,
43557 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
}
,
43558 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}
,
43559 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}
,
43560 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}
,
43561 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}
,
43562 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}
,
43563 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}
,
43564 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}
,
43565 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}
,
43566 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}
,
43567 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}
,
43568 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}
,
43569 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}
,
43570 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}
,
43571 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}
,
43572 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}
,
43573 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}
,
43574 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}
,
43575 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}
,
43576 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}
,
43577 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}
,
43578 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}
,
43579 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}
,
43580 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}
,
43581 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}
,
43582 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}
,
43583 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}
,
43584 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}
,
43585 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}
,
43586 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}
,
43587 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}
,
43588 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}
,
43589 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}
,
43590 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}
,
43591 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}
,
43592 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}
,
43593 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}
,
43594 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}
,
43595 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}
,
43596 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}
,
43597 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}
,
43598 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}
,
43599 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}
,
43600 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}
,
43601 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}
,
43602 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}
,
43603 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
}
,
43604 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}
,
43605 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}
,
43606 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}
,
43607 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}
,
43608 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}
,
43609 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}
,
43610 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}
,
43611 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}
,
43612 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}
,
43613 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}
,
43614 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}
,
43615 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}
,
43616 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}
,
43617 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}
,
43618 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}
,
43619 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}
,
43620 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}
,
43621 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}
,
43622 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}
,
43623 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}
,
43624 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}
,
43625 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}
,
43626 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}
,
43627 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}
,
43628 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}
,
43629 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}
,
43630 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}
,
43631 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}
,
43632 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}
,
43633 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}
,
43634 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}
,
43635 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}
,
43636 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}
,
43637 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}
,
43638 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}
,
43639 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}
,
43640 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}
,
43641 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}
,
43642 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}
,
43643 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}
,
43644 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}
,
43645 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}
,
43646 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}
,
43647 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}
,
43648 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}
,
43649 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}
,
43650 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}
,
43651 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}
,
43652 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}
,
43653 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}
,
43654 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}
,
43655 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}
,
43656 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}
,
43657 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}
,
43658 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}
,
43659 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}
,
43660 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}
,
43661 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}
,
43662 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}
,
43663 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}
,
43664 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}
,
43665 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}
,
43666 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}
,
43667 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}
,
43668 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}
,
43669 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}
,
43670 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}
,
43671 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}
,
43672 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}
,
43673 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}
,
43674 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}
,
43675 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}
,
43676 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}
,
43677 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}
,
43678 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}
,
43679 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}
,
43680 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}
,
43681 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}
,
43682 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}
,
43683 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}
,
43684 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}
,
43685 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}
,
43686 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}
,
43687 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}
,
43688 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}
,
43689 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}
,
43690 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}
,
43691 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}
,
43692 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}
,
43693 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}
,
43694 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}
,
43695 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}
,
43696 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}
,
43697 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}
,
43698 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}
,
43699 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}
,
43700 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}
,
43701 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}
,
43702 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}
,
43703 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}
,
43704 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}
,
43705 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}
,
43706 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}
,
43707 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}
,
43708 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}
,
43709 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}
,
43710 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}
,
43711 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
}
,
43712 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
}
,
43713 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}
,
43714 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}
,
43715 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}
,
43716 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}
,
43717 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}
,
43718 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}
,
43719 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}
,
43720 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}
,
43721 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}
,
43722 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
}
,
43723 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}
,
43724 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}
,
43725 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}
,
43726 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}
,
43727 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}
,
43728 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}
,
43729 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}
,
43730 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}
,
43731 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}
,
43732 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}
,
43733 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}
,
43734 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}
,
43735 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
}
,
43736 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}
,
43737 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}
,
43738 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}
,
43739 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}
,
43740 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}
,
43741 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}
,
43742 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}
,
43743 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}
,
43744 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}
,
43745 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}
,
43746 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}
,
43747 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}
,
43748 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}
,
43749 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}
,
43750 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}
,
43751 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}
,
43752 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}
,
43753 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}
,
43754 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}
,
43755 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}
,
43756 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}
,
43757 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}
,
43758 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}
,
43759 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}
,
43760 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}
,
43761 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}
,
43762 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}
,
43763 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}
,
43764 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}
,
43765 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43766 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}
,
43767 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43768 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}
,
43769 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}
,
43770 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43771 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}
,
43772 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43773 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}
,
43774 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}
,
43775 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43776 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}
,
43777 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43778 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}
,
43779 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43780 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}
,
43781 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43782 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}
,
43783 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43784 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}
,
43785 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
}
,
43786 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
}
,
43787 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}
,
43788 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}
,
43789 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}
,
43790 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}
,
43791 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
}
,
43792 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}
,
43793 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}
,
43794 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}
,
43795 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}
,
43796 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}
,
43797 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}
,
43798 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}
,
43799 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}
,
43800 JS_FNSPEC("passAllowSharedInt8ArrayOrInt16Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedInt8ArrayOrInt16Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedInt8ArrayOrInt16Array")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passAllowSharedInt8ArrayOrInt16Array_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43801 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43802};
43803
43804static const PrefableDisablers sMethods_disablers418 = {
43805 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43806};
43807
43808static const PrefableDisablers sMethods_disablers420 = {
43809 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43810};
43811
43812static const PrefableDisablers sMethods_disablers423 = {
43813 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
43814};
43815
43816static const PrefableDisablers sMethods_disablers425 = {
43817 WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember
43818};
43819
43820static const PrefableDisablers sMethods_disablers428 = {
43821 WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr
43822};
43823
43824static const PrefableDisablers sMethods_disablers430 = {
43825 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr
43826};
43827
43828static const PrefableDisablers sMethods_disablers432 = {
43829 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43830};
43831
43832static const PrefableDisablers sMethods_disablers434 = {
43833 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember
43834};
43835
43836static const Prefable<const JSFunctionSpec> sMethods[] = {
43837 { nullptr, &sMethods_specs[0] },
43838 { &sMethods_disablers418, &sMethods_specs[418] },
43839 { &sMethods_disablers420, &sMethods_specs[420] },
43840 { &sMethods_disablers423, &sMethods_specs[423] },
43841 { &sMethods_disablers425, &sMethods_specs[425] },
43842 { &sMethods_disablers428, &sMethods_specs[428] },
43843 { &sMethods_disablers430, &sMethods_specs[430] },
43844 { &sMethods_disablers432, &sMethods_specs[432] },
43845 { &sMethods_disablers434, &sMethods_specs[434] },
43846 { nullptr, &sMethods_specs[436] },
43847 { nullptr, nullptr }
43848};
43849
43850static_assert(10 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43851 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43852static_assert(417 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43853 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43854
43855MOZ_GLOBINIT static const JSFunctionSpec sChromeMethods_specs[] = {
43856 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}
,
43857 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43858};
43859
43860static const PrefableDisablers sChromeMethods_disablers0 = {
43861 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
43862};
43863
43864static const Prefable<const JSFunctionSpec> sChromeMethods[] = {
43865 { &sChromeMethods_disablers0, &sChromeMethods_specs[0] },
43866 { nullptr, nullptr }
43867};
43868
43869static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43870 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43871static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43872 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43873
43874MOZ_GLOBINIT static const JSPropertySpec sAttributes_specs[] = {
43875 JSPropertySpec::nativeAccessors("readonlyByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyByte_getterinfo, nullptr, nullptr),
43876 JSPropertySpec::nativeAccessors("writableByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableByte_getterinfo, GenericSetter<NormalThisPolicy>, &writableByte_setterinfo),
43877 JSPropertySpec::nativeAccessors("sideEffectFreeByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sideEffectFreeByte_getterinfo, GenericSetter<NormalThisPolicy>, &sideEffectFreeByte_setterinfo),
43878 JSPropertySpec::nativeAccessors("domDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domDependentByte_getterinfo, GenericSetter<NormalThisPolicy>, &domDependentByte_setterinfo),
43879 JSPropertySpec::nativeAccessors("constantByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &constantByte_getterinfo, nullptr, nullptr),
43880 JSPropertySpec::nativeAccessors("deviceStateDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deviceStateDependentByte_getterinfo, nullptr, nullptr),
43881 JSPropertySpec::nativeAccessors("readonlyShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyShort_getterinfo, nullptr, nullptr),
43882 JSPropertySpec::nativeAccessors("writableShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableShort_setterinfo),
43883 JSPropertySpec::nativeAccessors("readonlyLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLong_getterinfo, nullptr, nullptr),
43884 JSPropertySpec::nativeAccessors("writableLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLong_setterinfo),
43885 JSPropertySpec::nativeAccessors("readonlyLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLongLong_getterinfo, nullptr, nullptr),
43886 JSPropertySpec::nativeAccessors("writableLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLongLong_setterinfo),
43887 JSPropertySpec::nativeAccessors("readonlyOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyOctet_getterinfo, nullptr, nullptr),
43888 JSPropertySpec::nativeAccessors("writableOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableOctet_getterinfo, GenericSetter<NormalThisPolicy>, &writableOctet_setterinfo),
43889 JSPropertySpec::nativeAccessors("readonlyUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedShort_getterinfo, nullptr, nullptr),
43890 JSPropertySpec::nativeAccessors("writableUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedShort_setterinfo),
43891 JSPropertySpec::nativeAccessors("readonlyUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLong_getterinfo, nullptr, nullptr),
43892 JSPropertySpec::nativeAccessors("writableUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLong_setterinfo),
43893 JSPropertySpec::nativeAccessors("readonlyUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLongLong_getterinfo, nullptr, nullptr),
43894 JSPropertySpec::nativeAccessors("writableUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLongLong_setterinfo),
43895 JSPropertySpec::nativeAccessors("writableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableFloat_setterinfo),
43896 JSPropertySpec::nativeAccessors("writableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedFloat_setterinfo),
43897 JSPropertySpec::nativeAccessors("writableNullableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableFloat_setterinfo),
43898 JSPropertySpec::nativeAccessors("writableNullableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedFloat_setterinfo),
43899 JSPropertySpec::nativeAccessors("writableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableDouble_setterinfo),
43900 JSPropertySpec::nativeAccessors("writableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedDouble_setterinfo),
43901 JSPropertySpec::nativeAccessors("writableNullableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableDouble_setterinfo),
43902 JSPropertySpec::nativeAccessors("writableNullableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedDouble_setterinfo),
43903 JSPropertySpec::nativeAccessors("lenientFloatAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientFloatAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientFloatAttr_setterinfo),
43904 JSPropertySpec::nativeAccessors("lenientDoubleAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientDoubleAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientDoubleAttr_setterinfo),
43905 JSPropertySpec::nativeAccessors("nonNullSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullSelf_setterinfo),
43906 JSPropertySpec::nativeAccessors("nullableSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nullableSelf_setterinfo),
43907 JSPropertySpec::nativeAccessors("nonNullExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullExternal_setterinfo),
43908 JSPropertySpec::nativeAccessors("nullableExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nullableExternal_setterinfo),
43909 JSPropertySpec::nativeAccessors("nonNullCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullCallbackInterface_setterinfo),
43910 JSPropertySpec::nativeAccessors("nullableCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nullableCallbackInterface_setterinfo),
43911 JSPropertySpec::nativeAccessors("uint8ArrayAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &uint8ArrayAttr_getterinfo, GenericSetter<NormalThisPolicy>, &uint8ArrayAttr_setterinfo),
43912 JSPropertySpec::nativeAccessors("readonlyJSStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyJSStringAttr_getterinfo, nullptr, nullptr),
43913 JSPropertySpec::nativeAccessors("jsStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &jsStringAttr_getterinfo, GenericSetter<NormalThisPolicy>, &jsStringAttr_setterinfo),
43914 JSPropertySpec::nativeAccessors("enumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enumAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &enumAttribute_setterinfo),
43915 JSPropertySpec::nativeAccessors("readonlyEnumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyEnumAttribute_getterinfo, nullptr, nullptr),
43916 JSPropertySpec::nativeAccessors("writableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnion_setterinfo),
43917 JSPropertySpec::nativeAccessors("writableUnionContainingNull", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnionContainingNull_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnionContainingNull_setterinfo),
43918 JSPropertySpec::nativeAccessors("writableNullableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnion_setterinfo),
43919 JSPropertySpec::nativeAccessors("attributeGetterRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeGetterRenamedFrom_getterinfo, nullptr, nullptr),
43920 JSPropertySpec::nativeAccessors("attributeRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeRenamedFrom_getterinfo, GenericSetter<NormalThisPolicy>, &attributeRenamedFrom_setterinfo),
43921 JSPropertySpec::nativeAccessors("enforcedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByte_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByte_setterinfo),
43922 JSPropertySpec::nativeAccessors("enforcedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByteNullable_setterinfo),
43923 JSPropertySpec::nativeAccessors("clampedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByte_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByte_setterinfo),
43924 JSPropertySpec::nativeAccessors("clampedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByteNullable_setterinfo),
43925 JSPropertySpec::nativeAccessors("deprecatedAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deprecatedAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &deprecatedAttribute_setterinfo),
43926 JS_PS_ENDJSPropertySpec::sentinel(),
43927 JSPropertySpec::nativeAccessors("prefable1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable1_getterinfo, nullptr, nullptr),
43928 JSPropertySpec::nativeAccessors("prefable2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable2_getterinfo, nullptr, nullptr),
43929 JS_PS_ENDJSPropertySpec::sentinel(),
43930 JSPropertySpec::nativeAccessors("prefable3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable3_getterinfo, nullptr, nullptr),
43931 JSPropertySpec::nativeAccessors("prefable4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable4_getterinfo, nullptr, nullptr),
43932 JS_PS_ENDJSPropertySpec::sentinel(),
43933 JSPropertySpec::nativeAccessors("prefable5", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable5_getterinfo, nullptr, nullptr),
43934 JS_PS_ENDJSPropertySpec::sentinel(),
43935 JSPropertySpec::nativeAccessors("prefable6", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable6_getterinfo, nullptr, nullptr),
43936 JSPropertySpec::nativeAccessors("prefable7", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable7_getterinfo, nullptr, nullptr),
43937 JS_PS_ENDJSPropertySpec::sentinel(),
43938 JSPropertySpec::nativeAccessors("prefable8", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable8_getterinfo, nullptr, nullptr),
43939 JS_PS_ENDJSPropertySpec::sentinel(),
43940 JSPropertySpec::nativeAccessors("prefable9", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable9_getterinfo, nullptr, nullptr),
43941 JS_PS_ENDJSPropertySpec::sentinel(),
43942 JSPropertySpec::nativeAccessors("prefable12", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable12_getterinfo, nullptr, nullptr),
43943 JSPropertySpec::nativeAccessors("prefable14", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable14_getterinfo, nullptr, nullptr),
43944 JS_PS_ENDJSPropertySpec::sentinel(),
43945 JSPropertySpec::nativeAccessors("prefable15", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable15_getterinfo, nullptr, nullptr),
43946 JSPropertySpec::nativeAccessors("prefable16", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable16_getterinfo, nullptr, nullptr),
43947 JS_PS_ENDJSPropertySpec::sentinel(),
43948 JSPropertySpec::nativeAccessors("conditionalOnSecureContext1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext1_getterinfo, nullptr, nullptr),
43949 JS_PS_ENDJSPropertySpec::sentinel(),
43950 JSPropertySpec::nativeAccessors("conditionalOnSecureContext2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext2_getterinfo, nullptr, nullptr),
43951 JS_PS_ENDJSPropertySpec::sentinel(),
43952 JSPropertySpec::nativeAccessors("conditionalOnSecureContext3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext3_getterinfo, nullptr, nullptr),
43953 JS_PS_ENDJSPropertySpec::sentinel(),
43954 JSPropertySpec::nativeAccessors("conditionalOnSecureContext4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext4_getterinfo, nullptr, nullptr),
43955 JS_PS_ENDJSPropertySpec::sentinel(),
43956 JSPropertySpec::nativeAccessors("attrWithLenientThis", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &attrWithLenientThis_getterinfo, GenericSetter<LenientThisPolicy>, &attrWithLenientThis_setterinfo),
43957 JSPropertySpec::nativeAccessors("putForwardsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr_setterinfo),
43958 JSPropertySpec::nativeAccessors("putForwardsAttr2", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &putForwardsAttr2_getterinfo, GenericSetter<LenientThisPolicy>, &putForwardsAttr2_setterinfo),
43959 JSPropertySpec::nativeAccessors("throwingAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingAttr_setterinfo),
43960 JSPropertySpec::nativeAccessors("throwingGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingGetterAttr_setterinfo),
43961 JSPropertySpec::nativeAccessors("throwingSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingSetterAttr_setterinfo),
43962 JSPropertySpec::nativeAccessors("canOOMAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMAttr_setterinfo),
43963 JSPropertySpec::nativeAccessors("canOOMGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMGetterAttr_setterinfo),
43964 JSPropertySpec::nativeAccessors("canOOMSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMSetterAttr_setterinfo),
43965 JSPropertySpec::nativeAccessors("ceReactionsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ceReactionsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &ceReactionsAttr_setterinfo),
43966 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis_setterinfo),
43967 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis2_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis2_setterinfo),
43968 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis3_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis3_setterinfo),
43969 JSPropertySpec::nativeAccessors("dashed-attribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dashed_attribute_getterinfo, GenericSetter<NormalThisPolicy>, &dashed_attribute_setterinfo),
43970 JSPropertySpec::nativeAccessors("nonEnumerableAttr", 0, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonEnumerableAttr_getterinfo, GenericSetter<NormalThisPolicy>, &nonEnumerableAttr_setterinfo),
43971 JSPropertySpec::nativeAccessors("allowSharedArrayBufferViewTypedef", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferViewTypedef_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferViewTypedef_setterinfo),
43972 JSPropertySpec::nativeAccessors("allowSharedArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferView_setterinfo),
43973 JSPropertySpec::nativeAccessors("allowSharedNullableArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBufferView_setterinfo),
43974 JSPropertySpec::nativeAccessors("allowSharedArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBuffer_setterinfo),
43975 JSPropertySpec::nativeAccessors("allowSharedNullableArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBuffer_setterinfo),
43976 JS_PS_ENDJSPropertySpec::sentinel()
43977};
43978
43979static const PrefableDisablers sAttributes_disablers52 = {
43980 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43981};
43982
43983static const PrefableDisablers sAttributes_disablers55 = {
43984 WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), nullptr
43985};
43986
43987static const PrefableDisablers sAttributes_disablers58 = {
43988 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43989};
43990
43991static const PrefableDisablers sAttributes_disablers60 = {
43992 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43993};
43994
43995static const PrefableDisablers sAttributes_disablers63 = {
43996 WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43997};
43998
43999static const PrefableDisablers sAttributes_disablers65 = {
44000 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
44001};
44002
44003static const PrefableDisablers sAttributes_disablers67 = {
44004 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
44005};
44006
44007static const PrefableDisablers sAttributes_disablers70 = {
44008 WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember
44009};
44010
44011static const PrefableDisablers sAttributes_disablers73 = {
44012 WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr
44013};
44014
44015static const PrefableDisablers sAttributes_disablers75 = {
44016 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr
44017};
44018
44019static const PrefableDisablers sAttributes_disablers77 = {
44020 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
44021};
44022
44023static const PrefableDisablers sAttributes_disablers79 = {
44024 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember
44025};
44026
44027static const Prefable<const JSPropertySpec> sAttributes[] = {
44028 { nullptr, &sAttributes_specs[0] },
44029 { &sAttributes_disablers52, &sAttributes_specs[52] },
44030 { &sAttributes_disablers55, &sAttributes_specs[55] },
44031 { &sAttributes_disablers58, &sAttributes_specs[58] },
44032 { &sAttributes_disablers60, &sAttributes_specs[60] },
44033 { &sAttributes_disablers63, &sAttributes_specs[63] },
44034 { &sAttributes_disablers65, &sAttributes_specs[65] },
44035 { &sAttributes_disablers67, &sAttributes_specs[67] },
44036 { &sAttributes_disablers70, &sAttributes_specs[70] },
44037 { &sAttributes_disablers73, &sAttributes_specs[73] },
44038 { &sAttributes_disablers75, &sAttributes_specs[75] },
44039 { &sAttributes_disablers77, &sAttributes_specs[77] },
44040 { &sAttributes_disablers79, &sAttributes_specs[79] },
44041 { nullptr, &sAttributes_specs[81] },
44042 { nullptr, nullptr }
44043};
44044
44045static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
44046 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
44047static_assert(51 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
44048 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
44049
44050MOZ_GLOBINIT static const JSPropertySpec sChromeAttributes_specs[] = {
44051 JSPropertySpec::nativeAccessors("putForwardsAttr3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr3_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr3_setterinfo),
44052 JS_PS_ENDJSPropertySpec::sentinel()
44053};
44054
44055
44056static const Prefable<const JSPropertySpec> sChromeAttributes[] = {
44057 { nullptr, &sChromeAttributes_specs[0] },
44058 { nullptr, nullptr }
44059};
44060
44061static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
44062 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
44063static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
44064 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
44065
44066MOZ_GLOBINIT static const ConstantSpec sConstants_specs[] = {
44067 { "myLongConstant", JS::Int32Value(5) },
44068 { "nonEnumerableConst", JS::BooleanValue(true) },
44069 { 0, JS::UndefinedValue() }
44070};
44071
44072
44073static const Prefable<const ConstantSpec> sConstants[] = {
44074 { nullptr, &sConstants_specs[0] },
44075 { nullptr, nullptr }
44076};
44077
44078static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
44079 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
44080static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
44081 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
44082
44083
44084static uint16_t sNativeProperties_sortedPropertyIndices[534];
44085static PropertyInfo sNativeProperties_propertyInfos[534];
44086
44087static const NativePropertiesN<3> sNativeProperties = {
44088 false, 0,
44089 false, 0,
44090 true, 0 /* sMethods */,
44091 true, 1 /* sAttributes */,
44092 false, 0,
44093 false, 0,
44094 true, 2 /* sConstants */,
44095 -1,
44096 534,
44097 sNativeProperties_sortedPropertyIndices,
44098 {
44099 { sMethods, &sNativeProperties_propertyInfos[0] },
44100 { sAttributes, &sNativeProperties_propertyInfos[444] },
44101 { sConstants, &sNativeProperties_propertyInfos[532] }
44102 }
44103};
44104static_assert(534 < 1ull << (CHAR_BIT8 * sizeof(sNativeProperties.propertyInfoCount)),
44105 "We have a property info count that is oversized");
44106
44107static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[3];
44108static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[3];
44109
44110static const NativePropertiesN<3> sChromeOnlyNativeProperties = {
44111 true, 0 /* sChromeStaticMethods */,
44112 false, 0,
44113 true, 1 /* sChromeMethods */,
44114 true, 2 /* sChromeAttributes */,
44115 false, 0,
44116 false, 0,
44117 false, 0,
44118 -1,
44119 3,
44120 sChromeOnlyNativeProperties_sortedPropertyIndices,
44121 {
44122 { sChromeStaticMethods, &sChromeOnlyNativeProperties_propertyInfos[0] },
44123 { sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[1] },
44124 { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[2] }
44125 }
44126};
44127static_assert(3 < 1ull << (CHAR_BIT8 * sizeof(sChromeOnlyNativeProperties.propertyInfoCount)),
44128 "We have a property info count that is oversized");
44129
44130MOZ_CAN_RUN_SCRIPT bool
44131CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TestJSImplInterface* self, JS::Rooted<JSObject*>& result)
44132{
44133 JS::Rooted<JSObject*> unwrappedObj(cx, js::CheckedUnwrapStatic(obj));
44134 if (!unwrappedObj) {
44135 // How did that happen? We managed to get called with that
44136 // object as "this"! Just give up on sanity.
44137 return false;
44138 }
44139
44140 { // scope for "temp"
44141 JS::Rooted<JS::Value> temp(cx);
44142 if (!get_readonlyByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44143 return false;
44144 }
44145 if (!JS_DefineProperty(cx, result, "readonlyByte", temp, JSPROP_ENUMERATE)) {
44146 return false;
44147 }
44148 }
44149 { // scope for "temp"
44150 JS::Rooted<JS::Value> temp(cx);
44151 if (!get_writableByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44152 return false;
44153 }
44154 if (!JS_DefineProperty(cx, result, "writableByte", temp, JSPROP_ENUMERATE)) {
44155 return false;
44156 }
44157 }
44158 { // scope for "temp"
44159 JS::Rooted<JS::Value> temp(cx);
44160 if (!get_sideEffectFreeByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44161 return false;
44162 }
44163 if (!JS_DefineProperty(cx, result, "sideEffectFreeByte", temp, JSPROP_ENUMERATE)) {
44164 return false;
44165 }
44166 }
44167 { // scope for "temp"
44168 JS::Rooted<JS::Value> temp(cx);
44169 if (!get_domDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44170 return false;
44171 }
44172 if (!JS_DefineProperty(cx, result, "domDependentByte", temp, JSPROP_ENUMERATE)) {
44173 return false;
44174 }
44175 }
44176 { // scope for "temp"
44177 JS::Rooted<JS::Value> temp(cx);
44178 if (!get_constantByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44179 return false;
44180 }
44181 if (!JS_DefineProperty(cx, result, "constantByte", temp, JSPROP_ENUMERATE)) {
44182 return false;
44183 }
44184 }
44185 { // scope for "temp"
44186 JS::Rooted<JS::Value> temp(cx);
44187 if (!get_deviceStateDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44188 return false;
44189 }
44190 if (!JS_DefineProperty(cx, result, "deviceStateDependentByte", temp, JSPROP_ENUMERATE)) {
44191 return false;
44192 }
44193 }
44194 { // scope for "temp"
44195 JS::Rooted<JS::Value> temp(cx);
44196 if (!get_readonlyShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44197 return false;
44198 }
44199 if (!JS_DefineProperty(cx, result, "readonlyShort", temp, JSPROP_ENUMERATE)) {
44200 return false;
44201 }
44202 }
44203 { // scope for "temp"
44204 JS::Rooted<JS::Value> temp(cx);
44205 if (!get_writableShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44206 return false;
44207 }
44208 if (!JS_DefineProperty(cx, result, "writableShort", temp, JSPROP_ENUMERATE)) {
44209 return false;
44210 }
44211 }
44212 { // scope for "temp"
44213 JS::Rooted<JS::Value> temp(cx);
44214 if (!get_readonlyLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44215 return false;
44216 }
44217 if (!JS_DefineProperty(cx, result, "readonlyLong", temp, JSPROP_ENUMERATE)) {
44218 return false;
44219 }
44220 }
44221 { // scope for "temp"
44222 JS::Rooted<JS::Value> temp(cx);
44223 if (!get_writableLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44224 return false;
44225 }
44226 if (!JS_DefineProperty(cx, result, "writableLong", temp, JSPROP_ENUMERATE)) {
44227 return false;
44228 }
44229 }
44230 { // scope for "temp"
44231 JS::Rooted<JS::Value> temp(cx);
44232 if (!get_readonlyLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44233 return false;
44234 }
44235 if (!JS_DefineProperty(cx, result, "readonlyLongLong", temp, JSPROP_ENUMERATE)) {
44236 return false;
44237 }
44238 }
44239 { // scope for "temp"
44240 JS::Rooted<JS::Value> temp(cx);
44241 if (!get_writableLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44242 return false;
44243 }
44244 if (!JS_DefineProperty(cx, result, "writableLongLong", temp, JSPROP_ENUMERATE)) {
44245 return false;
44246 }
44247 }
44248 { // scope for "temp"
44249 JS::Rooted<JS::Value> temp(cx);
44250 if (!get_readonlyOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44251 return false;
44252 }
44253 if (!JS_DefineProperty(cx, result, "readonlyOctet", temp, JSPROP_ENUMERATE)) {
44254 return false;
44255 }
44256 }
44257 { // scope for "temp"
44258 JS::Rooted<JS::Value> temp(cx);
44259 if (!get_writableOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44260 return false;
44261 }
44262 if (!JS_DefineProperty(cx, result, "writableOctet", temp, JSPROP_ENUMERATE)) {
44263 return false;
44264 }
44265 }
44266 { // scope for "temp"
44267 JS::Rooted<JS::Value> temp(cx);
44268 if (!get_readonlyUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44269 return false;
44270 }
44271 if (!JS_DefineProperty(cx, result, "readonlyUnsignedShort", temp, JSPROP_ENUMERATE)) {
44272 return false;
44273 }
44274 }
44275 { // scope for "temp"
44276 JS::Rooted<JS::Value> temp(cx);
44277 if (!get_writableUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44278 return false;
44279 }
44280 if (!JS_DefineProperty(cx, result, "writableUnsignedShort", temp, JSPROP_ENUMERATE)) {
44281 return false;
44282 }
44283 }
44284 { // scope for "temp"
44285 JS::Rooted<JS::Value> temp(cx);
44286 if (!get_readonlyUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44287 return false;
44288 }
44289 if (!JS_DefineProperty(cx, result, "readonlyUnsignedLong", temp, JSPROP_ENUMERATE)) {
44290 return false;
44291 }
44292 }
44293 { // scope for "temp"
44294 JS::Rooted<JS::Value> temp(cx);
44295 if (!get_writableUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44296 return false;
44297 }
44298 if (!JS_DefineProperty(cx, result, "writableUnsignedLong", temp, JSPROP_ENUMERATE)) {
44299 return false;
44300 }
44301 }
44302 { // scope for "temp"
44303 JS::Rooted<JS::Value> temp(cx);
44304 if (!get_readonlyUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44305 return false;
44306 }
44307 if (!JS_DefineProperty(cx, result, "readonlyUnsignedLongLong", temp, JSPROP_ENUMERATE)) {
44308 return false;
44309 }
44310 }
44311 { // scope for "temp"
44312 JS::Rooted<JS::Value> temp(cx);
44313 if (!get_writableUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44314 return false;
44315 }
44316 if (!JS_DefineProperty(cx, result, "writableUnsignedLongLong", temp, JSPROP_ENUMERATE)) {
44317 return false;
44318 }
44319 }
44320 { // scope for "temp"
44321 JS::Rooted<JS::Value> temp(cx);
44322 if (!get_writableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44323 return false;
44324 }
44325 if (!JS_DefineProperty(cx, result, "writableFloat", temp, JSPROP_ENUMERATE)) {
44326 return false;
44327 }
44328 }
44329 { // scope for "temp"
44330 JS::Rooted<JS::Value> temp(cx);
44331 if (!get_writableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44332 return false;
44333 }
44334 if (!JS_DefineProperty(cx, result, "writableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) {
44335 return false;
44336 }
44337 }
44338 { // scope for "temp"
44339 JS::Rooted<JS::Value> temp(cx);
44340 if (!get_writableNullableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44341 return false;
44342 }
44343 if (!JS_DefineProperty(cx, result, "writableNullableFloat", temp, JSPROP_ENUMERATE)) {
44344 return false;
44345 }
44346 }
44347 { // scope for "temp"
44348 JS::Rooted<JS::Value> temp(cx);
44349 if (!get_writableNullableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44350 return false;
44351 }
44352 if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) {
44353 return false;
44354 }
44355 }
44356 { // scope for "temp"
44357 JS::Rooted<JS::Value> temp(cx);
44358 if (!get_writableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44359 return false;
44360 }
44361 if (!JS_DefineProperty(cx, result, "writableDouble", temp, JSPROP_ENUMERATE)) {
44362 return false;
44363 }
44364 }
44365 { // scope for "temp"
44366 JS::Rooted<JS::Value> temp(cx);
44367 if (!get_writableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44368 return false;
44369 }
44370 if (!JS_DefineProperty(cx, result, "writableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) {
44371 return false;
44372 }
44373 }
44374 { // scope for "temp"
44375 JS::Rooted<JS::Value> temp(cx);
44376 if (!get_writableNullableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44377 return false;
44378 }
44379 if (!JS_DefineProperty(cx, result, "writableNullableDouble", temp, JSPROP_ENUMERATE)) {
44380 return false;
44381 }
44382 }
44383 { // scope for "temp"
44384 JS::Rooted<JS::Value> temp(cx);
44385 if (!get_writableNullableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44386 return false;
44387 }
44388 if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) {
44389 return false;
44390 }
44391 }
44392 { // scope for "temp"
44393 JS::Rooted<JS::Value> temp(cx);
44394 if (!get_lenientFloatAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44395 return false;
44396 }
44397 if (!JS_DefineProperty(cx, result, "lenientFloatAttr", temp, JSPROP_ENUMERATE)) {
44398 return false;
44399 }
44400 }
44401 { // scope for "temp"
44402 JS::Rooted<JS::Value> temp(cx);
44403 if (!get_lenientDoubleAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44404 return false;
44405 }
44406 if (!JS_DefineProperty(cx, result, "lenientDoubleAttr", temp, JSPROP_ENUMERATE)) {
44407 return false;
44408 }
44409 }
44410 { // scope for "temp"
44411 JS::Rooted<JS::Value> temp(cx);
44412 if (!get_nonNullSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44413 return false;
44414 }
44415 if (!JS_DefineProperty(cx, result, "nonNullSelf", temp, JSPROP_ENUMERATE)) {
44416 return false;
44417 }
44418 }
44419 { // scope for "temp"
44420 JS::Rooted<JS::Value> temp(cx);
44421 if (!get_nullableSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44422 return false;
44423 }
44424 if (!JS_DefineProperty(cx, result, "nullableSelf", temp, JSPROP_ENUMERATE)) {
44425 return false;
44426 }
44427 }
44428 { // scope for "temp"
44429 JS::Rooted<JS::Value> temp(cx);
44430 if (!get_readonlyJSStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44431 return false;
44432 }
44433 if (!JS_DefineProperty(cx, result, "readonlyJSStringAttr", temp, JSPROP_ENUMERATE)) {
44434 return false;
44435 }
44436 }
44437 { // scope for "temp"
44438 JS::Rooted<JS::Value> temp(cx);
44439 if (!get_jsStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44440 return false;
44441 }
44442 if (!JS_DefineProperty(cx, result, "jsStringAttr", temp, JSPROP_ENUMERATE)) {
44443 return false;
44444 }
44445 }
44446 { // scope for "temp"
44447 JS::Rooted<JS::Value> temp(cx);
44448 if (!get_enumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44449 return false;
44450 }
44451 if (!JS_DefineProperty(cx, result, "enumAttribute", temp, JSPROP_ENUMERATE)) {
44452 return false;
44453 }
44454 }
44455 { // scope for "temp"
44456 JS::Rooted<JS::Value> temp(cx);
44457 if (!get_readonlyEnumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44458 return false;
44459 }
44460 if (!JS_DefineProperty(cx, result, "readonlyEnumAttribute", temp, JSPROP_ENUMERATE)) {
44461 return false;
44462 }
44463 }
44464 { // scope for "temp"
44465 JS::Rooted<JS::Value> temp(cx);
44466 if (!get_attributeGetterRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44467 return false;
44468 }
44469 if (!JS_DefineProperty(cx, result, "attributeGetterRenamedFrom", temp, JSPROP_ENUMERATE)) {
44470 return false;
44471 }
44472 }
44473 { // scope for "temp"
44474 JS::Rooted<JS::Value> temp(cx);
44475 if (!get_attributeRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44476 return false;
44477 }
44478 if (!JS_DefineProperty(cx, result, "attributeRenamedFrom", temp, JSPROP_ENUMERATE)) {
44479 return false;
44480 }
44481 }
44482 { // scope for "temp"
44483 JS::Rooted<JS::Value> temp(cx);
44484 if (!get_enforcedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44485 return false;
44486 }
44487 if (!JS_DefineProperty(cx, result, "enforcedByte", temp, JSPROP_ENUMERATE)) {
44488 return false;
44489 }
44490 }
44491 { // scope for "temp"
44492 JS::Rooted<JS::Value> temp(cx);
44493 if (!get_enforcedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44494 return false;
44495 }
44496 if (!JS_DefineProperty(cx, result, "enforcedByteNullable", temp, JSPROP_ENUMERATE)) {
44497 return false;
44498 }
44499 }
44500 { // scope for "temp"
44501 JS::Rooted<JS::Value> temp(cx);
44502 if (!get_clampedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44503 return false;
44504 }
44505 if (!JS_DefineProperty(cx, result, "clampedByte", temp, JSPROP_ENUMERATE)) {
44506 return false;
44507 }
44508 }
44509 { // scope for "temp"
44510 JS::Rooted<JS::Value> temp(cx);
44511 if (!get_clampedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44512 return false;
44513 }
44514 if (!JS_DefineProperty(cx, result, "clampedByteNullable", temp, JSPROP_ENUMERATE)) {
44515 return false;
44516 }
44517 }
44518 { // scope for "temp"
44519 JS::Rooted<JS::Value> temp(cx);
44520 if (!get_deprecatedAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44521 return false;
44522 }
44523 if (!JS_DefineProperty(cx, result, "deprecatedAttribute", temp, JSPROP_ENUMERATE)) {
44524 return false;
44525 }
44526 }
44527 // This is unfortunately a linear scan through sAttributes, but we
44528 // only do it for things which _might_ be disabled, which should
44529 // help keep the performance problems down.
44530 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable1, sAttributes)) {
44531 JS::Rooted<JS::Value> temp(cx);
44532 if (!get_prefable1(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44533 return false;
44534 }
44535 if (!JS_DefineProperty(cx, result, "prefable1", temp, JSPROP_ENUMERATE)) {
44536 return false;
44537 }
44538 }
44539 // This is unfortunately a linear scan through sAttributes, but we
44540 // only do it for things which _might_ be disabled, which should
44541 // help keep the performance problems down.
44542 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable2, sAttributes)) {
44543 JS::Rooted<JS::Value> temp(cx);
44544 if (!get_prefable2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44545 return false;
44546 }
44547 if (!JS_DefineProperty(cx, result, "prefable2", temp, JSPROP_ENUMERATE)) {
44548 return false;
44549 }
44550 }
44551 // This is unfortunately a linear scan through sAttributes, but we
44552 // only do it for things which _might_ be disabled, which should
44553 // help keep the performance problems down.
44554 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable3, sAttributes)) {
44555 JS::Rooted<JS::Value> temp(cx);
44556 if (!get_prefable3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44557 return false;
44558 }
44559 if (!JS_DefineProperty(cx, result, "prefable3", temp, JSPROP_ENUMERATE)) {
44560 return false;
44561 }
44562 }
44563 // This is unfortunately a linear scan through sAttributes, but we
44564 // only do it for things which _might_ be disabled, which should
44565 // help keep the performance problems down.
44566 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable4, sAttributes)) {
44567 JS::Rooted<JS::Value> temp(cx);
44568 if (!get_prefable4(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44569 return false;
44570 }
44571 if (!JS_DefineProperty(cx, result, "prefable4", temp, JSPROP_ENUMERATE)) {
44572 return false;
44573 }
44574 }
44575 // This is unfortunately a linear scan through sAttributes, but we
44576 // only do it for things which _might_ be disabled, which should
44577 // help keep the performance problems down.
44578 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable5, sAttributes)) {
44579 JS::Rooted<JS::Value> temp(cx);
44580 if (!get_prefable5(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44581 return false;
44582 }
44583 if (!JS_DefineProperty(cx, result, "prefable5", temp, JSPROP_ENUMERATE)) {
44584 return false;
44585 }
44586 }
44587 // This is unfortunately a linear scan through sAttributes, but we
44588 // only do it for things which _might_ be disabled, which should
44589 // help keep the performance problems down.
44590 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable6, sAttributes)) {
44591 JS::Rooted<JS::Value> temp(cx);
44592 if (!get_prefable6(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44593 return false;
44594 }
44595 if (!JS_DefineProperty(cx, result, "prefable6", temp, JSPROP_ENUMERATE)) {
44596 return false;
44597 }
44598 }
44599 // This is unfortunately a linear scan through sAttributes, but we
44600 // only do it for things which _might_ be disabled, which should
44601 // help keep the performance problems down.
44602 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable7, sAttributes)) {
44603 JS::Rooted<JS::Value> temp(cx);
44604 if (!get_prefable7(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44605 return false;
44606 }
44607 if (!JS_DefineProperty(cx, result, "prefable7", temp, JSPROP_ENUMERATE)) {
44608 return false;
44609 }
44610 }
44611 // This is unfortunately a linear scan through sAttributes, but we
44612 // only do it for things which _might_ be disabled, which should
44613 // help keep the performance problems down.
44614 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable8, sAttributes)) {
44615 JS::Rooted<JS::Value> temp(cx);
44616 if (!get_prefable8(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44617 return false;
44618 }
44619 if (!JS_DefineProperty(cx, result, "prefable8", temp, JSPROP_ENUMERATE)) {
44620 return false;
44621 }
44622 }
44623 // This is unfortunately a linear scan through sAttributes, but we
44624 // only do it for things which _might_ be disabled, which should
44625 // help keep the performance problems down.
44626 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable9, sAttributes)) {
44627 JS::Rooted<JS::Value> temp(cx);
44628 if (!get_prefable9(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44629 return false;
44630 }
44631 if (!JS_DefineProperty(cx, result, "prefable9", temp, JSPROP_ENUMERATE)) {
44632 return false;
44633 }
44634 }
44635 // This is unfortunately a linear scan through sAttributes, but we
44636 // only do it for things which _might_ be disabled, which should
44637 // help keep the performance problems down.
44638 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable12, sAttributes)) {
44639 JS::Rooted<JS::Value> temp(cx);
44640 if (!get_prefable12(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44641 return false;
44642 }
44643 if (!JS_DefineProperty(cx, result, "prefable12", temp, JSPROP_ENUMERATE)) {
44644 return false;
44645 }
44646 }
44647 // This is unfortunately a linear scan through sAttributes, but we
44648 // only do it for things which _might_ be disabled, which should
44649 // help keep the performance problems down.
44650 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable14, sAttributes)) {
44651 JS::Rooted<JS::Value> temp(cx);
44652 if (!get_prefable14(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44653 return false;
44654 }
44655 if (!JS_DefineProperty(cx, result, "prefable14", temp, JSPROP_ENUMERATE)) {
44656 return false;
44657 }
44658 }
44659 // This is unfortunately a linear scan through sAttributes, but we
44660 // only do it for things which _might_ be disabled, which should
44661 // help keep the performance problems down.
44662 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable15, sAttributes)) {
44663 JS::Rooted<JS::Value> temp(cx);
44664 if (!get_prefable15(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44665 return false;
44666 }
44667 if (!JS_DefineProperty(cx, result, "prefable15", temp, JSPROP_ENUMERATE)) {
44668 return false;
44669 }
44670 }
44671 // This is unfortunately a linear scan through sAttributes, but we
44672 // only do it for things which _might_ be disabled, which should
44673 // help keep the performance problems down.
44674 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable16, sAttributes)) {
44675 JS::Rooted<JS::Value> temp(cx);
44676 if (!get_prefable16(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44677 return false;
44678 }
44679 if (!JS_DefineProperty(cx, result, "prefable16", temp, JSPROP_ENUMERATE)) {
44680 return false;
44681 }
44682 }
44683 // This is unfortunately a linear scan through sAttributes, but we
44684 // only do it for things which _might_ be disabled, which should
44685 // help keep the performance problems down.
44686 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext1, sAttributes)) {
44687 JS::Rooted<JS::Value> temp(cx);
44688 if (!get_conditionalOnSecureContext1(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44689 return false;
44690 }
44691 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext1", temp, JSPROP_ENUMERATE)) {
44692 return false;
44693 }
44694 }
44695 // This is unfortunately a linear scan through sAttributes, but we
44696 // only do it for things which _might_ be disabled, which should
44697 // help keep the performance problems down.
44698 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext2, sAttributes)) {
44699 JS::Rooted<JS::Value> temp(cx);
44700 if (!get_conditionalOnSecureContext2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44701 return false;
44702 }
44703 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext2", temp, JSPROP_ENUMERATE)) {
44704 return false;
44705 }
44706 }
44707 // This is unfortunately a linear scan through sAttributes, but we
44708 // only do it for things which _might_ be disabled, which should
44709 // help keep the performance problems down.
44710 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext3, sAttributes)) {
44711 JS::Rooted<JS::Value> temp(cx);
44712 if (!get_conditionalOnSecureContext3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44713 return false;
44714 }
44715 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext3", temp, JSPROP_ENUMERATE)) {
44716 return false;
44717 }
44718 }
44719 // This is unfortunately a linear scan through sAttributes, but we
44720 // only do it for things which _might_ be disabled, which should
44721 // help keep the performance problems down.
44722 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext4, sAttributes)) {
44723 JS::Rooted<JS::Value> temp(cx);
44724 if (!get_conditionalOnSecureContext4(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44725 return false;
44726 }
44727 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext4", temp, JSPROP_ENUMERATE)) {
44728 return false;
44729 }
44730 }
44731 { // scope for "temp"
44732 JS::Rooted<JS::Value> temp(cx);
44733 if (!get_attrWithLenientThis(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44734 return false;
44735 }
44736 if (!JS_DefineProperty(cx, result, "attrWithLenientThis", temp, JSPROP_ENUMERATE)) {
44737 return false;
44738 }
44739 }
44740 { // scope for "temp"
44741 JS::Rooted<JS::Value> temp(cx);
44742 if (!get_putForwardsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44743 return false;
44744 }
44745 if (!JS_DefineProperty(cx, result, "putForwardsAttr", temp, JSPROP_ENUMERATE)) {
44746 return false;
44747 }
44748 }
44749 { // scope for "temp"
44750 JS::Rooted<JS::Value> temp(cx);
44751 if (!get_putForwardsAttr2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44752 return false;
44753 }
44754 if (!JS_DefineProperty(cx, result, "putForwardsAttr2", temp, JSPROP_ENUMERATE)) {
44755 return false;
44756 }
44757 }
44758 { // scope for "temp"
44759 JS::Rooted<JS::Value> temp(cx);
44760 if (!get_putForwardsAttr3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44761 return false;
44762 }
44763 if (!JS_DefineProperty(cx, result, "putForwardsAttr3", temp, JSPROP_ENUMERATE)) {
44764 return false;
44765 }
44766 }
44767 { // scope for "temp"
44768 JS::Rooted<JS::Value> temp(cx);
44769 if (!get_throwingAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44770 return false;
44771 }
44772 if (!JS_DefineProperty(cx, result, "throwingAttr", temp, JSPROP_ENUMERATE)) {
44773 return false;
44774 }
44775 }
44776 { // scope for "temp"
44777 JS::Rooted<JS::Value> temp(cx);
44778 if (!get_throwingGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44779 return false;
44780 }
44781 if (!JS_DefineProperty(cx, result, "throwingGetterAttr", temp, JSPROP_ENUMERATE)) {
44782 return false;
44783 }
44784 }
44785 { // scope for "temp"
44786 JS::Rooted<JS::Value> temp(cx);
44787 if (!get_throwingSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44788 return false;
44789 }
44790 if (!JS_DefineProperty(cx, result, "throwingSetterAttr", temp, JSPROP_ENUMERATE)) {
44791 return false;
44792 }
44793 }
44794 { // scope for "temp"
44795 JS::Rooted<JS::Value> temp(cx);
44796 if (!get_canOOMAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44797 return false;
44798 }
44799 if (!JS_DefineProperty(cx, result, "canOOMAttr", temp, JSPROP_ENUMERATE)) {
44800 return false;
44801 }
44802 }
44803 { // scope for "temp"
44804 JS::Rooted<JS::Value> temp(cx);
44805 if (!get_canOOMGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44806 return false;
44807 }
44808 if (!JS_DefineProperty(cx, result, "canOOMGetterAttr", temp, JSPROP_ENUMERATE)) {
44809 return false;
44810 }
44811 }
44812 { // scope for "temp"
44813 JS::Rooted<JS::Value> temp(cx);
44814 if (!get_canOOMSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44815 return false;
44816 }
44817 if (!JS_DefineProperty(cx, result, "canOOMSetterAttr", temp, JSPROP_ENUMERATE)) {
44818 return false;
44819 }
44820 }
44821 { // scope for "temp"
44822 JS::Rooted<JS::Value> temp(cx);
44823 if (!get_ceReactionsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44824 return false;
44825 }
44826 if (!JS_DefineProperty(cx, result, "ceReactionsAttr", temp, JSPROP_ENUMERATE)) {
44827 return false;
44828 }
44829 }
44830 { // scope for "temp"
44831 JS::Rooted<JS::Value> temp(cx);
44832 if (!get_dashed_attribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44833 return false;
44834 }
44835 if (!JS_DefineProperty(cx, result, "dashed_attribute", temp, JSPROP_ENUMERATE)) {
44836 return false;
44837 }
44838 }
44839 { // scope for "temp"
44840 JS::Rooted<JS::Value> temp(cx);
44841 if (!get_nonEnumerableAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44842 return false;
44843 }
44844 if (!JS_DefineProperty(cx, result, "nonEnumerableAttr", temp, JSPROP_ENUMERATE)) {
44845 return false;
44846 }
44847 }
44848 return true;
44849}
44850
44851bool sNativePropertiesInited = false;
44852const NativePropertyHooks sNativePropertyHooks = {
44853 nullptr,
44854 { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast(), &sNativePropertiesInited },
44855 prototypes::id::TestJSImplInterface,
44856 constructors::id::TestJSImplInterface,
44857 &DefaultXrayExpandoObjectClass
44858};
44859
44860static bool
44861_constructor(JSContext* cx_, unsigned argc, JS::Value* vp)
44862{
44863 BindingCallContext cx(cx_, "TestJSImplInterface constructor");
44864 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject44866( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
44865 "TestJSImplInterface", "constructor", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject44866( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
44866 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject44866( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
44867
44868 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
44869 JS::Rooted<JSObject*> obj(cx, &args.callee());
44870 if (!args.isConstructing()) {
44871 return ThrowConstructorWithoutNew(cx, "TestJSImplInterface");
44872 }
44873
44874 JS::Rooted<JSObject*> desiredProto(cx);
44875 if (!GetDesiredProto(cx, args,
44876 prototypes::id::TestJSImplInterface,
44877 CreateInterfaceObjects,
44878 &desiredProto)) {
44879 return false;
44880 }
44881
44882 if (!args.requireAtLeast(cx, "TestJSImplInterface constructor", 15)) {
44883 return false;
44884 }
44885 GlobalObject global(cx, obj);
44886 if (global.Failed()) {
44887 return false;
44888 }
44889
44890 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
44891 binding_detail::FakeString<char16_t> arg0;
44892 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
44893 return false;
44894 }
44895 uint32_t arg1;
44896 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
44897 return false;
44898 }
44899 Nullable<bool> arg2;
44900 if (args[2].isNullOrUndefined()) {
44901 arg2.SetNull();
44902 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
44903 return false;
44904 }
44905 mozilla::dom::TestInterface* arg3;
44906 if (args[3].isObject()) {
44907 {
44908 // Our JSContext should be in the right global to do unwrapping in.
44909 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[3], arg3, cx);
44910 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
44911 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 4", "TestInterface");
44912 return false;
44913 }
44914 }
44915 } else if (args[3].isNullOrUndefined()) {
44916 arg3 = nullptr;
44917 } else {
44918 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 4");
44919 return false;
44920 }
44921 int32_t arg4;
44922 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], "Argument 5", &arg4)) {
44923 return false;
44924 }
44925 RootedDictionary<binding_detail::FastDictForConstructor> arg5(cx);
44926 if (!arg5.Init(cx, args[5], "Argument 6", true)) {
44927 return false;
44928 }
44929 JS::Rooted<JS::Value> arg6(cx);
44930#ifdef __clang__1
44931#pragma clang diagnostic push
44932#pragma clang diagnostic ignored "-Wunreachable-code"
44933#pragma clang diagnostic ignored "-Wunreachable-code-return"
44934#endif // __clang__
44935 if ((true) && !CallerSubsumes(args[6])) {
44936 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 7");
44937 return false;
44938 }
44939#ifdef __clang__1
44940#pragma clang diagnostic pop
44941#endif // __clang__
44942 arg6 = args[6];
44943 JS::Rooted<JSObject*> arg7(cx);
44944 if (args[7].isObject()) {
44945#ifdef __clang__1
44946#pragma clang diagnostic push
44947#pragma clang diagnostic ignored "-Wunreachable-code"
44948#pragma clang diagnostic ignored "-Wunreachable-code-return"
44949#endif // __clang__
44950 if ((true) && !CallerSubsumes(args[7])) {
44951 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 8");
44952 return false;
44953 }
44954#ifdef __clang__1
44955#pragma clang diagnostic pop
44956#endif // __clang__
44957 arg7 = &args[7].toObject();
44958 } else {
44959 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 8");
44960 return false;
44961 }
44962 JS::Rooted<JSObject*> arg8(cx);
44963 if (args[8].isObject()) {
44964#ifdef __clang__1
44965#pragma clang diagnostic push
44966#pragma clang diagnostic ignored "-Wunreachable-code"
44967#pragma clang diagnostic ignored "-Wunreachable-code-return"
44968#endif // __clang__
44969 if ((true) && !CallerSubsumes(args[8])) {
44970 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 9");
44971 return false;
44972 }
44973#ifdef __clang__1
44974#pragma clang diagnostic pop
44975#endif // __clang__
44976 arg8 = &args[8].toObject();
44977 } else if (args[8].isNullOrUndefined()) {
44978 arg8 = nullptr;
44979 } else {
44980 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 9");
44981 return false;
44982 }
44983 binding_detail::AutoSequence<Dict> arg9;
44984 SequenceRooter<Dict> arg9_holder(cx, &arg9);
44985 if (args[9].isObject()) {
44986 JS::ForOfIterator iter(cx);
44987 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
44988 return false;
44989 }
44990 if (!iter.valueIsIterable()) {
44991 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
44992 return false;
44993 }
44994 binding_detail::AutoSequence<Dict> &arr = arg9;
44995 JS::Rooted<JS::Value> temp(cx);
44996 while (true) {
44997 bool done;
44998 if (!iter.next(&temp, &done)) {
44999 return false;
45000 }
45001 if (done) {
45002 break;
45003 }
45004 Dict* slotPtr = arr.AppendElement(mozilla::fallible);
45005 if (!slotPtr) {
45006 JS_ReportOutOfMemory(cx);
45007 return false;
45008 }
45009 Dict& slot = *slotPtr;
45010 if (!slot.Init(cx, temp, "Element of argument 10", true)) {
45011 return false;
45012 }
45013 }
45014 } else {
45015 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
45016 return false;
45017 }
45018 JS::Rooted<JS::Value> arg10(cx);
45019 if (args.hasDefined(10)) {
45020#ifdef __clang__1
45021#pragma clang diagnostic push
45022#pragma clang diagnostic ignored "-Wunreachable-code"
45023#pragma clang diagnostic ignored "-Wunreachable-code-return"
45024#endif // __clang__
45025 if ((true) && !CallerSubsumes(args[10])) {
45026 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 11");
45027 return false;
45028 }
45029#ifdef __clang__1
45030#pragma clang diagnostic pop
45031#endif // __clang__
45032 arg10 = args[10];
45033 } else {
45034 arg10 = JS::UndefinedValue();
45035 }
45036 Optional<JS::Handle<JSObject*>> arg11;
45037 if (args.hasDefined(11)) {
45038 arg11.Construct(cx);
45039 if (args[11].isObject()) {
45040#ifdef __clang__1
45041#pragma clang diagnostic push
45042#pragma clang diagnostic ignored "-Wunreachable-code"
45043#pragma clang diagnostic ignored "-Wunreachable-code-return"
45044#endif // __clang__
45045 if ((true) && !CallerSubsumes(args[11])) {
45046 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 12");
45047 return false;
45048 }
45049#ifdef __clang__1
45050#pragma clang diagnostic pop
45051#endif // __clang__
45052 arg11.Value() = &args[11].toObject();
45053 } else {
45054 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 12");
45055 return false;
45056 }
45057 }
45058 Optional<JS::Handle<JSObject*>> arg12;
45059 if (args.hasDefined(12)) {
45060 arg12.Construct(cx);
45061 if (args[12].isObject()) {
45062#ifdef __clang__1
45063#pragma clang diagnostic push
45064#pragma clang diagnostic ignored "-Wunreachable-code"
45065#pragma clang diagnostic ignored "-Wunreachable-code-return"
45066#endif // __clang__
45067 if ((true) && !CallerSubsumes(args[12])) {
45068 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 13");
45069 return false;
45070 }
45071#ifdef __clang__1
45072#pragma clang diagnostic pop
45073#endif // __clang__
45074 arg12.Value() = &args[12].toObject();
45075 } else if (args[12].isNullOrUndefined()) {
45076 arg12.Value() = nullptr;
45077 } else {
45078 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 13");
45079 return false;
45080 }
45081 }
45082 RootedSpiderMonkeyInterface<Uint8Array> arg13(cx);
45083 if (args[13].isObject()) {
45084 if (!arg13.Init(&args[13].toObject())) {
45085 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 14", "Uint8Array");
45086 return false;
45087 }
45088 if (JS::IsArrayBufferViewShared(arg13.Obj())) {
45089 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 14");
45090 return false;
45091 }
45092 if (JS::IsLargeArrayBufferView(arg13.Obj())) {
45093 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 14");
45094 return false;
45095 }
45096 if (JS::IsResizableArrayBufferView(arg13.Obj())) {
45097 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 14");
45098 return false;
45099 }
45100 if (JS::IsImmutableArrayBufferView(arg13.Obj())) {
45101 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 14");
45102 return false;
45103 }
45104 } else {
45105 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 14");
45106 return false;
45107 }
45108 RootedSpiderMonkeyInterface<ArrayBuffer> arg14(cx);
45109 if (args[14].isObject()) {
45110 if (!arg14.Init(&args[14].toObject())) {
45111 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 15", "ArrayBuffer");
45112 return false;
45113 }
45114 if (JS::IsSharedArrayBufferObject(arg14.Obj())) {
45115 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 15");
45116 return false;
45117 }
45118 if (JS::IsLargeArrayBufferMaybeShared(arg14.Obj())) {
45119 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 15");
45120 return false;
45121 }
45122 if (JS::IsResizableArrayBufferMaybeShared(arg14.Obj())) {
45123 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 15");
45124 return false;
45125 }
45126 if (JS::IsImmutableArrayBufferMaybeShared(arg14.Obj())) {
45127 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Argument 15");
45128 return false;
45129 }
45130 } else {
45131 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 15");
45132 return false;
45133 }
45134 Maybe<JSAutoRealm> ar;
45135 if (objIsXray) {
45136 // Since our object is an Xray, we can just CheckedUnwrapStatic:
45137 // we know Xrays have no dynamic unwrap behavior.
45138 obj = js::CheckedUnwrapStatic(obj);
45139 if (!obj) {
45140 return false;
45141 }
45142 ar.emplace(cx, obj);
45143 if (!JS_WrapObject(cx, &desiredProto)) {
45144 return false;
45145 }
45146 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mAny1))) {
45147 return false;
45148 }
45149 if (arg5.mDict.WasPassed()) {
45150 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mAnotherAny))) {
45151 return false;
45152 }
45153 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mAnotherObj))) {
45154 return false;
45155 }
45156 if (arg5.mDict.Value().mArrayBuffer.WasPassed()) {
45157 if (!arg5.mDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45158 return false;
45159 }
45160 }
45161 if (arg5.mDict.Value().mCustomEventInit.WasPassed()) {
45162 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mCustomEventInit.Value().mDetail))) {
45163 return false;
45164 }
45165 }
45166 if (arg5.mDict.Value().mDictionaryTypedef.WasPassed()) {
45167 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mDictionaryTypedef.Value().mDetail))) {
45168 return false;
45169 }
45170 }
45171 if (arg5.mDict.Value().mEventInitOrLong2.WasPassed()) {
45172 if (arg5.mDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) {
45173 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45174 return false;
45175 }
45176 }
45177 }
45178 if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45179 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45180 return false;
45181 }
45182 }
45183 if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45184 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45185 return false;
45186 }
45187 }
45188 if (!arg5.mDict.Value().mFloat64Array.IsNull()) {
45189 if (!arg5.mDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45190 return false;
45191 }
45192 }
45193 if (arg5.mDict.Value().mNullableArrayBuffer.WasPassed()) {
45194 if (!arg5.mDict.Value().mNullableArrayBuffer.Value().IsNull()) {
45195 if (!arg5.mDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45196 return false;
45197 }
45198 }
45199 }
45200 if (arg5.mDict.Value().mNullableEventInitOrLong2.WasPassed()) {
45201 if (!arg5.mDict.Value().mNullableEventInitOrLong2.Value().IsNull()) {
45202 if (arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45203 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45204 return false;
45205 }
45206 }
45207 }
45208 }
45209 if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45210 if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45211 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45212 return false;
45213 }
45214 }
45215 }
45216 if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45217 if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45218 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45219 return false;
45220 }
45221 }
45222 }
45223 if (arg5.mDict.Value().mNullableObjectSequenceOrLong.WasPassed()) {
45224 if (!arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) {
45225 if (arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45226 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) {
45227 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) {
45228 return false;
45229 }
45230 }
45231 }
45232 }
45233 }
45234 if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45235 if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45236 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) {
45237 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) {
45238 return false;
45239 }
45240 }
45241 }
45242 }
45243 if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45244 if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45245 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) {
45246 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) {
45247 return false;
45248 }
45249 }
45250 }
45251 }
45252 if (arg5.mDict.Value().mObjectOrLong.WasPassed()) {
45253 if (arg5.mDict.Value().mObjectOrLong.Value().IsObject()) {
45254 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectOrLong.Value().GetAsObject()))) {
45255 return false;
45256 }
45257 }
45258 }
45259 if (arg5.mDict.Value().mObjectSequenceOrLong.WasPassed()) {
45260 if (arg5.mDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) {
45261 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) {
45262 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) {
45263 return false;
45264 }
45265 }
45266 }
45267 }
45268 if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45269 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) {
45270 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) {
45271 return false;
45272 }
45273 }
45274 }
45275 if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45276 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) {
45277 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) {
45278 return false;
45279 }
45280 }
45281 }
45282 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mRequiredObject))) {
45283 return false;
45284 }
45285 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mSomeAny))) {
45286 return false;
45287 }
45288 if (arg5.mDict.Value().mSomeObj.WasPassed()) {
45289 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mSomeObj.Value()))) {
45290 return false;
45291 }
45292 }
45293 if (arg5.mDict.Value().mUint8Array.WasPassed()) {
45294 if (!arg5.mDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45295 return false;
45296 }
45297 }
45298 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mParentAny))) {
45299 return false;
45300 }
45301 }
45302 if (arg5.mDict2.WasPassed()) {
45303 if (arg5.mDict2.Value().mMemberDict.WasPassed()) {
45304 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherAny))) {
45305 return false;
45306 }
45307 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherObj))) {
45308 return false;
45309 }
45310 if (arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.WasPassed()) {
45311 if (!arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45312 return false;
45313 }
45314 }
45315 if (arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.WasPassed()) {
45316 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.Value().mDetail))) {
45317 return false;
45318 }
45319 }
45320 if (arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.WasPassed()) {
45321 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.Value().mDetail))) {
45322 return false;
45323 }
45324 }
45325 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.WasPassed()) {
45326 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) {
45327 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45328 return false;
45329 }
45330 }
45331 }
45332 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45333 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45334 return false;
45335 }
45336 }
45337 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45338 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45339 return false;
45340 }
45341 }
45342 if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.IsNull()) {
45343 if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45344 return false;
45345 }
45346 }
45347 if (arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.WasPassed()) {
45348 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().IsNull()) {
45349 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45350 return false;
45351 }
45352 }
45353 }
45354 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.WasPassed()) {
45355 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().IsNull()) {
45356 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45357 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45358 return false;
45359 }
45360 }
45361 }
45362 }
45363 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45364 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45365 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45366 return false;
45367 }
45368 }
45369 }
45370 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45371 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45372 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45373 return false;
45374 }
45375 }
45376 }
45377 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.WasPassed()) {
45378 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) {
45379 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45380 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) {
45381 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) {
45382 return false;
45383 }
45384 }
45385 }
45386 }
45387 }
45388 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45389 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45390 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) {
45391 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) {
45392 return false;
45393 }
45394 }
45395 }
45396 }
45397 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45398 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45399 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) {
45400 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) {
45401 return false;
45402 }
45403 }
45404 }
45405 }
45406 if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.WasPassed()) {
45407 if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().IsObject()) {
45408 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().GetAsObject()))) {
45409 return false;
45410 }
45411 }
45412 }
45413 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.WasPassed()) {
45414 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) {
45415 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) {
45416 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) {
45417 return false;
45418 }
45419 }
45420 }
45421 }
45422 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45423 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) {
45424 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) {
45425 return false;
45426 }
45427 }
45428 }
45429 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45430 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) {
45431 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) {
45432 return false;
45433 }
45434 }
45435 }
45436 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mRequiredObject))) {
45437 return false;
45438 }
45439 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeAny))) {
45440 return false;
45441 }
45442 if (arg5.mDict2.Value().mMemberDict.Value().mSomeObj.WasPassed()) {
45443 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeObj.Value()))) {
45444 return false;
45445 }
45446 }
45447 if (arg5.mDict2.Value().mMemberDict.Value().mUint8Array.WasPassed()) {
45448 if (!arg5.mDict2.Value().mMemberDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45449 return false;
45450 }
45451 }
45452 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mParentAny))) {
45453 return false;
45454 }
45455 }
45456 }
45457 if (arg5.mObj1.WasPassed()) {
45458 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj1.Value()))) {
45459 return false;
45460 }
45461 }
45462 if (arg5.mObj2.WasPassed()) {
45463 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj2.Value()))) {
45464 return false;
45465 }
45466 }
45467 if (arg5.mSeq1.WasPassed()) {
45468 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq1.Value().Length(); ++indexName0) {
45469 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherAny))) {
45470 return false;
45471 }
45472 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherObj))) {
45473 return false;
45474 }
45475 if (arg5.mSeq1.Value()[indexName0].mArrayBuffer.WasPassed()) {
45476 if (!arg5.mSeq1.Value()[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45477 return false;
45478 }
45479 }
45480 if (arg5.mSeq1.Value()[indexName0].mCustomEventInit.WasPassed()) {
45481 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mCustomEventInit.Value().mDetail))) {
45482 return false;
45483 }
45484 }
45485 if (arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.WasPassed()) {
45486 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.Value().mDetail))) {
45487 return false;
45488 }
45489 }
45490 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.WasPassed()) {
45491 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) {
45492 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45493 return false;
45494 }
45495 }
45496 }
45497 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45498 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45499 return false;
45500 }
45501 }
45502 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45503 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45504 return false;
45505 }
45506 }
45507 if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.IsNull()) {
45508 if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45509 return false;
45510 }
45511 }
45512 if (arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.WasPassed()) {
45513 if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().IsNull()) {
45514 if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45515 return false;
45516 }
45517 }
45518 }
45519 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.WasPassed()) {
45520 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().IsNull()) {
45521 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45522 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45523 return false;
45524 }
45525 }
45526 }
45527 }
45528 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45529 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45530 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45531 return false;
45532 }
45533 }
45534 }
45535 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45536 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45537 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45538 return false;
45539 }
45540 }
45541 }
45542 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.WasPassed()) {
45543 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) {
45544 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45545 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) {
45546 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) {
45547 return false;
45548 }
45549 }
45550 }
45551 }
45552 }
45553 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45554 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45555 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) {
45556 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) {
45557 return false;
45558 }
45559 }
45560 }
45561 }
45562 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45563 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45564 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) {
45565 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) {
45566 return false;
45567 }
45568 }
45569 }
45570 }
45571 if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.WasPassed()) {
45572 if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().IsObject()) {
45573 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().GetAsObject()))) {
45574 return false;
45575 }
45576 }
45577 }
45578 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.WasPassed()) {
45579 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45580 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) {
45581 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) {
45582 return false;
45583 }
45584 }
45585 }
45586 }
45587 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45588 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) {
45589 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) {
45590 return false;
45591 }
45592 }
45593 }
45594 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45595 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) {
45596 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) {
45597 return false;
45598 }
45599 }
45600 }
45601 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mRequiredObject))) {
45602 return false;
45603 }
45604 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeAny))) {
45605 return false;
45606 }
45607 if (arg5.mSeq1.Value()[indexName0].mSomeObj.WasPassed()) {
45608 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeObj.Value()))) {
45609 return false;
45610 }
45611 }
45612 if (arg5.mSeq1.Value()[indexName0].mUint8Array.WasPassed()) {
45613 if (!arg5.mSeq1.Value()[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45614 return false;
45615 }
45616 }
45617 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mParentAny))) {
45618 return false;
45619 }
45620 }
45621 }
45622 if (arg5.mSeq2.WasPassed()) {
45623 if (!arg5.mSeq2.Value().IsNull()) {
45624 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq2.Value().Value().Length(); ++indexName0) {
45625 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq2.Value().Value()[indexName0].Length(); ++indexName1) {
45626 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherAny))) {
45627 return false;
45628 }
45629 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherObj))) {
45630 return false;
45631 }
45632 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.WasPassed()) {
45633 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45634 return false;
45635 }
45636 }
45637 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.WasPassed()) {
45638 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.Value().mDetail))) {
45639 return false;
45640 }
45641 }
45642 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.WasPassed()) {
45643 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.Value().mDetail))) {
45644 return false;
45645 }
45646 }
45647 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.WasPassed()) {
45648 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) {
45649 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45650 return false;
45651 }
45652 }
45653 }
45654 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45655 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45656 return false;
45657 }
45658 }
45659 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45660 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45661 return false;
45662 }
45663 }
45664 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.IsNull()) {
45665 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45666 return false;
45667 }
45668 }
45669 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.WasPassed()) {
45670 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().IsNull()) {
45671 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45672 return false;
45673 }
45674 }
45675 }
45676 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.WasPassed()) {
45677 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().IsNull()) {
45678 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45679 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45680 return false;
45681 }
45682 }
45683 }
45684 }
45685 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45686 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45687 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45688 return false;
45689 }
45690 }
45691 }
45692 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45693 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45694 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45695 return false;
45696 }
45697 }
45698 }
45699 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.WasPassed()) {
45700 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) {
45701 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45702 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) {
45703 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) {
45704 return false;
45705 }
45706 }
45707 }
45708 }
45709 }
45710 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45711 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45712 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) {
45713 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) {
45714 return false;
45715 }
45716 }
45717 }
45718 }
45719 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45720 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45721 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) {
45722 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) {
45723 return false;
45724 }
45725 }
45726 }
45727 }
45728 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.WasPassed()) {
45729 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().IsObject()) {
45730 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().GetAsObject()))) {
45731 return false;
45732 }
45733 }
45734 }
45735 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.WasPassed()) {
45736 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45737 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) {
45738 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) {
45739 return false;
45740 }
45741 }
45742 }
45743 }
45744 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45745 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) {
45746 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) {
45747 return false;
45748 }
45749 }
45750 }
45751 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45752 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) {
45753 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) {
45754 return false;
45755 }
45756 }
45757 }
45758 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mRequiredObject))) {
45759 return false;
45760 }
45761 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeAny))) {
45762 return false;
45763 }
45764 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.WasPassed()) {
45765 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.Value()))) {
45766 return false;
45767 }
45768 }
45769 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.WasPassed()) {
45770 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45771 return false;
45772 }
45773 }
45774 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mParentAny))) {
45775 return false;
45776 }
45777 }
45778 }
45779 }
45780 }
45781 if (arg5.mSeq3.WasPassed()) {
45782 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq3.Value().Length(); ++indexName0) {
45783 if (!arg5.mSeq3.Value()[indexName0].IsNull()) {
45784 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq3.Value()[indexName0].Value().Length(); ++indexName1) {
45785 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherAny))) {
45786 return false;
45787 }
45788 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherObj))) {
45789 return false;
45790 }
45791 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.WasPassed()) {
45792 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45793 return false;
45794 }
45795 }
45796 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.WasPassed()) {
45797 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.Value().mDetail))) {
45798 return false;
45799 }
45800 }
45801 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.WasPassed()) {
45802 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.Value().mDetail))) {
45803 return false;
45804 }
45805 }
45806 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.WasPassed()) {
45807 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) {
45808 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45809 return false;
45810 }
45811 }
45812 }
45813 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45814 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45815 return false;
45816 }
45817 }
45818 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45819 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45820 return false;
45821 }
45822 }
45823 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.IsNull()) {
45824 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45825 return false;
45826 }
45827 }
45828 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.WasPassed()) {
45829 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().IsNull()) {
45830 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45831 return false;
45832 }
45833 }
45834 }
45835 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.WasPassed()) {
45836 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().IsNull()) {
45837 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45838 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45839 return false;
45840 }
45841 }
45842 }
45843 }
45844 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45845 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45846 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45847 return false;
45848 }
45849 }
45850 }
45851 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45852 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45853 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45854 return false;
45855 }
45856 }
45857 }
45858 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.WasPassed()) {
45859 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) {
45860 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45861 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) {
45862 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) {
45863 return false;
45864 }
45865 }
45866 }
45867 }
45868 }
45869 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45870 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45871 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) {
45872 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) {
45873 return false;
45874 }
45875 }
45876 }
45877 }
45878 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45879 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45880 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) {
45881 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) {
45882 return false;
45883 }
45884 }
45885 }
45886 }
45887 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.WasPassed()) {
45888 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().IsObject()) {
45889 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().GetAsObject()))) {
45890 return false;
45891 }
45892 }
45893 }
45894 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.WasPassed()) {
45895 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45896 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) {
45897 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) {
45898 return false;
45899 }
45900 }
45901 }
45902 }
45903 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45904 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) {
45905 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) {
45906 return false;
45907 }
45908 }
45909 }
45910 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45911 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) {
45912 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) {
45913 return false;
45914 }
45915 }
45916 }
45917 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mRequiredObject))) {
45918 return false;
45919 }
45920 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeAny))) {
45921 return false;
45922 }
45923 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.WasPassed()) {
45924 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.Value()))) {
45925 return false;
45926 }
45927 }
45928 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.WasPassed()) {
45929 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45930 return false;
45931 }
45932 }
45933 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mParentAny))) {
45934 return false;
45935 }
45936 }
45937 }
45938 }
45939 }
45940 if (arg5.mSeq4.WasPassed()) {
45941 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq4.Value().Length(); ++indexName0) {
45942 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq4.Value()[indexName0]))) {
45943 return false;
45944 }
45945 }
45946 }
45947 if (arg5.mSeq5.WasPassed()) {
45948 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq5.Value().Length(); ++indexName0) {
45949 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq5.Value()[indexName0]))) {
45950 return false;
45951 }
45952 }
45953 }
45954 if (arg5.mSeq6.WasPassed()) {
45955 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq6.Value().Length(); ++indexName0) {
45956 if (arg5.mSeq6.Value()[indexName0].mOurSequence3.WasPassed()) {
45957 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence3.Value().Length(); ++indexName1) {
45958 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence3.Value()[indexName1]))) {
45959 return false;
45960 }
45961 }
45962 }
45963 if (arg5.mSeq6.Value()[indexName0].mOurSequence4.WasPassed()) {
45964 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence4.Value().Length(); ++indexName1) {
45965 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence4.Value()[indexName1]))) {
45966 return false;
45967 }
45968 }
45969 }
45970 if (arg5.mSeq6.Value()[indexName0].mOurSequence5.WasPassed()) {
45971 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence5.Value().Length(); ++indexName1) {
45972 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence5.Value()[indexName1]))) {
45973 return false;
45974 }
45975 }
45976 }
45977 if (arg5.mSeq6.Value()[indexName0].mOurSequence6.WasPassed()) {
45978 if (!arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().IsNull()) {
45979 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value().Length(); ++indexName1) {
45980 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value()[indexName1]))) {
45981 return false;
45982 }
45983 }
45984 }
45985 }
45986 if (arg5.mSeq6.Value()[indexName0].mOurSequence7.WasPassed()) {
45987 if (!arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().IsNull()) {
45988 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value().Length(); ++indexName1) {
45989 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value()[indexName1]))) {
45990 return false;
45991 }
45992 }
45993 }
45994 }
45995 if (!arg5.mSeq6.Value()[indexName0].mOurSequence8.IsNull()) {
45996 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence8.Value().Length(); ++indexName1) {
45997 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence8.Value()[indexName1]))) {
45998 return false;
45999 }
46000 }
46001 }
46002 if (!arg5.mSeq6.Value()[indexName0].mOurSequence9.IsNull()) {
46003 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence9.Value().Length(); ++indexName1) {
46004 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence9.Value()[indexName1]))) {
46005 return false;
46006 }
46007 }
46008 }
46009 }
46010 }
46011 if (!JS_WrapValue(cx, &arg6)) {
46012 return false;
46013 }
46014 if (!JS_WrapObject(cx, &arg7)) {
46015 return false;
46016 }
46017 if (!JS_WrapObject(cx, &arg8)) {
46018 return false;
46019 }
46020 for (uint32_t indexName0 = 0; indexName0 < arg9.Length(); ++indexName0) {
46021 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mAnotherAny))) {
46022 return false;
46023 }
46024 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mAnotherObj))) {
46025 return false;
46026 }
46027 if (arg9[indexName0].mArrayBuffer.WasPassed()) {
46028 if (!arg9[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
46029 return false;
46030 }
46031 }
46032 if (arg9[indexName0].mCustomEventInit.WasPassed()) {
46033 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mCustomEventInit.Value().mDetail))) {
46034 return false;
46035 }
46036 }
46037 if (arg9[indexName0].mDictionaryTypedef.WasPassed()) {
46038 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mDictionaryTypedef.Value().mDetail))) {
46039 return false;
46040 }
46041 }
46042 if (arg9[indexName0].mEventInitOrLong2.WasPassed()) {
46043 if (arg9[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) {
46044 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
46045 return false;
46046 }
46047 }
46048 }
46049 if (arg9[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
46050 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
46051 return false;
46052 }
46053 }
46054 if (arg9[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
46055 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
46056 return false;
46057 }
46058 }
46059 if (!arg9[indexName0].mFloat64Array.IsNull()) {
46060 if (!arg9[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
46061 return false;
46062 }
46063 }
46064 if (arg9[indexName0].mNullableArrayBuffer.WasPassed()) {
46065 if (!arg9[indexName0].mNullableArrayBuffer.Value().IsNull()) {
46066 if (!arg9[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
46067 return false;
46068 }
46069 }
46070 }
46071 if (arg9[indexName0].mNullableEventInitOrLong2.WasPassed()) {
46072 if (!arg9[indexName0].mNullableEventInitOrLong2.Value().IsNull()) {
46073 if (arg9[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
46074 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
46075 return false;
46076 }
46077 }
46078 }
46079 }
46080 if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
46081 if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
46082 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
46083 return false;
46084 }
46085 }
46086 }
46087 if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
46088 if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
46089 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
46090 return false;
46091 }
46092 }
46093 }
46094 if (arg9[indexName0].mNullableObjectSequenceOrLong.WasPassed()) {
46095 if (!arg9[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) {
46096 if (arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
46097 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) {
46098 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) {
46099 return false;
46100 }
46101 }
46102 }
46103 }
46104 }
46105 if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
46106 if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
46107 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) {
46108 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) {
46109 return false;
46110 }
46111 }
46112 }
46113 }
46114 if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
46115 if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
46116 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) {
46117 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) {
46118 return false;
46119 }
46120 }
46121 }
46122 }
46123 if (arg9[indexName0].mObjectOrLong.WasPassed()) {
46124 if (arg9[indexName0].mObjectOrLong.Value().IsObject()) {
46125 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectOrLong.Value().GetAsObject()))) {
46126 return false;
46127 }
46128 }
46129 }
46130 if (arg9[indexName0].mObjectSequenceOrLong.WasPassed()) {
46131 if (arg9[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) {
46132 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) {
46133 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) {
46134 return false;
46135 }
46136 }
46137 }
46138 }
46139 if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
46140 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) {
46141 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) {
46142 return false;
46143 }
46144 }
46145 }
46146 if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
46147 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) {
46148 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) {
46149 return false;
46150 }
46151 }
46152 }
46153 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mRequiredObject))) {
46154 return false;
46155 }
46156 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mSomeAny))) {
46157 return false;
46158 }
46159 if (arg9[indexName0].mSomeObj.WasPassed()) {
46160 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mSomeObj.Value()))) {
46161 return false;
46162 }
46163 }
46164 if (arg9[indexName0].mUint8Array.WasPassed()) {
46165 if (!arg9[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
46166 return false;
46167 }
46168 }
46169 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mParentAny))) {
46170 return false;
46171 }
46172 }
46173 if (!JS_WrapValue(cx, &arg10)) {
46174 return false;
46175 }
46176 if (arg11.WasPassed()) {
46177 if (!JS_WrapObject(cx, &arg11.Value())) {
46178 return false;
46179 }
46180 }
46181 if (arg12.WasPassed()) {
46182 if (!JS_WrapObject(cx, &arg12.Value())) {
46183 return false;
46184 }
46185 }
46186 if (!arg13.WrapIntoNewCompartment(cx)) {
46187 return false;
46188 }
46189 if (!arg14.WrapIntoNewCompartment(cx)) {
46190 return false;
46191 }
46192 }
46193 FastErrorResult rv;
46194 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)));
46195 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor"
)), 0))
) {
46196 return false;
46197 }
46198 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 46198); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 46198); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46199 static_assert(!std::is_pointer_v<decltype(result)>,
46200 "NewObject implies that we need to keep the object alive with a strong reference.");
46201 if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
46202 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 46202); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 46202); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46203 return false;
46204 }
46205 return true;
46206}
46207
46208static const DOMInterfaceInfo sInterfaceObjectInfo = {
46209 { _constructor, &sNativePropertyHooks },
46210 JS::GetRealmFunctionPrototypeHandle,
46211 PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth,
46212 prototypes::id::TestJSImplInterface,
46213 true,
46214 15,
46215 "TestJSImplInterface",
46216};
46217
46218static const DOMIfaceAndProtoJSClass sPrototypeClass = {
46219 {
46220 "TestJSImplInterfacePrototype",
46221 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
46222 JS_NULL_CLASS_OPS,
46223 JS_NULL_CLASS_SPEC,
46224 JS_NULL_CLASS_EXT,
46225 JS_NULL_OBJECT_OPS
46226 },
46227 eInterfacePrototype,
46228 prototypes::id::TestJSImplInterface,
46229 PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth,
46230 &sNativePropertyHooks,
46231 JS::GetRealmObjectPrototype
46232};
46233
46234static const JSClassOps sClassOps = {
46235 nullptr, /* addProperty */
46236 nullptr, /* delProperty */
46237 nullptr, /* enumerate */
46238 nullptr, /* newEnumerate */
46239 nullptr, /* resolve */
46240 nullptr, /* mayResolve */
46241 _finalize, /* finalize */
46242 nullptr, /* call */
46243 nullptr, /* construct */
46244 nullptr, /* trace */
46245};
46246
46247static const DOMJSClass sClass = {
46248 { "TestJSImplInterface",
46249 JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_PRESERVES_WRAPPER,
46250 &sClassOps,
46251 JS_NULL_CLASS_SPEC,
46252 &NativeTypeHelpers<mozilla::dom::TestJSImplInterface>::sClassExtension,
46253 JS_NULL_OBJECT_OPS
46254 },
46255 { 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 },
46256 std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplInterface>,
46257 &sNativePropertyHooks,
46258 FindAssociatedGlobalForNative<mozilla::dom::TestJSImplInterface>::Get,
46259 GetProtoObjectHandle,
46260 GetCCParticipant<mozilla::dom::TestJSImplInterface>::Get(),
46261 nullptr,
46262 NativeTypeHelpers<mozilla::dom::TestJSImplInterface>::GetWrapperCache
46263};
46264static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1,
46265 "Must have the right minimal number of reserved slots.");
46266static_assert(1 >= 1,
46267 "Must have enough reserved slots.");
46268
46269bool
46270Wrap(JSContext* aCx, mozilla::dom::TestJSImplInterface* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
46271{
46272 static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplInterface>,
46273 "Shouldn't have wrappercached things that are not refcounted.");
46274 static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplInterface*>);
46275 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"
, 46275); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)"
")"); do { MOZ_CrashSequence(__null, 46275); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46276 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"
, 46276); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)"
")"); do { MOZ_CrashSequence(__null, 46276); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
46277 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"
, 46279); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
46278 "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"
, 46279); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
46279 "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"
, 46279); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46280
46281 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"
, 46282); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { MOZ_CrashSequence(__null, 46282); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46282 "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"
, 46282); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { MOZ_CrashSequence(__null, 46282); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46283
46284 // If the wrapper cache contains a dead reflector then finalize that
46285 // now, ensuring that the finalizer for the old reflector always
46286 // runs before the new reflector is created and attached. This
46287 // avoids the awkward situation where there are multiple reflector
46288 // objects that contain pointers to the same native.
46289
46290 if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) {
46291 _finalize(nullptr /* unused */, oldReflector);
46292 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"
, 46292); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()"
")"); do { MOZ_CrashSequence(__null, 46292); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46293 }
46294
46295 JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
46296 if (!global) {
46297 return false;
46298 }
46299 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", 46299); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { MOZ_CrashSequence
(__null, 46299); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46300 JS::AssertObjectIsNotGray(global);
46301
46302 // That might have ended up wrapping us already, due to the wonders
46303 // of XBL. Check for that, and bail out as needed.
46304 aReflector.set(aCache->GetWrapper());
46305 if (aReflector) {
46306#ifdef DEBUG1
46307 AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
46308#endif // DEBUG
46309 return true;
46310 }
46311
46312 JSAutoRealm ar(aCx, global);
46313 JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
46314 if (!canonicalProto) {
46315 return false;
46316 }
46317 JS::Rooted<JSObject*> proto(aCx);
46318 if (aGivenProto) {
46319 proto = aGivenProto;
46320 // Unfortunately, while aGivenProto was in the compartment of aCx
46321 // coming in, we changed compartments to that of "parent" so may need
46322 // to wrap the proto here.
46323 if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) {
46324 if (!JS_WrapObject(aCx, &proto)) {
46325 return false;
46326 }
46327 }
46328 } else {
46329 proto = canonicalProto;
46330 }
46331
46332 BindingJSObjectCreator<mozilla::dom::TestJSImplInterface> creator(aCx);
46333 creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
46334 if (!aReflector) {
46335 return false;
46336 }
46337
46338 aCache->SetWrapper(aReflector);
46339 creator.InitializationSucceeded();
46340
46341 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", 46342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { MOZ_CrashSequence(__null, 46342); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46342 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", 46342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { MOZ_CrashSequence(__null, 46342); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46343 // If proto != canonicalProto, we have to preserve our wrapper;
46344 // otherwise we won't be able to properly recreate it later, since
46345 // we won't know what proto to use. Note that we don't check
46346 // aGivenProto here, since it's entirely possible (and even
46347 // somewhat common) to have a non-null aGivenProto which is the
46348 // same as canonicalProto.
46349 if (proto != canonicalProto) {
46350 PreserveWrapper(aObject);
46351 }
46352
46353 return true;
46354}
46355
46356void
46357CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
46358{
46359 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplInterface);
46360 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestJSImplInterface);
46361
46362 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
46363 if (!parentProto) {
46364 return;
46365 }
46366
46367 JS::Handle<JSObject*> constructorProto(JS::GetRealmFunctionPrototypeHandle(aCx));
46368 if (!constructorProto) {
46369 return;
46370 }
46371
46372 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
46373 &sPrototypeClass, protoCache,
46374 constructorProto, &sInterfaceObjectInfo, 15, false, Span<const LegacyFactoryFunction, 0>{},
46375 interfaceCache,
46376 sNativeProperties.Upcast(),
46377 sChromeOnlyNativeProperties.Upcast(),
46378 "TestJSImplInterface",
46379 aDefineOnGlobal != DefineInterfaceProperty::No,
46380 nullptr,
46381 false,
46382 nullptr);
46383}
46384
46385JS::Handle<JSObject*>
46386GetProtoObjectHandle(JSContext* aCx)
46387{
46388 /* Get the interface prototype object for this class. This will create the
46389 object as needed. */
46390 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplInterface,
46391 &CreateInterfaceObjects,
46392 DefineInterfaceProperty::CheckExposure);
46393
46394}
46395
46396JSObject*
46397GetProtoObject(JSContext* aCx)
46398{
46399 return GetProtoObjectHandle(aCx);
46400}
46401
46402JS::Handle<JSObject*>
46403GetConstructorObjectHandle(JSContext* aCx)
46404{
46405 /* Get the interface object for this class. This will create the object as
46406 needed. */
46407
46408 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestJSImplInterface,
46409 &CreateInterfaceObjects,
46410 DefineInterfaceProperty::CheckExposure);
46411}
46412
46413} // namespace TestJSImplInterface_Binding
46414
46415
46416
46417namespace TestJSImplNoInterfaceObject_Binding {
46418
46419static void
46420_finalize(JS::GCContext* gcx, JSObject* obj)
46421{
46422 mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj);
46423 if (self) {
46424 JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue());
46425 ClearWrapper(self, self, obj);
46426 if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
46427 JS::RemoveAssociatedMemory(obj, mallocBytes,
46428 JS::MemoryUse::DOMBinding);
46429 }
46430 AddForDeferredFinalization<mozilla::dom::TestJSImplNoInterfaceObject>(self);
46431 }
46432}
46433
46434bool sNativePropertiesInited = false;
46435const NativePropertyHooks sNativePropertyHooks = {
46436 nullptr,
46437 { nullptr, nullptr, &sNativePropertiesInited },
46438 prototypes::id::TestJSImplNoInterfaceObject,
46439 constructors::id::_ID_Count,
46440 &DefaultXrayExpandoObjectClass
46441};
46442
46443static const DOMIfaceAndProtoJSClass sPrototypeClass = {
46444 {
46445 "TestJSImplNoInterfaceObjectPrototype",
46446 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
46447 JS_NULL_CLASS_OPS,
46448 JS_NULL_CLASS_SPEC,
46449 JS_NULL_CLASS_EXT,
46450 JS_NULL_OBJECT_OPS
46451 },
46452 eInterfacePrototype,
46453 prototypes::id::TestJSImplNoInterfaceObject,
46454 PrototypeTraits<prototypes::id::TestJSImplNoInterfaceObject>::Depth,
46455 &sNativePropertyHooks,
46456 JS::GetRealmObjectPrototype
46457};
46458
46459static JS::Handle<JSObject*>
46460GetProtoObjectHandle(JSContext* aCx);
46461
46462static const JSClassOps sClassOps = {
46463 nullptr, /* addProperty */
46464 nullptr, /* delProperty */
46465 nullptr, /* enumerate */
46466 nullptr, /* newEnumerate */
46467 nullptr, /* resolve */
46468 nullptr, /* mayResolve */
46469 _finalize, /* finalize */
46470 nullptr, /* call */
46471 nullptr, /* construct */
46472 nullptr, /* trace */
46473};
46474
46475static const DOMJSClass sClass = {
46476 { "TestJSImplNoInterfaceObject",
46477 JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1) | JSCLASS_PRESERVES_WRAPPER,
46478 &sClassOps,
46479 JS_NULL_CLASS_SPEC,
46480 &NativeTypeHelpers<mozilla::dom::TestJSImplNoInterfaceObject>::sClassExtension,
46481 JS_NULL_OBJECT_OPS
46482 },
46483 { 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 },
46484 std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplNoInterfaceObject>,
46485 &sNativePropertyHooks,
46486 FindAssociatedGlobalForNative<mozilla::dom::TestJSImplNoInterfaceObject>::Get,
46487 GetProtoObjectHandle,
46488 GetCCParticipant<mozilla::dom::TestJSImplNoInterfaceObject>::Get(),
46489 nullptr,
46490 NativeTypeHelpers<mozilla::dom::TestJSImplNoInterfaceObject>::GetWrapperCache
46491};
46492static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1,
46493 "Must have the right minimal number of reserved slots.");
46494static_assert(1 >= 1,
46495 "Must have enough reserved slots.");
46496
46497bool
46498Wrap(JSContext* aCx, mozilla::dom::TestJSImplNoInterfaceObject* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
46499{
46500 static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplNoInterfaceObject>,
46501 "Shouldn't have wrappercached things that are not refcounted.");
46502 static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplNoInterfaceObject*>);
46503 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"
, 46503); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)"
")"); do { MOZ_CrashSequence(__null, 46503); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46504 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"
, 46504); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)"
")"); do { MOZ_CrashSequence(__null, 46504); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
46505 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"
, 46507); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46507); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
46506 "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"
, 46507); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46507); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
46507 "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"
, 46507); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { MOZ_CrashSequence
(__null, 46507); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46508
46509 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"
, 46510); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { MOZ_CrashSequence(__null, 46510); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46510 "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"
, 46510); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { MOZ_CrashSequence(__null, 46510); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46511
46512 // If the wrapper cache contains a dead reflector then finalize that
46513 // now, ensuring that the finalizer for the old reflector always
46514 // runs before the new reflector is created and attached. This
46515 // avoids the awkward situation where there are multiple reflector
46516 // objects that contain pointers to the same native.
46517
46518 if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) {
46519 _finalize(nullptr /* unused */, oldReflector);
46520 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"
, 46520); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()"
")"); do { MOZ_CrashSequence(__null, 46520); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46521 }
46522
46523 JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
46524 if (!global) {
46525 return false;
46526 }
46527 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", 46527); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { MOZ_CrashSequence
(__null, 46527); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46528 JS::AssertObjectIsNotGray(global);
46529
46530 // That might have ended up wrapping us already, due to the wonders
46531 // of XBL. Check for that, and bail out as needed.
46532 aReflector.set(aCache->GetWrapper());
46533 if (aReflector) {
46534#ifdef DEBUG1
46535 AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
46536#endif // DEBUG
46537 return true;
46538 }
46539
46540 JSAutoRealm ar(aCx, global);
46541 JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
46542 if (!canonicalProto) {
46543 return false;
46544 }
46545 JS::Rooted<JSObject*> proto(aCx);
46546 if (aGivenProto) {
46547 proto = aGivenProto;
46548 // Unfortunately, while aGivenProto was in the compartment of aCx
46549 // coming in, we changed compartments to that of "parent" so may need
46550 // to wrap the proto here.
46551 if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) {
46552 if (!JS_WrapObject(aCx, &proto)) {
46553 return false;
46554 }
46555 }
46556 } else {
46557 proto = canonicalProto;
46558 }
46559
46560 BindingJSObjectCreator<mozilla::dom::TestJSImplNoInterfaceObject> creator(aCx);
46561 creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
46562 if (!aReflector) {
46563 return false;
46564 }
46565
46566 aCache->SetWrapper(aReflector);
46567 creator.InitializationSucceeded();
46568
46569 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", 46570); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { MOZ_CrashSequence(__null, 46570); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46570 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", 46570); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { MOZ_CrashSequence(__null, 46570); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46571 // If proto != canonicalProto, we have to preserve our wrapper;
46572 // otherwise we won't be able to properly recreate it later, since
46573 // we won't know what proto to use. Note that we don't check
46574 // aGivenProto here, since it's entirely possible (and even
46575 // somewhat common) to have a non-null aGivenProto which is the
46576 // same as canonicalProto.
46577 if (proto != canonicalProto) {
46578 PreserveWrapper(aObject);
46579 }
46580
46581 return true;
46582}
46583
46584void
46585CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
46586{
46587 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplNoInterfaceObject);
46588 JS::Heap<JSObject*>* interfaceCache = nullptr;
46589
46590 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
46591 if (!parentProto) {
46592 return;
46593 }
46594
46595 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
46596 &sPrototypeClass, protoCache,
46597 nullptr, nullptr, 0, false, Span<const LegacyFactoryFunction, 0>{},
46598 interfaceCache,
46599 nullptr,
46600 nullptr,
46601 "TestJSImplNoInterfaceObject",
46602 aDefineOnGlobal != DefineInterfaceProperty::No,
46603 nullptr,
46604 false,
46605 nullptr);
46606}
46607
46608static JS::Handle<JSObject*>
46609GetProtoObjectHandle(JSContext* aCx)
46610{
46611 /* Get the interface prototype object for this class. This will create the
46612 object as needed. */
46613 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplNoInterfaceObject,
46614 &CreateInterfaceObjects,
46615 DefineInterfaceProperty::CheckExposure);
46616
46617}
46618
46619} // namespace TestJSImplNoInterfaceObject_Binding
46620
46621
46622
46623void
46624TestJSImplInterfaceJSImpl::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
46625{
46626 CallSetup s(this, aRv, "TestJSImplInterface.passByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46627 if (aRv.Failed()) {
46628 return;
46629 }
46630 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46630); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46630); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46631 BindingCallContext& cx = s.GetCallContext();
46632
46633 JS::Rooted<JS::Value> rval(cx);
46634 JS::RootedVector<JS::Value> argv(cx);
46635 if (!argv.resize(1)) {
46636 // That threw an exception on the JSContext, and our CallSetup will do
46637 // the right thing with that.
46638 return;
46639 }
46640 unsigned argc = 1;
46641
46642 do {
46643 argv[0].setInt32(int32_t(arg));
46644 break;
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->passByte_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
46663int8_t
46664TestJSImplInterfaceJSImpl::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm)
46665{
46666 CallSetup s(this, aRv, "TestJSImplInterface.receiveByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46667 if (aRv.Failed()) {
46668 return int8_t(0);
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 { MOZ_CrashSequence
(__null, 46670); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46671 BindingCallContext& cx = s.GetCallContext();
46672
46673 JS::Rooted<JS::Value> rval(cx);
46674
46675 JS::Rooted<JS::Value> callable(cx);
46676 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46677 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46678 !InitIds(cx, atomsCache)) ||
46679 !GetCallableProperty(cx, atomsCache->receiveByte_id, &callable)) {
46680 aRv.Throw(NS_ERROR_UNEXPECTED);
46681 return int8_t(0);
46682 }
46683 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46684 if (!JS::Call(cx, thisValue, callable,
46685 JS::HandleValueArray::empty(), &rval)) {
46686 aRv.NoteJSContextException(cx);
46687 return int8_t(0);
46688 }
46689 int8_t rvalDecl;
46690 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveByte", &rvalDecl)) {
46691 aRv.Throw(NS_ERROR_UNEXPECTED);
46692 return int8_t(0);
46693 }
46694 return rvalDecl;
46695}
46696
46697void
46698TestJSImplInterfaceJSImpl::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46699{
46700 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46701 if (aRv.Failed()) {
46702 return;
46703 }
46704 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46704); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46704); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46705 BindingCallContext& cx = s.GetCallContext();
46706
46707 JS::Rooted<JS::Value> rval(cx);
46708 JS::RootedVector<JS::Value> argv(cx);
46709 if (!argv.resize(1)) {
46710 // That threw an exception on the JSContext, and our CallSetup will do
46711 // the right thing with that.
46712 return;
46713 }
46714 unsigned argc = 1;
46715
46716 do {
46717 if (arg.WasPassed()) {
46718 argv[0].setInt32(int32_t(arg.Value()));
46719 break;
46720 } else if (argc == 1) {
46721 // This is our current trailing argument; reduce argc
46722 --argc;
46723 } else {
46724 argv[0].setUndefined();
46725 }
46726 } while (false);
46727
46728 JS::Rooted<JS::Value> callable(cx);
46729 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46730 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46731 !InitIds(cx, atomsCache)) ||
46732 !GetCallableProperty(cx, atomsCache->passOptionalByte_id, &callable)) {
46733 aRv.Throw(NS_ERROR_UNEXPECTED);
46734 return;
46735 }
46736 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46737 if (!JS::Call(cx, thisValue, callable,
46738 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46739 aRv.NoteJSContextException(cx);
46740 return;
46741 }
46742}
46743
46744void
46745TestJSImplInterfaceJSImpl::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
46746{
46747 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46748 if (aRv.Failed()) {
46749 return;
46750 }
46751 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46751); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46751); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46752 BindingCallContext& cx = s.GetCallContext();
46753
46754 JS::Rooted<JS::Value> rval(cx);
46755 JS::RootedVector<JS::Value> argv(cx);
46756 if (!argv.resize(2)) {
46757 // That threw an exception on the JSContext, and our CallSetup will do
46758 // the right thing with that.
46759 return;
46760 }
46761 unsigned argc = 2;
46762
46763 do {
46764 argv[1].setInt32(int32_t(arg2));
46765 break;
46766 } while (false);
46767
46768 do {
46769 if (arg1.WasPassed()) {
46770 argv[0].setInt32(int32_t(arg1.Value()));
46771 break;
46772 } else if (argc == 1) {
46773 // This is our current trailing argument; reduce argc
46774 --argc;
46775 } else {
46776 argv[0].setUndefined();
46777 }
46778 } while (false);
46779
46780 JS::Rooted<JS::Value> callable(cx);
46781 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46782 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46783 !InitIds(cx, atomsCache)) ||
46784 !GetCallableProperty(cx, atomsCache->passOptionalByteBeforeRequired_id, &callable)) {
46785 aRv.Throw(NS_ERROR_UNEXPECTED);
46786 return;
46787 }
46788 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46789 if (!JS::Call(cx, thisValue, callable,
46790 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46791 aRv.NoteJSContextException(cx);
46792 return;
46793 }
46794}
46795
46796void
46797TestJSImplInterfaceJSImpl::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
46798{
46799 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46800 if (aRv.Failed()) {
46801 return;
46802 }
46803 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46803); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46803); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46804 BindingCallContext& cx = s.GetCallContext();
46805
46806 JS::Rooted<JS::Value> rval(cx);
46807 JS::RootedVector<JS::Value> argv(cx);
46808 if (!argv.resize(1)) {
46809 // That threw an exception on the JSContext, and our CallSetup will do
46810 // the right thing with that.
46811 return;
46812 }
46813 unsigned argc = 1;
46814
46815 do {
46816 argv[0].setInt32(int32_t(arg));
46817 break;
46818 } while (false);
46819
46820 JS::Rooted<JS::Value> callable(cx);
46821 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46822 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46823 !InitIds(cx, atomsCache)) ||
46824 !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefault_id, &callable)) {
46825 aRv.Throw(NS_ERROR_UNEXPECTED);
46826 return;
46827 }
46828 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46829 if (!JS::Call(cx, thisValue, callable,
46830 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46831 aRv.NoteJSContextException(cx);
46832 return;
46833 }
46834}
46835
46836void
46837TestJSImplInterfaceJSImpl::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
46838{
46839 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46840 if (aRv.Failed()) {
46841 return;
46842 }
46843 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46843); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46843); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46844 BindingCallContext& cx = s.GetCallContext();
46845
46846 JS::Rooted<JS::Value> rval(cx);
46847 JS::RootedVector<JS::Value> argv(cx);
46848 if (!argv.resize(2)) {
46849 // That threw an exception on the JSContext, and our CallSetup will do
46850 // the right thing with that.
46851 return;
46852 }
46853 unsigned argc = 2;
46854
46855 do {
46856 argv[1].setInt32(int32_t(arg2));
46857 break;
46858 } while (false);
46859
46860 do {
46861 argv[0].setInt32(int32_t(arg1));
46862 break;
46863 } while (false);
46864
46865 JS::Rooted<JS::Value> callable(cx);
46866 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46867 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46868 !InitIds(cx, atomsCache)) ||
46869 !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefaultBeforeRequired_id, &callable)) {
46870 aRv.Throw(NS_ERROR_UNEXPECTED);
46871 return;
46872 }
46873 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46874 if (!JS::Call(cx, thisValue, callable,
46875 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46876 aRv.NoteJSContextException(cx);
46877 return;
46878 }
46879}
46880
46881void
46882TestJSImplInterfaceJSImpl::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46883{
46884 CallSetup s(this, aRv, "TestJSImplInterface.passNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46885 if (aRv.Failed()) {
46886 return;
46887 }
46888 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46888); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46888); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46889 BindingCallContext& cx = s.GetCallContext();
46890
46891 JS::Rooted<JS::Value> rval(cx);
46892 JS::RootedVector<JS::Value> argv(cx);
46893 if (!argv.resize(1)) {
46894 // That threw an exception on the JSContext, and our CallSetup will do
46895 // the right thing with that.
46896 return;
46897 }
46898 unsigned argc = 1;
46899
46900 do {
46901 if (arg.IsNull()) {
46902 argv[0].setNull();
46903 break;
46904 }
46905 argv[0].setInt32(int32_t(arg.Value()));
46906 break;
46907 } while (false);
46908
46909 JS::Rooted<JS::Value> callable(cx);
46910 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46911 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46912 !InitIds(cx, atomsCache)) ||
46913 !GetCallableProperty(cx, atomsCache->passNullableByte_id, &callable)) {
46914 aRv.Throw(NS_ERROR_UNEXPECTED);
46915 return;
46916 }
46917 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46918 if (!JS::Call(cx, thisValue, callable,
46919 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46920 aRv.NoteJSContextException(cx);
46921 return;
46922 }
46923}
46924
46925void
46926TestJSImplInterfaceJSImpl::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46927{
46928 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46929 if (aRv.Failed()) {
46930 return;
46931 }
46932 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46932); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46932); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46933 BindingCallContext& cx = s.GetCallContext();
46934
46935 JS::Rooted<JS::Value> rval(cx);
46936 JS::RootedVector<JS::Value> argv(cx);
46937 if (!argv.resize(1)) {
46938 // That threw an exception on the JSContext, and our CallSetup will do
46939 // the right thing with that.
46940 return;
46941 }
46942 unsigned argc = 1;
46943
46944 do {
46945 if (arg.WasPassed()) {
46946 if (arg.Value().IsNull()) {
46947 argv[0].setNull();
46948 break;
46949 }
46950 argv[0].setInt32(int32_t(arg.Value().Value()));
46951 break;
46952 } else if (argc == 1) {
46953 // This is our current trailing argument; reduce argc
46954 --argc;
46955 } else {
46956 argv[0].setUndefined();
46957 }
46958 } while (false);
46959
46960 JS::Rooted<JS::Value> callable(cx);
46961 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46962 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46963 !InitIds(cx, atomsCache)) ||
46964 !GetCallableProperty(cx, atomsCache->passOptionalNullableByte_id, &callable)) {
46965 aRv.Throw(NS_ERROR_UNEXPECTED);
46966 return;
46967 }
46968 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46969 if (!JS::Call(cx, thisValue, callable,
46970 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46971 aRv.NoteJSContextException(cx);
46972 return;
46973 }
46974}
46975
46976void
46977TestJSImplInterfaceJSImpl::PassVariadicByte(const nsTArray<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46978{
46979 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46980 if (aRv.Failed()) {
46981 return;
46982 }
46983 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46983); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 46983); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
46984 BindingCallContext& cx = s.GetCallContext();
46985
46986 JS::Rooted<JS::Value> rval(cx);
46987 JS::RootedVector<JS::Value> argv(cx);
46988 if (!argv.resize((1 - 1) + arg.Length())) {
46989 // That threw an exception on the JSContext, and our CallSetup will do
46990 // the right thing with that.
46991 return;
46992 }
46993 unsigned argc = (1 - 1) + arg.Length();
46994
46995 do {
46996 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
46997 argv[0 + idx].setInt32(int32_t(arg[idx]));
46998 continue;
46999 }
47000 break;
47001 } while (false);
47002
47003 JS::Rooted<JS::Value> callable(cx);
47004 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47005 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47006 !InitIds(cx, atomsCache)) ||
47007 !GetCallableProperty(cx, atomsCache->passVariadicByte_id, &callable)) {
47008 aRv.Throw(NS_ERROR_UNEXPECTED);
47009 return;
47010 }
47011 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47012 if (!JS::Call(cx, thisValue, callable,
47013 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47014 aRv.NoteJSContextException(cx);
47015 return;
47016 }
47017}
47018
47019int8_t
47020TestJSImplInterfaceJSImpl::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm)
47021{
47022 CallSetup s(this, aRv, "TestJSImplInterface.returnByteSideEffectFree", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47023 if (aRv.Failed()) {
47024 return int8_t(0);
47025 }
47026 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47026); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47027 BindingCallContext& cx = s.GetCallContext();
47028
47029 JS::Rooted<JS::Value> rval(cx);
47030
47031 JS::Rooted<JS::Value> callable(cx);
47032 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47033 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47034 !InitIds(cx, atomsCache)) ||
47035 !GetCallableProperty(cx, atomsCache->returnByteSideEffectFree_id, &callable)) {
47036 aRv.Throw(NS_ERROR_UNEXPECTED);
47037 return int8_t(0);
47038 }
47039 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47040 if (!JS::Call(cx, thisValue, callable,
47041 JS::HandleValueArray::empty(), &rval)) {
47042 aRv.NoteJSContextException(cx);
47043 return int8_t(0);
47044 }
47045 int8_t rvalDecl;
47046 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnByteSideEffectFree", &rvalDecl)) {
47047 aRv.Throw(NS_ERROR_UNEXPECTED);
47048 return int8_t(0);
47049 }
47050 return rvalDecl;
47051}
47052
47053int8_t
47054TestJSImplInterfaceJSImpl::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
47055{
47056 CallSetup s(this, aRv, "TestJSImplInterface.returnDOMDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47057 if (aRv.Failed()) {
47058 return int8_t(0);
47059 }
47060 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47060); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47060); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47061 BindingCallContext& cx = s.GetCallContext();
47062
47063 JS::Rooted<JS::Value> rval(cx);
47064
47065 JS::Rooted<JS::Value> callable(cx);
47066 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47067 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47068 !InitIds(cx, atomsCache)) ||
47069 !GetCallableProperty(cx, atomsCache->returnDOMDependentByte_id, &callable)) {
47070 aRv.Throw(NS_ERROR_UNEXPECTED);
47071 return int8_t(0);
47072 }
47073 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47074 if (!JS::Call(cx, thisValue, callable,
47075 JS::HandleValueArray::empty(), &rval)) {
47076 aRv.NoteJSContextException(cx);
47077 return int8_t(0);
47078 }
47079 int8_t rvalDecl;
47080 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDOMDependentByte", &rvalDecl)) {
47081 aRv.Throw(NS_ERROR_UNEXPECTED);
47082 return int8_t(0);
47083 }
47084 return rvalDecl;
47085}
47086
47087int8_t
47088TestJSImplInterfaceJSImpl::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
47089{
47090 CallSetup s(this, aRv, "TestJSImplInterface.returnConstantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47091 if (aRv.Failed()) {
47092 return int8_t(0);
47093 }
47094 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47094); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47094); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47095 BindingCallContext& cx = s.GetCallContext();
47096
47097 JS::Rooted<JS::Value> rval(cx);
47098
47099 JS::Rooted<JS::Value> callable(cx);
47100 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47101 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47102 !InitIds(cx, atomsCache)) ||
47103 !GetCallableProperty(cx, atomsCache->returnConstantByte_id, &callable)) {
47104 aRv.Throw(NS_ERROR_UNEXPECTED);
47105 return int8_t(0);
47106 }
47107 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47108 if (!JS::Call(cx, thisValue, callable,
47109 JS::HandleValueArray::empty(), &rval)) {
47110 aRv.NoteJSContextException(cx);
47111 return int8_t(0);
47112 }
47113 int8_t rvalDecl;
47114 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnConstantByte", &rvalDecl)) {
47115 aRv.Throw(NS_ERROR_UNEXPECTED);
47116 return int8_t(0);
47117 }
47118 return rvalDecl;
47119}
47120
47121int8_t
47122TestJSImplInterfaceJSImpl::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
47123{
47124 CallSetup s(this, aRv, "TestJSImplInterface.returnDeviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47125 if (aRv.Failed()) {
47126 return int8_t(0);
47127 }
47128 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47128); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47129 BindingCallContext& cx = s.GetCallContext();
47130
47131 JS::Rooted<JS::Value> rval(cx);
47132
47133 JS::Rooted<JS::Value> callable(cx);
47134 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47135 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47136 !InitIds(cx, atomsCache)) ||
47137 !GetCallableProperty(cx, atomsCache->returnDeviceStateDependentByte_id, &callable)) {
47138 aRv.Throw(NS_ERROR_UNEXPECTED);
47139 return int8_t(0);
47140 }
47141 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47142 if (!JS::Call(cx, thisValue, callable,
47143 JS::HandleValueArray::empty(), &rval)) {
47144 aRv.NoteJSContextException(cx);
47145 return int8_t(0);
47146 }
47147 int8_t rvalDecl;
47148 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDeviceStateDependentByte", &rvalDecl)) {
47149 aRv.Throw(NS_ERROR_UNEXPECTED);
47150 return int8_t(0);
47151 }
47152 return rvalDecl;
47153}
47154
47155void
47156TestJSImplInterfaceJSImpl::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47157{
47158 CallSetup s(this, aRv, "TestJSImplInterface.passShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47159 if (aRv.Failed()) {
47160 return;
47161 }
47162 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47162); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47162); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47163 BindingCallContext& cx = s.GetCallContext();
47164
47165 JS::Rooted<JS::Value> rval(cx);
47166 JS::RootedVector<JS::Value> argv(cx);
47167 if (!argv.resize(1)) {
47168 // That threw an exception on the JSContext, and our CallSetup will do
47169 // the right thing with that.
47170 return;
47171 }
47172 unsigned argc = 1;
47173
47174 do {
47175 argv[0].setInt32(int32_t(arg));
47176 break;
47177 } while (false);
47178
47179 JS::Rooted<JS::Value> callable(cx);
47180 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47181 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47182 !InitIds(cx, atomsCache)) ||
47183 !GetCallableProperty(cx, atomsCache->passShort_id, &callable)) {
47184 aRv.Throw(NS_ERROR_UNEXPECTED);
47185 return;
47186 }
47187 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47188 if (!JS::Call(cx, thisValue, callable,
47189 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47190 aRv.NoteJSContextException(cx);
47191 return;
47192 }
47193}
47194
47195int16_t
47196TestJSImplInterfaceJSImpl::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm)
47197{
47198 CallSetup s(this, aRv, "TestJSImplInterface.receiveShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47199 if (aRv.Failed()) {
47200 return int16_t(0);
47201 }
47202 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47202); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47202); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47203 BindingCallContext& cx = s.GetCallContext();
47204
47205 JS::Rooted<JS::Value> rval(cx);
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->receiveShort_id, &callable)) {
47212 aRv.Throw(NS_ERROR_UNEXPECTED);
47213 return int16_t(0);
47214 }
47215 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47216 if (!JS::Call(cx, thisValue, callable,
47217 JS::HandleValueArray::empty(), &rval)) {
47218 aRv.NoteJSContextException(cx);
47219 return int16_t(0);
47220 }
47221 int16_t rvalDecl;
47222 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveShort", &rvalDecl)) {
47223 aRv.Throw(NS_ERROR_UNEXPECTED);
47224 return int16_t(0);
47225 }
47226 return rvalDecl;
47227}
47228
47229void
47230TestJSImplInterfaceJSImpl::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47231{
47232 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47233 if (aRv.Failed()) {
47234 return;
47235 }
47236 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47236); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47236); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47237 BindingCallContext& cx = s.GetCallContext();
47238
47239 JS::Rooted<JS::Value> rval(cx);
47240 JS::RootedVector<JS::Value> argv(cx);
47241 if (!argv.resize(1)) {
47242 // That threw an exception on the JSContext, and our CallSetup will do
47243 // the right thing with that.
47244 return;
47245 }
47246 unsigned argc = 1;
47247
47248 do {
47249 if (arg.WasPassed()) {
47250 argv[0].setInt32(int32_t(arg.Value()));
47251 break;
47252 } else if (argc == 1) {
47253 // This is our current trailing argument; reduce argc
47254 --argc;
47255 } else {
47256 argv[0].setUndefined();
47257 }
47258 } while (false);
47259
47260 JS::Rooted<JS::Value> callable(cx);
47261 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47262 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47263 !InitIds(cx, atomsCache)) ||
47264 !GetCallableProperty(cx, atomsCache->passOptionalShort_id, &callable)) {
47265 aRv.Throw(NS_ERROR_UNEXPECTED);
47266 return;
47267 }
47268 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47269 if (!JS::Call(cx, thisValue, callable,
47270 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47271 aRv.NoteJSContextException(cx);
47272 return;
47273 }
47274}
47275
47276void
47277TestJSImplInterfaceJSImpl::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47278{
47279 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47280 if (aRv.Failed()) {
47281 return;
47282 }
47283 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47283); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47283); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47284 BindingCallContext& cx = s.GetCallContext();
47285
47286 JS::Rooted<JS::Value> rval(cx);
47287 JS::RootedVector<JS::Value> argv(cx);
47288 if (!argv.resize(1)) {
47289 // That threw an exception on the JSContext, and our CallSetup will do
47290 // the right thing with that.
47291 return;
47292 }
47293 unsigned argc = 1;
47294
47295 do {
47296 argv[0].setInt32(int32_t(arg));
47297 break;
47298 } while (false);
47299
47300 JS::Rooted<JS::Value> callable(cx);
47301 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47302 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47303 !InitIds(cx, atomsCache)) ||
47304 !GetCallableProperty(cx, atomsCache->passOptionalShortWithDefault_id, &callable)) {
47305 aRv.Throw(NS_ERROR_UNEXPECTED);
47306 return;
47307 }
47308 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47309 if (!JS::Call(cx, thisValue, callable,
47310 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47311 aRv.NoteJSContextException(cx);
47312 return;
47313 }
47314}
47315
47316void
47317TestJSImplInterfaceJSImpl::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47318{
47319 CallSetup s(this, aRv, "TestJSImplInterface.passLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47320 if (aRv.Failed()) {
47321 return;
47322 }
47323 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47323); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47324 BindingCallContext& cx = s.GetCallContext();
47325
47326 JS::Rooted<JS::Value> rval(cx);
47327 JS::RootedVector<JS::Value> argv(cx);
47328 if (!argv.resize(1)) {
47329 // That threw an exception on the JSContext, and our CallSetup will do
47330 // the right thing with that.
47331 return;
47332 }
47333 unsigned argc = 1;
47334
47335 do {
47336 argv[0].setInt32(int32_t(arg));
47337 break;
47338 } while (false);
47339
47340 JS::Rooted<JS::Value> callable(cx);
47341 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47342 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47343 !InitIds(cx, atomsCache)) ||
47344 !GetCallableProperty(cx, atomsCache->passLong_id, &callable)) {
47345 aRv.Throw(NS_ERROR_UNEXPECTED);
47346 return;
47347 }
47348 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47349 if (!JS::Call(cx, thisValue, callable,
47350 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47351 aRv.NoteJSContextException(cx);
47352 return;
47353 }
47354}
47355
47356int32_t
47357TestJSImplInterfaceJSImpl::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm)
47358{
47359 CallSetup s(this, aRv, "TestJSImplInterface.receiveLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47360 if (aRv.Failed()) {
47361 return int32_t(0);
47362 }
47363 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47363); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47363); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47364 BindingCallContext& cx = s.GetCallContext();
47365
47366 JS::Rooted<JS::Value> rval(cx);
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->receiveLong_id, &callable)) {
47373 aRv.Throw(NS_ERROR_UNEXPECTED);
47374 return int32_t(0);
47375 }
47376 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47377 if (!JS::Call(cx, thisValue, callable,
47378 JS::HandleValueArray::empty(), &rval)) {
47379 aRv.NoteJSContextException(cx);
47380 return int32_t(0);
47381 }
47382 int32_t rvalDecl;
47383 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLong", &rvalDecl)) {
47384 aRv.Throw(NS_ERROR_UNEXPECTED);
47385 return int32_t(0);
47386 }
47387 return rvalDecl;
47388}
47389
47390void
47391TestJSImplInterfaceJSImpl::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47392{
47393 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47394 if (aRv.Failed()) {
47395 return;
47396 }
47397 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47397); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47398 BindingCallContext& cx = s.GetCallContext();
47399
47400 JS::Rooted<JS::Value> rval(cx);
47401 JS::RootedVector<JS::Value> argv(cx);
47402 if (!argv.resize(1)) {
47403 // That threw an exception on the JSContext, and our CallSetup will do
47404 // the right thing with that.
47405 return;
47406 }
47407 unsigned argc = 1;
47408
47409 do {
47410 if (arg.WasPassed()) {
47411 argv[0].setInt32(int32_t(arg.Value()));
47412 break;
47413 } else if (argc == 1) {
47414 // This is our current trailing argument; reduce argc
47415 --argc;
47416 } else {
47417 argv[0].setUndefined();
47418 }
47419 } while (false);
47420
47421 JS::Rooted<JS::Value> callable(cx);
47422 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47423 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47424 !InitIds(cx, atomsCache)) ||
47425 !GetCallableProperty(cx, atomsCache->passOptionalLong_id, &callable)) {
47426 aRv.Throw(NS_ERROR_UNEXPECTED);
47427 return;
47428 }
47429 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47430 if (!JS::Call(cx, thisValue, callable,
47431 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47432 aRv.NoteJSContextException(cx);
47433 return;
47434 }
47435}
47436
47437void
47438TestJSImplInterfaceJSImpl::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47439{
47440 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47441 if (aRv.Failed()) {
47442 return;
47443 }
47444 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47444); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47444); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47445 BindingCallContext& cx = s.GetCallContext();
47446
47447 JS::Rooted<JS::Value> rval(cx);
47448 JS::RootedVector<JS::Value> argv(cx);
47449 if (!argv.resize(1)) {
47450 // That threw an exception on the JSContext, and our CallSetup will do
47451 // the right thing with that.
47452 return;
47453 }
47454 unsigned argc = 1;
47455
47456 do {
47457 argv[0].setInt32(int32_t(arg));
47458 break;
47459 } while (false);
47460
47461 JS::Rooted<JS::Value> callable(cx);
47462 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47463 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47464 !InitIds(cx, atomsCache)) ||
47465 !GetCallableProperty(cx, atomsCache->passOptionalLongWithDefault_id, &callable)) {
47466 aRv.Throw(NS_ERROR_UNEXPECTED);
47467 return;
47468 }
47469 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47470 if (!JS::Call(cx, thisValue, callable,
47471 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47472 aRv.NoteJSContextException(cx);
47473 return;
47474 }
47475}
47476
47477void
47478TestJSImplInterfaceJSImpl::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47479{
47480 CallSetup s(this, aRv, "TestJSImplInterface.passLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47481 if (aRv.Failed()) {
47482 return;
47483 }
47484 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47484); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47484); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47485 BindingCallContext& cx = s.GetCallContext();
47486
47487 JS::Rooted<JS::Value> rval(cx);
47488 JS::RootedVector<JS::Value> argv(cx);
47489 if (!argv.resize(1)) {
47490 // That threw an exception on the JSContext, and our CallSetup will do
47491 // the right thing with that.
47492 return;
47493 }
47494 unsigned argc = 1;
47495
47496 do {
47497 argv[0].set(JS_NumberValue(double(arg)));
47498 break;
47499 } while (false);
47500
47501 JS::Rooted<JS::Value> callable(cx);
47502 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47503 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47504 !InitIds(cx, atomsCache)) ||
47505 !GetCallableProperty(cx, atomsCache->passLongLong_id, &callable)) {
47506 aRv.Throw(NS_ERROR_UNEXPECTED);
47507 return;
47508 }
47509 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47510 if (!JS::Call(cx, thisValue, callable,
47511 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47512 aRv.NoteJSContextException(cx);
47513 return;
47514 }
47515}
47516
47517int64_t
47518TestJSImplInterfaceJSImpl::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm)
47519{
47520 CallSetup s(this, aRv, "TestJSImplInterface.receiveLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47521 if (aRv.Failed()) {
47522 return int64_t(0);
47523 }
47524 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47524); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47524); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47525 BindingCallContext& cx = s.GetCallContext();
47526
47527 JS::Rooted<JS::Value> rval(cx);
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->receiveLongLong_id, &callable)) {
47534 aRv.Throw(NS_ERROR_UNEXPECTED);
47535 return int64_t(0);
47536 }
47537 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47538 if (!JS::Call(cx, thisValue, callable,
47539 JS::HandleValueArray::empty(), &rval)) {
47540 aRv.NoteJSContextException(cx);
47541 return int64_t(0);
47542 }
47543 int64_t rvalDecl;
47544 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLongLong", &rvalDecl)) {
47545 aRv.Throw(NS_ERROR_UNEXPECTED);
47546 return int64_t(0);
47547 }
47548 return rvalDecl;
47549}
47550
47551void
47552TestJSImplInterfaceJSImpl::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47553{
47554 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47555 if (aRv.Failed()) {
47556 return;
47557 }
47558 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47558); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47558); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47559 BindingCallContext& cx = s.GetCallContext();
47560
47561 JS::Rooted<JS::Value> rval(cx);
47562 JS::RootedVector<JS::Value> argv(cx);
47563 if (!argv.resize(1)) {
47564 // That threw an exception on the JSContext, and our CallSetup will do
47565 // the right thing with that.
47566 return;
47567 }
47568 unsigned argc = 1;
47569
47570 do {
47571 if (arg.WasPassed()) {
47572 argv[0].set(JS_NumberValue(double(arg.Value())));
47573 break;
47574 } else if (argc == 1) {
47575 // This is our current trailing argument; reduce argc
47576 --argc;
47577 } else {
47578 argv[0].setUndefined();
47579 }
47580 } while (false);
47581
47582 JS::Rooted<JS::Value> callable(cx);
47583 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47584 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47585 !InitIds(cx, atomsCache)) ||
47586 !GetCallableProperty(cx, atomsCache->passOptionalLongLong_id, &callable)) {
47587 aRv.Throw(NS_ERROR_UNEXPECTED);
47588 return;
47589 }
47590 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47591 if (!JS::Call(cx, thisValue, callable,
47592 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47593 aRv.NoteJSContextException(cx);
47594 return;
47595 }
47596}
47597
47598void
47599TestJSImplInterfaceJSImpl::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47600{
47601 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47602 if (aRv.Failed()) {
47603 return;
47604 }
47605 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47605); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47605); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47606 BindingCallContext& cx = s.GetCallContext();
47607
47608 JS::Rooted<JS::Value> rval(cx);
47609 JS::RootedVector<JS::Value> argv(cx);
47610 if (!argv.resize(1)) {
47611 // That threw an exception on the JSContext, and our CallSetup will do
47612 // the right thing with that.
47613 return;
47614 }
47615 unsigned argc = 1;
47616
47617 do {
47618 argv[0].set(JS_NumberValue(double(arg)));
47619 break;
47620 } while (false);
47621
47622 JS::Rooted<JS::Value> callable(cx);
47623 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47624 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47625 !InitIds(cx, atomsCache)) ||
47626 !GetCallableProperty(cx, atomsCache->passOptionalLongLongWithDefault_id, &callable)) {
47627 aRv.Throw(NS_ERROR_UNEXPECTED);
47628 return;
47629 }
47630 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47631 if (!JS::Call(cx, thisValue, callable,
47632 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47633 aRv.NoteJSContextException(cx);
47634 return;
47635 }
47636}
47637
47638void
47639TestJSImplInterfaceJSImpl::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47640{
47641 CallSetup s(this, aRv, "TestJSImplInterface.passOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47642 if (aRv.Failed()) {
47643 return;
47644 }
47645 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47645); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47645); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47646 BindingCallContext& cx = s.GetCallContext();
47647
47648 JS::Rooted<JS::Value> rval(cx);
47649 JS::RootedVector<JS::Value> argv(cx);
47650 if (!argv.resize(1)) {
47651 // That threw an exception on the JSContext, and our CallSetup will do
47652 // the right thing with that.
47653 return;
47654 }
47655 unsigned argc = 1;
47656
47657 do {
47658 argv[0].setInt32(int32_t(arg));
47659 break;
47660 } while (false);
47661
47662 JS::Rooted<JS::Value> callable(cx);
47663 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47664 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47665 !InitIds(cx, atomsCache)) ||
47666 !GetCallableProperty(cx, atomsCache->passOctet_id, &callable)) {
47667 aRv.Throw(NS_ERROR_UNEXPECTED);
47668 return;
47669 }
47670 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47671 if (!JS::Call(cx, thisValue, callable,
47672 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47673 aRv.NoteJSContextException(cx);
47674 return;
47675 }
47676}
47677
47678uint8_t
47679TestJSImplInterfaceJSImpl::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm)
47680{
47681 CallSetup s(this, aRv, "TestJSImplInterface.receiveOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47682 if (aRv.Failed()) {
47683 return uint8_t(0);
47684 }
47685 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47685); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47685); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47686 BindingCallContext& cx = s.GetCallContext();
47687
47688 JS::Rooted<JS::Value> rval(cx);
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->receiveOctet_id, &callable)) {
47695 aRv.Throw(NS_ERROR_UNEXPECTED);
47696 return uint8_t(0);
47697 }
47698 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47699 if (!JS::Call(cx, thisValue, callable,
47700 JS::HandleValueArray::empty(), &rval)) {
47701 aRv.NoteJSContextException(cx);
47702 return uint8_t(0);
47703 }
47704 uint8_t rvalDecl;
47705 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveOctet", &rvalDecl)) {
47706 aRv.Throw(NS_ERROR_UNEXPECTED);
47707 return uint8_t(0);
47708 }
47709 return rvalDecl;
47710}
47711
47712void
47713TestJSImplInterfaceJSImpl::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47714{
47715 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47716 if (aRv.Failed()) {
47717 return;
47718 }
47719 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47719); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47719); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47720 BindingCallContext& cx = s.GetCallContext();
47721
47722 JS::Rooted<JS::Value> rval(cx);
47723 JS::RootedVector<JS::Value> argv(cx);
47724 if (!argv.resize(1)) {
47725 // That threw an exception on the JSContext, and our CallSetup will do
47726 // the right thing with that.
47727 return;
47728 }
47729 unsigned argc = 1;
47730
47731 do {
47732 if (arg.WasPassed()) {
47733 argv[0].setInt32(int32_t(arg.Value()));
47734 break;
47735 } else if (argc == 1) {
47736 // This is our current trailing argument; reduce argc
47737 --argc;
47738 } else {
47739 argv[0].setUndefined();
47740 }
47741 } while (false);
47742
47743 JS::Rooted<JS::Value> callable(cx);
47744 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47745 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47746 !InitIds(cx, atomsCache)) ||
47747 !GetCallableProperty(cx, atomsCache->passOptionalOctet_id, &callable)) {
47748 aRv.Throw(NS_ERROR_UNEXPECTED);
47749 return;
47750 }
47751 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47752 if (!JS::Call(cx, thisValue, callable,
47753 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47754 aRv.NoteJSContextException(cx);
47755 return;
47756 }
47757}
47758
47759void
47760TestJSImplInterfaceJSImpl::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47761{
47762 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctetWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47763 if (aRv.Failed()) {
47764 return;
47765 }
47766 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47766); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47766); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47767 BindingCallContext& cx = s.GetCallContext();
47768
47769 JS::Rooted<JS::Value> rval(cx);
47770 JS::RootedVector<JS::Value> argv(cx);
47771 if (!argv.resize(1)) {
47772 // That threw an exception on the JSContext, and our CallSetup will do
47773 // the right thing with that.
47774 return;
47775 }
47776 unsigned argc = 1;
47777
47778 do {
47779 argv[0].setInt32(int32_t(arg));
47780 break;
47781 } while (false);
47782
47783 JS::Rooted<JS::Value> callable(cx);
47784 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47785 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47786 !InitIds(cx, atomsCache)) ||
47787 !GetCallableProperty(cx, atomsCache->passOptionalOctetWithDefault_id, &callable)) {
47788 aRv.Throw(NS_ERROR_UNEXPECTED);
47789 return;
47790 }
47791 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47792 if (!JS::Call(cx, thisValue, callable,
47793 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47794 aRv.NoteJSContextException(cx);
47795 return;
47796 }
47797}
47798
47799void
47800TestJSImplInterfaceJSImpl::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47801{
47802 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47803 if (aRv.Failed()) {
47804 return;
47805 }
47806 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47806); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47806); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47807 BindingCallContext& cx = s.GetCallContext();
47808
47809 JS::Rooted<JS::Value> rval(cx);
47810 JS::RootedVector<JS::Value> argv(cx);
47811 if (!argv.resize(1)) {
47812 // That threw an exception on the JSContext, and our CallSetup will do
47813 // the right thing with that.
47814 return;
47815 }
47816 unsigned argc = 1;
47817
47818 do {
47819 argv[0].setInt32(int32_t(arg));
47820 break;
47821 } while (false);
47822
47823 JS::Rooted<JS::Value> callable(cx);
47824 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47825 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47826 !InitIds(cx, atomsCache)) ||
47827 !GetCallableProperty(cx, atomsCache->passUnsignedShort_id, &callable)) {
47828 aRv.Throw(NS_ERROR_UNEXPECTED);
47829 return;
47830 }
47831 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47832 if (!JS::Call(cx, thisValue, callable,
47833 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47834 aRv.NoteJSContextException(cx);
47835 return;
47836 }
47837}
47838
47839uint16_t
47840TestJSImplInterfaceJSImpl::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
47841{
47842 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47843 if (aRv.Failed()) {
47844 return uint16_t(0);
47845 }
47846 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47846); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47847 BindingCallContext& cx = s.GetCallContext();
47848
47849 JS::Rooted<JS::Value> rval(cx);
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->receiveUnsignedShort_id, &callable)) {
47856 aRv.Throw(NS_ERROR_UNEXPECTED);
47857 return uint16_t(0);
47858 }
47859 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47860 if (!JS::Call(cx, thisValue, callable,
47861 JS::HandleValueArray::empty(), &rval)) {
47862 aRv.NoteJSContextException(cx);
47863 return uint16_t(0);
47864 }
47865 uint16_t rvalDecl;
47866 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedShort", &rvalDecl)) {
47867 aRv.Throw(NS_ERROR_UNEXPECTED);
47868 return uint16_t(0);
47869 }
47870 return rvalDecl;
47871}
47872
47873void
47874TestJSImplInterfaceJSImpl::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47875{
47876 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47877 if (aRv.Failed()) {
47878 return;
47879 }
47880 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47880); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47880); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47881 BindingCallContext& cx = s.GetCallContext();
47882
47883 JS::Rooted<JS::Value> rval(cx);
47884 JS::RootedVector<JS::Value> argv(cx);
47885 if (!argv.resize(1)) {
47886 // That threw an exception on the JSContext, and our CallSetup will do
47887 // the right thing with that.
47888 return;
47889 }
47890 unsigned argc = 1;
47891
47892 do {
47893 if (arg.WasPassed()) {
47894 argv[0].setInt32(int32_t(arg.Value()));
47895 break;
47896 } else if (argc == 1) {
47897 // This is our current trailing argument; reduce argc
47898 --argc;
47899 } else {
47900 argv[0].setUndefined();
47901 }
47902 } while (false);
47903
47904 JS::Rooted<JS::Value> callable(cx);
47905 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47906 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47907 !InitIds(cx, atomsCache)) ||
47908 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShort_id, &callable)) {
47909 aRv.Throw(NS_ERROR_UNEXPECTED);
47910 return;
47911 }
47912 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47913 if (!JS::Call(cx, thisValue, callable,
47914 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47915 aRv.NoteJSContextException(cx);
47916 return;
47917 }
47918}
47919
47920void
47921TestJSImplInterfaceJSImpl::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47922{
47923 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47924 if (aRv.Failed()) {
47925 return;
47926 }
47927 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47927); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47927); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47928 BindingCallContext& cx = s.GetCallContext();
47929
47930 JS::Rooted<JS::Value> rval(cx);
47931 JS::RootedVector<JS::Value> argv(cx);
47932 if (!argv.resize(1)) {
47933 // That threw an exception on the JSContext, and our CallSetup will do
47934 // the right thing with that.
47935 return;
47936 }
47937 unsigned argc = 1;
47938
47939 do {
47940 argv[0].setInt32(int32_t(arg));
47941 break;
47942 } while (false);
47943
47944 JS::Rooted<JS::Value> callable(cx);
47945 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47946 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47947 !InitIds(cx, atomsCache)) ||
47948 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShortWithDefault_id, &callable)) {
47949 aRv.Throw(NS_ERROR_UNEXPECTED);
47950 return;
47951 }
47952 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47953 if (!JS::Call(cx, thisValue, callable,
47954 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47955 aRv.NoteJSContextException(cx);
47956 return;
47957 }
47958}
47959
47960void
47961TestJSImplInterfaceJSImpl::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47962{
47963 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47964 if (aRv.Failed()) {
47965 return;
47966 }
47967 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 47967); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
47968 BindingCallContext& cx = s.GetCallContext();
47969
47970 JS::Rooted<JS::Value> rval(cx);
47971 JS::RootedVector<JS::Value> argv(cx);
47972 if (!argv.resize(1)) {
47973 // That threw an exception on the JSContext, and our CallSetup will do
47974 // the right thing with that.
47975 return;
47976 }
47977 unsigned argc = 1;
47978
47979 do {
47980 argv[0].setNumber(arg);
47981 break;
47982 } while (false);
47983
47984 JS::Rooted<JS::Value> callable(cx);
47985 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47986 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47987 !InitIds(cx, atomsCache)) ||
47988 !GetCallableProperty(cx, atomsCache->passUnsignedLong_id, &callable)) {
47989 aRv.Throw(NS_ERROR_UNEXPECTED);
47990 return;
47991 }
47992 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47993 if (!JS::Call(cx, thisValue, callable,
47994 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47995 aRv.NoteJSContextException(cx);
47996 return;
47997 }
47998}
47999
48000uint32_t
48001TestJSImplInterfaceJSImpl::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
48002{
48003 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48004 if (aRv.Failed()) {
48005 return uint32_t(0);
48006 }
48007 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48007); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48007); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48008 BindingCallContext& cx = s.GetCallContext();
48009
48010 JS::Rooted<JS::Value> rval(cx);
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->receiveUnsignedLong_id, &callable)) {
48017 aRv.Throw(NS_ERROR_UNEXPECTED);
48018 return uint32_t(0);
48019 }
48020 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48021 if (!JS::Call(cx, thisValue, callable,
48022 JS::HandleValueArray::empty(), &rval)) {
48023 aRv.NoteJSContextException(cx);
48024 return uint32_t(0);
48025 }
48026 uint32_t rvalDecl;
48027 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLong", &rvalDecl)) {
48028 aRv.Throw(NS_ERROR_UNEXPECTED);
48029 return uint32_t(0);
48030 }
48031 return rvalDecl;
48032}
48033
48034void
48035TestJSImplInterfaceJSImpl::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
48036{
48037 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48038 if (aRv.Failed()) {
48039 return;
48040 }
48041 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48041); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48041); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48042 BindingCallContext& cx = s.GetCallContext();
48043
48044 JS::Rooted<JS::Value> rval(cx);
48045 JS::RootedVector<JS::Value> argv(cx);
48046 if (!argv.resize(1)) {
48047 // That threw an exception on the JSContext, and our CallSetup will do
48048 // the right thing with that.
48049 return;
48050 }
48051 unsigned argc = 1;
48052
48053 do {
48054 if (arg.WasPassed()) {
48055 argv[0].setNumber(arg.Value());
48056 break;
48057 } else if (argc == 1) {
48058 // This is our current trailing argument; reduce argc
48059 --argc;
48060 } else {
48061 argv[0].setUndefined();
48062 }
48063 } while (false);
48064
48065 JS::Rooted<JS::Value> callable(cx);
48066 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48067 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48068 !InitIds(cx, atomsCache)) ||
48069 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLong_id, &callable)) {
48070 aRv.Throw(NS_ERROR_UNEXPECTED);
48071 return;
48072 }
48073 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48074 if (!JS::Call(cx, thisValue, callable,
48075 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48076 aRv.NoteJSContextException(cx);
48077 return;
48078 }
48079}
48080
48081void
48082TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
48083{
48084 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48085 if (aRv.Failed()) {
48086 return;
48087 }
48088 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48088); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48088); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48089 BindingCallContext& cx = s.GetCallContext();
48090
48091 JS::Rooted<JS::Value> rval(cx);
48092 JS::RootedVector<JS::Value> argv(cx);
48093 if (!argv.resize(1)) {
48094 // That threw an exception on the JSContext, and our CallSetup will do
48095 // the right thing with that.
48096 return;
48097 }
48098 unsigned argc = 1;
48099
48100 do {
48101 argv[0].setNumber(arg);
48102 break;
48103 } while (false);
48104
48105 JS::Rooted<JS::Value> callable(cx);
48106 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48107 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48108 !InitIds(cx, atomsCache)) ||
48109 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongWithDefault_id, &callable)) {
48110 aRv.Throw(NS_ERROR_UNEXPECTED);
48111 return;
48112 }
48113 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48114 if (!JS::Call(cx, thisValue, callable,
48115 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48116 aRv.NoteJSContextException(cx);
48117 return;
48118 }
48119}
48120
48121void
48122TestJSImplInterfaceJSImpl::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
48123{
48124 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48125 if (aRv.Failed()) {
48126 return;
48127 }
48128 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48128); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48129 BindingCallContext& cx = s.GetCallContext();
48130
48131 JS::Rooted<JS::Value> rval(cx);
48132 JS::RootedVector<JS::Value> argv(cx);
48133 if (!argv.resize(1)) {
48134 // That threw an exception on the JSContext, and our CallSetup will do
48135 // the right thing with that.
48136 return;
48137 }
48138 unsigned argc = 1;
48139
48140 do {
48141 argv[0].set(JS_NumberValue(double(arg)));
48142 break;
48143 } while (false);
48144
48145 JS::Rooted<JS::Value> callable(cx);
48146 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48147 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48148 !InitIds(cx, atomsCache)) ||
48149 !GetCallableProperty(cx, atomsCache->passUnsignedLongLong_id, &callable)) {
48150 aRv.Throw(NS_ERROR_UNEXPECTED);
48151 return;
48152 }
48153 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48154 if (!JS::Call(cx, thisValue, callable,
48155 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48156 aRv.NoteJSContextException(cx);
48157 return;
48158 }
48159}
48160
48161uint64_t
48162TestJSImplInterfaceJSImpl::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
48163{
48164 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48165 if (aRv.Failed()) {
48166 return uint64_t(0);
48167 }
48168 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48168); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48168); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48169 BindingCallContext& cx = s.GetCallContext();
48170
48171 JS::Rooted<JS::Value> rval(cx);
48172
48173 JS::Rooted<JS::Value> callable(cx);
48174 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48175 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48176 !InitIds(cx, atomsCache)) ||
48177 !GetCallableProperty(cx, atomsCache->receiveUnsignedLongLong_id, &callable)) {
48178 aRv.Throw(NS_ERROR_UNEXPECTED);
48179 return uint64_t(0);
48180 }
48181 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48182 if (!JS::Call(cx, thisValue, callable,
48183 JS::HandleValueArray::empty(), &rval)) {
48184 aRv.NoteJSContextException(cx);
48185 return uint64_t(0);
48186 }
48187 uint64_t rvalDecl;
48188 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLongLong", &rvalDecl)) {
48189 aRv.Throw(NS_ERROR_UNEXPECTED);
48190 return uint64_t(0);
48191 }
48192 return rvalDecl;
48193}
48194
48195void
48196TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
48197{
48198 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48199 if (aRv.Failed()) {
48200 return;
48201 }
48202 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48202); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48202); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48203 BindingCallContext& cx = s.GetCallContext();
48204
48205 JS::Rooted<JS::Value> rval(cx);
48206 JS::RootedVector<JS::Value> argv(cx);
48207 if (!argv.resize(1)) {
48208 // That threw an exception on the JSContext, and our CallSetup will do
48209 // the right thing with that.
48210 return;
48211 }
48212 unsigned argc = 1;
48213
48214 do {
48215 if (arg.WasPassed()) {
48216 argv[0].set(JS_NumberValue(double(arg.Value())));
48217 break;
48218 } else if (argc == 1) {
48219 // This is our current trailing argument; reduce argc
48220 --argc;
48221 } else {
48222 argv[0].setUndefined();
48223 }
48224 } while (false);
48225
48226 JS::Rooted<JS::Value> callable(cx);
48227 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48228 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48229 !InitIds(cx, atomsCache)) ||
48230 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLong_id, &callable)) {
48231 aRv.Throw(NS_ERROR_UNEXPECTED);
48232 return;
48233 }
48234 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48235 if (!JS::Call(cx, thisValue, callable,
48236 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48237 aRv.NoteJSContextException(cx);
48238 return;
48239 }
48240}
48241
48242void
48243TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
48244{
48245 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48246 if (aRv.Failed()) {
48247 return;
48248 }
48249 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48249); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48249); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48250 BindingCallContext& cx = s.GetCallContext();
48251
48252 JS::Rooted<JS::Value> rval(cx);
48253 JS::RootedVector<JS::Value> argv(cx);
48254 if (!argv.resize(1)) {
48255 // That threw an exception on the JSContext, and our CallSetup will do
48256 // the right thing with that.
48257 return;
48258 }
48259 unsigned argc = 1;
48260
48261 do {
48262 argv[0].set(JS_NumberValue(double(arg)));
48263 break;
48264 } while (false);
48265
48266 JS::Rooted<JS::Value> callable(cx);
48267 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48268 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48269 !InitIds(cx, atomsCache)) ||
48270 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLongWithDefault_id, &callable)) {
48271 aRv.Throw(NS_ERROR_UNEXPECTED);
48272 return;
48273 }
48274 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48275 if (!JS::Call(cx, thisValue, callable,
48276 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48277 aRv.NoteJSContextException(cx);
48278 return;
48279 }
48280}
48281
48282void
48283TestJSImplInterfaceJSImpl::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)
48284{
48285 CallSetup s(this, aRv, "TestJSImplInterface.passFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48286 if (aRv.Failed()) {
48287 return;
48288 }
48289 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48289); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48289); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48290 BindingCallContext& cx = s.GetCallContext();
48291
48292 JS::Rooted<JS::Value> rval(cx);
48293 JS::RootedVector<JS::Value> argv(cx);
48294 if (!argv.resize(16)) {
48295 // That threw an exception on the JSContext, and our CallSetup will do
48296 // the right thing with that.
48297 return;
48298 }
48299 unsigned argc = 16;
48300
48301 do {
48302
48303 uint32_t length = arg16.Length();
48304 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48305 if (!returnArray) {
48306 aRv.Throw(NS_ERROR_UNEXPECTED);
48307 return;
48308 }
48309 // Scope for 'tmp'
48310 {
48311 JS::Rooted<JS::Value> tmp(cx);
48312 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48313 // Control block to let us common up the JS_DefineElement calls when there
48314 // are different ways to succeed at wrapping the object.
48315 do {
48316 if (arg16[sequenceIdx0].IsNull()) {
48317 tmp.setNull();
48318 break;
48319 }
48320 tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value())));
48321 break;
48322 } while (false);
48323 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48324 JSPROP_ENUMERATE)) {
48325 aRv.Throw(NS_ERROR_UNEXPECTED);
48326 return;
48327 }
48328 }
48329 }
48330 argv[15].setObject(*returnArray);
48331 break;
48332 } while (false);
48333
48334 do {
48335
48336 uint32_t length = arg15.Length();
48337 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48338 if (!returnArray) {
48339 aRv.Throw(NS_ERROR_UNEXPECTED);
48340 return;
48341 }
48342 // Scope for 'tmp'
48343 {
48344 JS::Rooted<JS::Value> tmp(cx);
48345 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48346 // Control block to let us common up the JS_DefineElement calls when there
48347 // are different ways to succeed at wrapping the object.
48348 do {
48349 if (arg15[sequenceIdx0].IsNull()) {
48350 tmp.setNull();
48351 break;
48352 }
48353 tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value())));
48354 break;
48355 } while (false);
48356 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48357 JSPROP_ENUMERATE)) {
48358 aRv.Throw(NS_ERROR_UNEXPECTED);
48359 return;
48360 }
48361 }
48362 }
48363 argv[14].setObject(*returnArray);
48364 break;
48365 } while (false);
48366
48367 do {
48368
48369 uint32_t length = arg14.Length();
48370 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48371 if (!returnArray) {
48372 aRv.Throw(NS_ERROR_UNEXPECTED);
48373 return;
48374 }
48375 // Scope for 'tmp'
48376 {
48377 JS::Rooted<JS::Value> tmp(cx);
48378 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48379 // Control block to let us common up the JS_DefineElement calls when there
48380 // are different ways to succeed at wrapping the object.
48381 do {
48382 tmp.set(JS_NumberValue(double(arg14[sequenceIdx0])));
48383 break;
48384 } while (false);
48385 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48386 JSPROP_ENUMERATE)) {
48387 aRv.Throw(NS_ERROR_UNEXPECTED);
48388 return;
48389 }
48390 }
48391 }
48392 argv[13].setObject(*returnArray);
48393 break;
48394 } while (false);
48395
48396 do {
48397
48398 uint32_t length = arg13.Length();
48399 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48400 if (!returnArray) {
48401 aRv.Throw(NS_ERROR_UNEXPECTED);
48402 return;
48403 }
48404 // Scope for 'tmp'
48405 {
48406 JS::Rooted<JS::Value> tmp(cx);
48407 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48408 // Control block to let us common up the JS_DefineElement calls when there
48409 // are different ways to succeed at wrapping the object.
48410 do {
48411 tmp.set(JS_NumberValue(double(arg13[sequenceIdx0])));
48412 break;
48413 } while (false);
48414 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48415 JSPROP_ENUMERATE)) {
48416 aRv.Throw(NS_ERROR_UNEXPECTED);
48417 return;
48418 }
48419 }
48420 }
48421 argv[12].setObject(*returnArray);
48422 break;
48423 } while (false);
48424
48425 do {
48426
48427 uint32_t length = arg12.Length();
48428 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48429 if (!returnArray) {
48430 aRv.Throw(NS_ERROR_UNEXPECTED);
48431 return;
48432 }
48433 // Scope for 'tmp'
48434 {
48435 JS::Rooted<JS::Value> tmp(cx);
48436 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48437 // Control block to let us common up the JS_DefineElement calls when there
48438 // are different ways to succeed at wrapping the object.
48439 do {
48440 if (arg12[sequenceIdx0].IsNull()) {
48441 tmp.setNull();
48442 break;
48443 }
48444 tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value())));
48445 break;
48446 } while (false);
48447 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48448 JSPROP_ENUMERATE)) {
48449 aRv.Throw(NS_ERROR_UNEXPECTED);
48450 return;
48451 }
48452 }
48453 }
48454 argv[11].setObject(*returnArray);
48455 break;
48456 } while (false);
48457
48458 do {
48459
48460 uint32_t length = arg11.Length();
48461 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48462 if (!returnArray) {
48463 aRv.Throw(NS_ERROR_UNEXPECTED);
48464 return;
48465 }
48466 // Scope for 'tmp'
48467 {
48468 JS::Rooted<JS::Value> tmp(cx);
48469 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48470 // Control block to let us common up the JS_DefineElement calls when there
48471 // are different ways to succeed at wrapping the object.
48472 do {
48473 if (arg11[sequenceIdx0].IsNull()) {
48474 tmp.setNull();
48475 break;
48476 }
48477 tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value())));
48478 break;
48479 } while (false);
48480 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48481 JSPROP_ENUMERATE)) {
48482 aRv.Throw(NS_ERROR_UNEXPECTED);
48483 return;
48484 }
48485 }
48486 }
48487 argv[10].setObject(*returnArray);
48488 break;
48489 } while (false);
48490
48491 do {
48492
48493 uint32_t length = arg10.Length();
48494 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48495 if (!returnArray) {
48496 aRv.Throw(NS_ERROR_UNEXPECTED);
48497 return;
48498 }
48499 // Scope for 'tmp'
48500 {
48501 JS::Rooted<JS::Value> tmp(cx);
48502 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48503 // Control block to let us common up the JS_DefineElement calls when there
48504 // are different ways to succeed at wrapping the object.
48505 do {
48506 tmp.set(JS_NumberValue(double(arg10[sequenceIdx0])));
48507 break;
48508 } while (false);
48509 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48510 JSPROP_ENUMERATE)) {
48511 aRv.Throw(NS_ERROR_UNEXPECTED);
48512 return;
48513 }
48514 }
48515 }
48516 argv[9].setObject(*returnArray);
48517 break;
48518 } while (false);
48519
48520 do {
48521
48522 uint32_t length = arg9.Length();
48523 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48524 if (!returnArray) {
48525 aRv.Throw(NS_ERROR_UNEXPECTED);
48526 return;
48527 }
48528 // Scope for 'tmp'
48529 {
48530 JS::Rooted<JS::Value> tmp(cx);
48531 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48532 // Control block to let us common up the JS_DefineElement calls when there
48533 // are different ways to succeed at wrapping the object.
48534 do {
48535 tmp.set(JS_NumberValue(double(arg9[sequenceIdx0])));
48536 break;
48537 } while (false);
48538 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48539 JSPROP_ENUMERATE)) {
48540 aRv.Throw(NS_ERROR_UNEXPECTED);
48541 return;
48542 }
48543 }
48544 }
48545 argv[8].setObject(*returnArray);
48546 break;
48547 } while (false);
48548
48549 do {
48550 if (arg8.IsNull()) {
48551 argv[7].setNull();
48552 break;
48553 }
48554 argv[7].set(JS_NumberValue(double(arg8.Value())));
48555 break;
48556 } while (false);
48557
48558 do {
48559 if (arg7.IsNull()) {
48560 argv[6].setNull();
48561 break;
48562 }
48563 argv[6].set(JS_NumberValue(double(arg7.Value())));
48564 break;
48565 } while (false);
48566
48567 do {
48568 argv[5].set(JS_NumberValue(double(arg6)));
48569 break;
48570 } while (false);
48571
48572 do {
48573 argv[4].set(JS_NumberValue(double(arg5)));
48574 break;
48575 } while (false);
48576
48577 do {
48578 if (arg4.IsNull()) {
48579 argv[3].setNull();
48580 break;
48581 }
48582 argv[3].set(JS_NumberValue(double(arg4.Value())));
48583 break;
48584 } while (false);
48585
48586 do {
48587 if (arg3.IsNull()) {
48588 argv[2].setNull();
48589 break;
48590 }
48591 argv[2].set(JS_NumberValue(double(arg3.Value())));
48592 break;
48593 } while (false);
48594
48595 do {
48596 argv[1].set(JS_NumberValue(double(arg2)));
48597 break;
48598 } while (false);
48599
48600 do {
48601 argv[0].set(JS_NumberValue(double(arg1)));
48602 break;
48603 } while (false);
48604
48605 JS::Rooted<JS::Value> callable(cx);
48606 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48607 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48608 !InitIds(cx, atomsCache)) ||
48609 !GetCallableProperty(cx, atomsCache->passFloat_id, &callable)) {
48610 aRv.Throw(NS_ERROR_UNEXPECTED);
48611 return;
48612 }
48613 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48614 if (!JS::Call(cx, thisValue, callable,
48615 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48616 aRv.NoteJSContextException(cx);
48617 return;
48618 }
48619}
48620
48621void
48622TestJSImplInterfaceJSImpl::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)
48623{
48624 CallSetup s(this, aRv, "TestJSImplInterface.passLenientFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48625 if (aRv.Failed()) {
48626 return;
48627 }
48628 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48628); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48628); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48629 BindingCallContext& cx = s.GetCallContext();
48630
48631 JS::Rooted<JS::Value> rval(cx);
48632 JS::RootedVector<JS::Value> argv(cx);
48633 if (!argv.resize(16)) {
48634 // That threw an exception on the JSContext, and our CallSetup will do
48635 // the right thing with that.
48636 return;
48637 }
48638 unsigned argc = 16;
48639
48640 do {
48641
48642 uint32_t length = arg16.Length();
48643 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48644 if (!returnArray) {
48645 aRv.Throw(NS_ERROR_UNEXPECTED);
48646 return;
48647 }
48648 // Scope for 'tmp'
48649 {
48650 JS::Rooted<JS::Value> tmp(cx);
48651 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48652 // Control block to let us common up the JS_DefineElement calls when there
48653 // are different ways to succeed at wrapping the object.
48654 do {
48655 if (arg16[sequenceIdx0].IsNull()) {
48656 tmp.setNull();
48657 break;
48658 }
48659 tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value())));
48660 break;
48661 } while (false);
48662 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48663 JSPROP_ENUMERATE)) {
48664 aRv.Throw(NS_ERROR_UNEXPECTED);
48665 return;
48666 }
48667 }
48668 }
48669 argv[15].setObject(*returnArray);
48670 break;
48671 } while (false);
48672
48673 do {
48674
48675 uint32_t length = arg15.Length();
48676 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48677 if (!returnArray) {
48678 aRv.Throw(NS_ERROR_UNEXPECTED);
48679 return;
48680 }
48681 // Scope for 'tmp'
48682 {
48683 JS::Rooted<JS::Value> tmp(cx);
48684 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48685 // Control block to let us common up the JS_DefineElement calls when there
48686 // are different ways to succeed at wrapping the object.
48687 do {
48688 if (arg15[sequenceIdx0].IsNull()) {
48689 tmp.setNull();
48690 break;
48691 }
48692 tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value())));
48693 break;
48694 } while (false);
48695 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48696 JSPROP_ENUMERATE)) {
48697 aRv.Throw(NS_ERROR_UNEXPECTED);
48698 return;
48699 }
48700 }
48701 }
48702 argv[14].setObject(*returnArray);
48703 break;
48704 } while (false);
48705
48706 do {
48707
48708 uint32_t length = arg14.Length();
48709 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48710 if (!returnArray) {
48711 aRv.Throw(NS_ERROR_UNEXPECTED);
48712 return;
48713 }
48714 // Scope for 'tmp'
48715 {
48716 JS::Rooted<JS::Value> tmp(cx);
48717 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48718 // Control block to let us common up the JS_DefineElement calls when there
48719 // are different ways to succeed at wrapping the object.
48720 do {
48721 tmp.set(JS_NumberValue(double(arg14[sequenceIdx0])));
48722 break;
48723 } while (false);
48724 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48725 JSPROP_ENUMERATE)) {
48726 aRv.Throw(NS_ERROR_UNEXPECTED);
48727 return;
48728 }
48729 }
48730 }
48731 argv[13].setObject(*returnArray);
48732 break;
48733 } while (false);
48734
48735 do {
48736
48737 uint32_t length = arg13.Length();
48738 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48739 if (!returnArray) {
48740 aRv.Throw(NS_ERROR_UNEXPECTED);
48741 return;
48742 }
48743 // Scope for 'tmp'
48744 {
48745 JS::Rooted<JS::Value> tmp(cx);
48746 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48747 // Control block to let us common up the JS_DefineElement calls when there
48748 // are different ways to succeed at wrapping the object.
48749 do {
48750 tmp.set(JS_NumberValue(double(arg13[sequenceIdx0])));
48751 break;
48752 } while (false);
48753 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48754 JSPROP_ENUMERATE)) {
48755 aRv.Throw(NS_ERROR_UNEXPECTED);
48756 return;
48757 }
48758 }
48759 }
48760 argv[12].setObject(*returnArray);
48761 break;
48762 } while (false);
48763
48764 do {
48765
48766 uint32_t length = arg12.Length();
48767 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48768 if (!returnArray) {
48769 aRv.Throw(NS_ERROR_UNEXPECTED);
48770 return;
48771 }
48772 // Scope for 'tmp'
48773 {
48774 JS::Rooted<JS::Value> tmp(cx);
48775 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48776 // Control block to let us common up the JS_DefineElement calls when there
48777 // are different ways to succeed at wrapping the object.
48778 do {
48779 if (arg12[sequenceIdx0].IsNull()) {
48780 tmp.setNull();
48781 break;
48782 }
48783 tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value())));
48784 break;
48785 } while (false);
48786 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48787 JSPROP_ENUMERATE)) {
48788 aRv.Throw(NS_ERROR_UNEXPECTED);
48789 return;
48790 }
48791 }
48792 }
48793 argv[11].setObject(*returnArray);
48794 break;
48795 } while (false);
48796
48797 do {
48798
48799 uint32_t length = arg11.Length();
48800 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48801 if (!returnArray) {
48802 aRv.Throw(NS_ERROR_UNEXPECTED);
48803 return;
48804 }
48805 // Scope for 'tmp'
48806 {
48807 JS::Rooted<JS::Value> tmp(cx);
48808 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48809 // Control block to let us common up the JS_DefineElement calls when there
48810 // are different ways to succeed at wrapping the object.
48811 do {
48812 if (arg11[sequenceIdx0].IsNull()) {
48813 tmp.setNull();
48814 break;
48815 }
48816 tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value())));
48817 break;
48818 } while (false);
48819 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48820 JSPROP_ENUMERATE)) {
48821 aRv.Throw(NS_ERROR_UNEXPECTED);
48822 return;
48823 }
48824 }
48825 }
48826 argv[10].setObject(*returnArray);
48827 break;
48828 } while (false);
48829
48830 do {
48831
48832 uint32_t length = arg10.Length();
48833 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48834 if (!returnArray) {
48835 aRv.Throw(NS_ERROR_UNEXPECTED);
48836 return;
48837 }
48838 // Scope for 'tmp'
48839 {
48840 JS::Rooted<JS::Value> tmp(cx);
48841 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48842 // Control block to let us common up the JS_DefineElement calls when there
48843 // are different ways to succeed at wrapping the object.
48844 do {
48845 tmp.set(JS_NumberValue(double(arg10[sequenceIdx0])));
48846 break;
48847 } while (false);
48848 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48849 JSPROP_ENUMERATE)) {
48850 aRv.Throw(NS_ERROR_UNEXPECTED);
48851 return;
48852 }
48853 }
48854 }
48855 argv[9].setObject(*returnArray);
48856 break;
48857 } while (false);
48858
48859 do {
48860
48861 uint32_t length = arg9.Length();
48862 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48863 if (!returnArray) {
48864 aRv.Throw(NS_ERROR_UNEXPECTED);
48865 return;
48866 }
48867 // Scope for 'tmp'
48868 {
48869 JS::Rooted<JS::Value> tmp(cx);
48870 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48871 // Control block to let us common up the JS_DefineElement calls when there
48872 // are different ways to succeed at wrapping the object.
48873 do {
48874 tmp.set(JS_NumberValue(double(arg9[sequenceIdx0])));
48875 break;
48876 } while (false);
48877 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48878 JSPROP_ENUMERATE)) {
48879 aRv.Throw(NS_ERROR_UNEXPECTED);
48880 return;
48881 }
48882 }
48883 }
48884 argv[8].setObject(*returnArray);
48885 break;
48886 } while (false);
48887
48888 do {
48889 if (arg8.IsNull()) {
48890 argv[7].setNull();
48891 break;
48892 }
48893 argv[7].set(JS_NumberValue(double(arg8.Value())));
48894 break;
48895 } while (false);
48896
48897 do {
48898 if (arg7.IsNull()) {
48899 argv[6].setNull();
48900 break;
48901 }
48902 argv[6].set(JS_NumberValue(double(arg7.Value())));
48903 break;
48904 } while (false);
48905
48906 do {
48907 argv[5].set(JS_NumberValue(double(arg6)));
48908 break;
48909 } while (false);
48910
48911 do {
48912 argv[4].set(JS_NumberValue(double(arg5)));
48913 break;
48914 } while (false);
48915
48916 do {
48917 if (arg4.IsNull()) {
48918 argv[3].setNull();
48919 break;
48920 }
48921 argv[3].set(JS_NumberValue(double(arg4.Value())));
48922 break;
48923 } while (false);
48924
48925 do {
48926 if (arg3.IsNull()) {
48927 argv[2].setNull();
48928 break;
48929 }
48930 argv[2].set(JS_NumberValue(double(arg3.Value())));
48931 break;
48932 } while (false);
48933
48934 do {
48935 argv[1].set(JS_NumberValue(double(arg2)));
48936 break;
48937 } while (false);
48938
48939 do {
48940 argv[0].set(JS_NumberValue(double(arg1)));
48941 break;
48942 } while (false);
48943
48944 JS::Rooted<JS::Value> callable(cx);
48945 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48946 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48947 !InitIds(cx, atomsCache)) ||
48948 !GetCallableProperty(cx, atomsCache->passLenientFloat_id, &callable)) {
48949 aRv.Throw(NS_ERROR_UNEXPECTED);
48950 return;
48951 }
48952 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48953 if (!JS::Call(cx, thisValue, callable,
48954 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48955 aRv.NoteJSContextException(cx);
48956 return;
48957 }
48958}
48959
48960already_AddRefed<TestJSImplInterface>
48961TestJSImplInterfaceJSImpl::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm)
48962{
48963 CallSetup s(this, aRv, "TestJSImplInterface.receiveSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48964 if (aRv.Failed()) {
48965 return nullptr;
48966 }
48967 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 48967); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
48968 BindingCallContext& cx = s.GetCallContext();
48969
48970 JS::Rooted<JS::Value> rval(cx);
48971
48972 JS::Rooted<JS::Value> callable(cx);
48973 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48974 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48975 !InitIds(cx, atomsCache)) ||
48976 !GetCallableProperty(cx, atomsCache->receiveSelf_id, &callable)) {
48977 aRv.Throw(NS_ERROR_UNEXPECTED);
48978 return nullptr;
48979 }
48980 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48981 if (!JS::Call(cx, thisValue, callable,
48982 JS::HandleValueArray::empty(), &rval)) {
48983 aRv.NoteJSContextException(cx);
48984 return nullptr;
48985 }
48986 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
48987 if (rval.isObject()) {
48988 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
48989 {
48990 // Our JSContext should be in the right global to do unwrapping in.
48991 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
48992 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
48993 // Be careful to not wrap random DOM objects here, even if
48994 // they're wrapped in opaque security wrappers for some reason.
48995 // XXXbz Wish we could check for a JS-implemented object
48996 // that already has a content reflection...
48997 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
48998 nsCOMPtr<nsIGlobalObject> contentGlobal;
48999 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
49000 if (!callback ||
49001 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49002 aRv.Throw(NS_ERROR_UNEXPECTED);
49003 return nullptr;
49004 }
49005 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49006 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", 49007); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49007); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49007 "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", 49007); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49007); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49008 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49009 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49010 } else {
49011 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveSelf", "TestJSImplInterface");
49012 aRv.Throw(NS_ERROR_UNEXPECTED);
49013 return nullptr;
49014 }
49015 }
49016 }
49017 } else {
49018 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveSelf");
49019 aRv.Throw(NS_ERROR_UNEXPECTED);
49020 return nullptr;
49021 }
49022 return rvalDecl.forget();
49023}
49024
49025already_AddRefed<TestJSImplInterface>
49026TestJSImplInterfaceJSImpl::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
49027{
49028 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49029 if (aRv.Failed()) {
49030 return nullptr;
49031 }
49032 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49032); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49032); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49033 BindingCallContext& cx = s.GetCallContext();
49034
49035 JS::Rooted<JS::Value> rval(cx);
49036
49037 JS::Rooted<JS::Value> callable(cx);
49038 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49039 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49040 !InitIds(cx, atomsCache)) ||
49041 !GetCallableProperty(cx, atomsCache->receiveNullableSelf_id, &callable)) {
49042 aRv.Throw(NS_ERROR_UNEXPECTED);
49043 return nullptr;
49044 }
49045 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49046 if (!JS::Call(cx, thisValue, callable,
49047 JS::HandleValueArray::empty(), &rval)) {
49048 aRv.NoteJSContextException(cx);
49049 return nullptr;
49050 }
49051 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
49052 if (rval.isObject()) {
49053 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
49054 {
49055 // Our JSContext should be in the right global to do unwrapping in.
49056 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
49057 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49058 // Be careful to not wrap random DOM objects here, even if
49059 // they're wrapped in opaque security wrappers for some reason.
49060 // XXXbz Wish we could check for a JS-implemented object
49061 // that already has a content reflection...
49062 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
49063 nsCOMPtr<nsIGlobalObject> contentGlobal;
49064 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
49065 if (!callback ||
49066 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49067 aRv.Throw(NS_ERROR_UNEXPECTED);
49068 return nullptr;
49069 }
49070 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49071 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", 49072); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49072); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49072 "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", 49072); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49072); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49073 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49074 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49075 } else {
49076 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableSelf", "TestJSImplInterface");
49077 aRv.Throw(NS_ERROR_UNEXPECTED);
49078 return nullptr;
49079 }
49080 }
49081 }
49082 } else if (rval.isNullOrUndefined()) {
49083 rvalDecl = nullptr;
49084 } else {
49085 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableSelf");
49086 aRv.Throw(NS_ERROR_UNEXPECTED);
49087 return nullptr;
49088 }
49089 return rvalDecl.forget();
49090}
49091
49092already_AddRefed<TestJSImplInterface>
49093TestJSImplInterfaceJSImpl::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm)
49094{
49095 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49096 if (aRv.Failed()) {
49097 return nullptr;
49098 }
49099 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49099); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49100 BindingCallContext& cx = s.GetCallContext();
49101
49102 JS::Rooted<JS::Value> rval(cx);
49103
49104 JS::Rooted<JS::Value> callable(cx);
49105 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49106 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49107 !InitIds(cx, atomsCache)) ||
49108 !GetCallableProperty(cx, atomsCache->receiveWeakSelf_id, &callable)) {
49109 aRv.Throw(NS_ERROR_UNEXPECTED);
49110 return nullptr;
49111 }
49112 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49113 if (!JS::Call(cx, thisValue, callable,
49114 JS::HandleValueArray::empty(), &rval)) {
49115 aRv.NoteJSContextException(cx);
49116 return nullptr;
49117 }
49118 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
49119 if (rval.isObject()) {
49120 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
49121 {
49122 // Our JSContext should be in the right global to do unwrapping in.
49123 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
49124 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49125 // Be careful to not wrap random DOM objects here, even if
49126 // they're wrapped in opaque security wrappers for some reason.
49127 // XXXbz Wish we could check for a JS-implemented object
49128 // that already has a content reflection...
49129 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
49130 nsCOMPtr<nsIGlobalObject> contentGlobal;
49131 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
49132 if (!callback ||
49133 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49134 aRv.Throw(NS_ERROR_UNEXPECTED);
49135 return nullptr;
49136 }
49137 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49138 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", 49139); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49139); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49139 "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", 49139); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49139); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49140 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49141 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49142 } else {
49143 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakSelf", "TestJSImplInterface");
49144 aRv.Throw(NS_ERROR_UNEXPECTED);
49145 return nullptr;
49146 }
49147 }
49148 }
49149 } else {
49150 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakSelf");
49151 aRv.Throw(NS_ERROR_UNEXPECTED);
49152 return nullptr;
49153 }
49154 return rvalDecl.forget();
49155}
49156
49157already_AddRefed<TestJSImplInterface>
49158TestJSImplInterfaceJSImpl::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
49159{
49160 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49161 if (aRv.Failed()) {
49162 return nullptr;
49163 }
49164 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49164); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49164); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49165 BindingCallContext& cx = s.GetCallContext();
49166
49167 JS::Rooted<JS::Value> rval(cx);
49168
49169 JS::Rooted<JS::Value> callable(cx);
49170 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49171 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49172 !InitIds(cx, atomsCache)) ||
49173 !GetCallableProperty(cx, atomsCache->receiveWeakNullableSelf_id, &callable)) {
49174 aRv.Throw(NS_ERROR_UNEXPECTED);
49175 return nullptr;
49176 }
49177 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49178 if (!JS::Call(cx, thisValue, callable,
49179 JS::HandleValueArray::empty(), &rval)) {
49180 aRv.NoteJSContextException(cx);
49181 return nullptr;
49182 }
49183 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
49184 if (rval.isObject()) {
49185 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
49186 {
49187 // Our JSContext should be in the right global to do unwrapping in.
49188 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
49189 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49190 // Be careful to not wrap random DOM objects here, even if
49191 // they're wrapped in opaque security wrappers for some reason.
49192 // XXXbz Wish we could check for a JS-implemented object
49193 // that already has a content reflection...
49194 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
49195 nsCOMPtr<nsIGlobalObject> contentGlobal;
49196 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
49197 if (!callback ||
49198 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49199 aRv.Throw(NS_ERROR_UNEXPECTED);
49200 return nullptr;
49201 }
49202 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49203 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", 49204); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49204); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49204 "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", 49204); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 49204); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49205 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49206 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49207 } else {
49208 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableSelf", "TestJSImplInterface");
49209 aRv.Throw(NS_ERROR_UNEXPECTED);
49210 return nullptr;
49211 }
49212 }
49213 }
49214 } else if (rval.isNullOrUndefined()) {
49215 rvalDecl = nullptr;
49216 } else {
49217 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableSelf");
49218 aRv.Throw(NS_ERROR_UNEXPECTED);
49219 return nullptr;
49220 }
49221 return rvalDecl.forget();
49222}
49223
49224void
49225TestJSImplInterfaceJSImpl::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
49226{
49227 CallSetup s(this, aRv, "TestJSImplInterface.passSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49228 if (aRv.Failed()) {
49229 return;
49230 }
49231 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49231); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49232 BindingCallContext& cx = s.GetCallContext();
49233
49234 JS::Rooted<JS::Value> rval(cx);
49235 JS::RootedVector<JS::Value> argv(cx);
49236 if (!argv.resize(1)) {
49237 // That threw an exception on the JSContext, and our CallSetup will do
49238 // the right thing with that.
49239 return;
49240 }
49241 unsigned argc = 1;
49242
49243 do {
49244 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49245 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49245); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 49245); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49246 aRv.Throw(NS_ERROR_UNEXPECTED);
49247 return;
49248 }
49249 break;
49250 } while (false);
49251
49252 JS::Rooted<JS::Value> callable(cx);
49253 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49254 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49255 !InitIds(cx, atomsCache)) ||
49256 !GetCallableProperty(cx, atomsCache->passSelf_id, &callable)) {
49257 aRv.Throw(NS_ERROR_UNEXPECTED);
49258 return;
49259 }
49260 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49261 if (!JS::Call(cx, thisValue, callable,
49262 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49263 aRv.NoteJSContextException(cx);
49264 return;
49265 }
49266}
49267
49268void
49269TestJSImplInterfaceJSImpl::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
49270{
49271 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49272 if (aRv.Failed()) {
49273 return;
49274 }
49275 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49275); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49275); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49276 BindingCallContext& cx = s.GetCallContext();
49277
49278 JS::Rooted<JS::Value> rval(cx);
49279 JS::RootedVector<JS::Value> argv(cx);
49280 if (!argv.resize(1)) {
49281 // That threw an exception on the JSContext, and our CallSetup will do
49282 // the right thing with that.
49283 return;
49284 }
49285 unsigned argc = 1;
49286
49287 do {
49288 if (!arg) {
49289 argv[0].setNull();
49290 break;
49291 }
49292 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49293 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49293); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 49293); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49294 aRv.Throw(NS_ERROR_UNEXPECTED);
49295 return;
49296 }
49297 break;
49298 } while (false);
49299
49300 JS::Rooted<JS::Value> callable(cx);
49301 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49302 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49303 !InitIds(cx, atomsCache)) ||
49304 !GetCallableProperty(cx, atomsCache->passNullableSelf_id, &callable)) {
49305 aRv.Throw(NS_ERROR_UNEXPECTED);
49306 return;
49307 }
49308 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49309 if (!JS::Call(cx, thisValue, callable,
49310 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49311 aRv.NoteJSContextException(cx);
49312 return;
49313 }
49314}
49315
49316void
49317TestJSImplInterfaceJSImpl::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
49318{
49319 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49320 if (aRv.Failed()) {
49321 return;
49322 }
49323 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49323); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49324 BindingCallContext& cx = s.GetCallContext();
49325
49326 JS::Rooted<JS::Value> rval(cx);
49327 JS::RootedVector<JS::Value> argv(cx);
49328 if (!argv.resize(1)) {
49329 // That threw an exception on the JSContext, and our CallSetup will do
49330 // the right thing with that.
49331 return;
49332 }
49333 unsigned argc = 1;
49334
49335 do {
49336 if (arg.WasPassed()) {
49337 if (!arg.Value()) {
49338 argv[0].setNull();
49339 break;
49340 }
49341 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
49342 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 49342); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49343 aRv.Throw(NS_ERROR_UNEXPECTED);
49344 return;
49345 }
49346 break;
49347 } else if (argc == 1) {
49348 // This is our current trailing argument; reduce argc
49349 --argc;
49350 } else {
49351 argv[0].setUndefined();
49352 }
49353 } while (false);
49354
49355 JS::Rooted<JS::Value> callable(cx);
49356 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49357 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49358 !InitIds(cx, atomsCache)) ||
49359 !GetCallableProperty(cx, atomsCache->passOptionalSelf_id, &callable)) {
49360 aRv.Throw(NS_ERROR_UNEXPECTED);
49361 return;
49362 }
49363 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49364 if (!JS::Call(cx, thisValue, callable,
49365 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49366 aRv.NoteJSContextException(cx);
49367 return;
49368 }
49369}
49370
49371void
49372TestJSImplInterfaceJSImpl::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
49373{
49374 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49375 if (aRv.Failed()) {
49376 return;
49377 }
49378 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49378); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49378); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49379 BindingCallContext& cx = s.GetCallContext();
49380
49381 JS::Rooted<JS::Value> rval(cx);
49382 JS::RootedVector<JS::Value> argv(cx);
49383 if (!argv.resize(1)) {
49384 // That threw an exception on the JSContext, and our CallSetup will do
49385 // the right thing with that.
49386 return;
49387 }
49388 unsigned argc = 1;
49389
49390 do {
49391 if (arg.WasPassed()) {
49392 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
49393 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49393); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 49393); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49394 aRv.Throw(NS_ERROR_UNEXPECTED);
49395 return;
49396 }
49397 break;
49398 } else if (argc == 1) {
49399 // This is our current trailing argument; reduce argc
49400 --argc;
49401 } else {
49402 argv[0].setUndefined();
49403 }
49404 } while (false);
49405
49406 JS::Rooted<JS::Value> callable(cx);
49407 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49408 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49409 !InitIds(cx, atomsCache)) ||
49410 !GetCallableProperty(cx, atomsCache->passOptionalNonNullSelf_id, &callable)) {
49411 aRv.Throw(NS_ERROR_UNEXPECTED);
49412 return;
49413 }
49414 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49415 if (!JS::Call(cx, thisValue, callable,
49416 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49417 aRv.NoteJSContextException(cx);
49418 return;
49419 }
49420}
49421
49422void
49423TestJSImplInterfaceJSImpl::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
49424{
49425 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelfWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49426 if (aRv.Failed()) {
49427 return;
49428 }
49429 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49429); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49429); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49430 BindingCallContext& cx = s.GetCallContext();
49431
49432 JS::Rooted<JS::Value> rval(cx);
49433 JS::RootedVector<JS::Value> argv(cx);
49434 if (!argv.resize(1)) {
49435 // That threw an exception on the JSContext, and our CallSetup will do
49436 // the right thing with that.
49437 return;
49438 }
49439 unsigned argc = 1;
49440
49441 do {
49442 if (!arg) {
49443 argv[0].setNull();
49444 break;
49445 }
49446 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49447 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49447); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 49447); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49448 aRv.Throw(NS_ERROR_UNEXPECTED);
49449 return;
49450 }
49451 break;
49452 } while (false);
49453
49454 JS::Rooted<JS::Value> callable(cx);
49455 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49456 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49457 !InitIds(cx, atomsCache)) ||
49458 !GetCallableProperty(cx, atomsCache->passOptionalSelfWithDefault_id, &callable)) {
49459 aRv.Throw(NS_ERROR_UNEXPECTED);
49460 return;
49461 }
49462 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49463 if (!JS::Call(cx, thisValue, callable,
49464 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49465 aRv.NoteJSContextException(cx);
49466 return;
49467 }
49468}
49469
49470already_AddRefed<TestNonWrapperCacheInterface>
49471TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
49472{
49473 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49474 if (aRv.Failed()) {
49475 return nullptr;
49476 }
49477 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49477); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49477); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49478 BindingCallContext& cx = s.GetCallContext();
49479
49480 JS::Rooted<JS::Value> rval(cx);
49481
49482 JS::Rooted<JS::Value> callable(cx);
49483 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49484 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49485 !InitIds(cx, atomsCache)) ||
49486 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterface_id, &callable)) {
49487 aRv.Throw(NS_ERROR_UNEXPECTED);
49488 return nullptr;
49489 }
49490 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49491 if (!JS::Call(cx, thisValue, callable,
49492 JS::HandleValueArray::empty(), &rval)) {
49493 aRv.NoteJSContextException(cx);
49494 return nullptr;
49495 }
49496 RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl;
49497 if (rval.isObject()) {
49498 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49499 {
49500 // Our JSContext should be in the right global to do unwrapping in.
49501 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx);
49502 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49503 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface", "TestNonWrapperCacheInterface");
49504 aRv.Throw(NS_ERROR_UNEXPECTED);
49505 return nullptr;
49506 }
49507 }
49508 } else {
49509 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface");
49510 aRv.Throw(NS_ERROR_UNEXPECTED);
49511 return nullptr;
49512 }
49513 return rvalDecl.forget();
49514}
49515
49516already_AddRefed<TestNonWrapperCacheInterface>
49517TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
49518{
49519 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49520 if (aRv.Failed()) {
49521 return nullptr;
49522 }
49523 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49523); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49524 BindingCallContext& cx = s.GetCallContext();
49525
49526 JS::Rooted<JS::Value> rval(cx);
49527
49528 JS::Rooted<JS::Value> callable(cx);
49529 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49530 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49531 !InitIds(cx, atomsCache)) ||
49532 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterface_id, &callable)) {
49533 aRv.Throw(NS_ERROR_UNEXPECTED);
49534 return nullptr;
49535 }
49536 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49537 if (!JS::Call(cx, thisValue, callable,
49538 JS::HandleValueArray::empty(), &rval)) {
49539 aRv.NoteJSContextException(cx);
49540 return nullptr;
49541 }
49542 RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl;
49543 if (rval.isObject()) {
49544 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49545 {
49546 // Our JSContext should be in the right global to do unwrapping in.
49547 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx);
49548 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49549 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface", "TestNonWrapperCacheInterface");
49550 aRv.Throw(NS_ERROR_UNEXPECTED);
49551 return nullptr;
49552 }
49553 }
49554 } else if (rval.isNullOrUndefined()) {
49555 rvalDecl = nullptr;
49556 } else {
49557 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface");
49558 aRv.Throw(NS_ERROR_UNEXPECTED);
49559 return nullptr;
49560 }
49561 return rvalDecl.forget();
49562}
49563
49564void
49565TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49566{
49567 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49568 if (aRv.Failed()) {
49569 return;
49570 }
49571 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49571); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49571); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49572 BindingCallContext& cx = s.GetCallContext();
49573
49574 JS::Rooted<JS::Value> rval(cx);
49575
49576 JS::Rooted<JS::Value> callable(cx);
49577 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49578 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49579 !InitIds(cx, atomsCache)) ||
49580 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceSequence_id, &callable)) {
49581 aRv.Throw(NS_ERROR_UNEXPECTED);
49582 return;
49583 }
49584 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49585 if (!JS::Call(cx, thisValue, callable,
49586 JS::HandleValueArray::empty(), &rval)) {
49587 aRv.NoteJSContextException(cx);
49588 return;
49589 }
49590 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl;
49591 if (rval.isObject()) {
49592 JS::ForOfIterator iter(cx);
49593 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49594 aRv.Throw(NS_ERROR_UNEXPECTED);
49595 return;
49596 }
49597 if (!iter.valueIsIterable()) {
49598 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence");
49599 aRv.Throw(NS_ERROR_UNEXPECTED);
49600 return;
49601 }
49602 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl;
49603 JS::Rooted<JS::Value> temp(cx);
49604 while (true) {
49605 bool done;
49606 if (!iter.next(&temp, &done)) {
49607 aRv.Throw(NS_ERROR_UNEXPECTED);
49608 return;
49609 }
49610 if (done) {
49611 break;
49612 }
49613 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49614 if (!slotPtr) {
49615 JS_ReportOutOfMemory(cx);
49616 aRv.Throw(NS_ERROR_UNEXPECTED);
49617 return;
49618 }
49619 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49620 if (temp.isObject()) {
49621 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49622 {
49623 // Our JSContext should be in the right global to do unwrapping in.
49624 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49625 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49626 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface");
49627 aRv.Throw(NS_ERROR_UNEXPECTED);
49628 return;
49629 }
49630 }
49631 } else {
49632 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence");
49633 aRv.Throw(NS_ERROR_UNEXPECTED);
49634 return;
49635 }
49636 }
49637 } else {
49638 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence");
49639 aRv.Throw(NS_ERROR_UNEXPECTED);
49640 return;
49641 }
49642 aRetVal = std::move(rvalDecl);
49643}
49644
49645void
49646TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49647{
49648 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49649 if (aRv.Failed()) {
49650 return;
49651 }
49652 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49652); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49652); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49653 BindingCallContext& cx = s.GetCallContext();
49654
49655 JS::Rooted<JS::Value> rval(cx);
49656
49657 JS::Rooted<JS::Value> callable(cx);
49658 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49659 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49660 !InitIds(cx, atomsCache)) ||
49661 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id, &callable)) {
49662 aRv.Throw(NS_ERROR_UNEXPECTED);
49663 return;
49664 }
49665 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49666 if (!JS::Call(cx, thisValue, callable,
49667 JS::HandleValueArray::empty(), &rval)) {
49668 aRv.NoteJSContextException(cx);
49669 return;
49670 }
49671 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl;
49672 if (rval.isObject()) {
49673 JS::ForOfIterator iter(cx);
49674 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49675 aRv.Throw(NS_ERROR_UNEXPECTED);
49676 return;
49677 }
49678 if (!iter.valueIsIterable()) {
49679 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence");
49680 aRv.Throw(NS_ERROR_UNEXPECTED);
49681 return;
49682 }
49683 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl;
49684 JS::Rooted<JS::Value> temp(cx);
49685 while (true) {
49686 bool done;
49687 if (!iter.next(&temp, &done)) {
49688 aRv.Throw(NS_ERROR_UNEXPECTED);
49689 return;
49690 }
49691 if (done) {
49692 break;
49693 }
49694 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49695 if (!slotPtr) {
49696 JS_ReportOutOfMemory(cx);
49697 aRv.Throw(NS_ERROR_UNEXPECTED);
49698 return;
49699 }
49700 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49701 if (temp.isObject()) {
49702 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49703 {
49704 // Our JSContext should be in the right global to do unwrapping in.
49705 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49706 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49707 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface");
49708 aRv.Throw(NS_ERROR_UNEXPECTED);
49709 return;
49710 }
49711 }
49712 } else if (temp.isNullOrUndefined()) {
49713 slot = nullptr;
49714 } else {
49715 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence");
49716 aRv.Throw(NS_ERROR_UNEXPECTED);
49717 return;
49718 }
49719 }
49720 } else {
49721 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence");
49722 aRv.Throw(NS_ERROR_UNEXPECTED);
49723 return;
49724 }
49725 aRetVal = std::move(rvalDecl);
49726}
49727
49728void
49729TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49730{
49731 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49732 if (aRv.Failed()) {
49733 return;
49734 }
49735 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49735); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49736 BindingCallContext& cx = s.GetCallContext();
49737
49738 JS::Rooted<JS::Value> rval(cx);
49739
49740 JS::Rooted<JS::Value> callable(cx);
49741 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49742 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49743 !InitIds(cx, atomsCache)) ||
49744 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id, &callable)) {
49745 aRv.Throw(NS_ERROR_UNEXPECTED);
49746 return;
49747 }
49748 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49749 if (!JS::Call(cx, thisValue, callable,
49750 JS::HandleValueArray::empty(), &rval)) {
49751 aRv.NoteJSContextException(cx);
49752 return;
49753 }
49754 Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl;
49755 if (rval.isObject()) {
49756 JS::ForOfIterator iter(cx);
49757 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49758 aRv.Throw(NS_ERROR_UNEXPECTED);
49759 return;
49760 }
49761 if (!iter.valueIsIterable()) {
49762 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence");
49763 aRv.Throw(NS_ERROR_UNEXPECTED);
49764 return;
49765 }
49766 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue();
49767 JS::Rooted<JS::Value> temp(cx);
49768 while (true) {
49769 bool done;
49770 if (!iter.next(&temp, &done)) {
49771 aRv.Throw(NS_ERROR_UNEXPECTED);
49772 return;
49773 }
49774 if (done) {
49775 break;
49776 }
49777 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49778 if (!slotPtr) {
49779 JS_ReportOutOfMemory(cx);
49780 aRv.Throw(NS_ERROR_UNEXPECTED);
49781 return;
49782 }
49783 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49784 if (temp.isObject()) {
49785 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49786 {
49787 // Our JSContext should be in the right global to do unwrapping in.
49788 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49789 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49790 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface");
49791 aRv.Throw(NS_ERROR_UNEXPECTED);
49792 return;
49793 }
49794 }
49795 } else {
49796 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence");
49797 aRv.Throw(NS_ERROR_UNEXPECTED);
49798 return;
49799 }
49800 }
49801 } else if (rval.isNullOrUndefined()) {
49802 rvalDecl.SetNull();
49803 } else {
49804 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence");
49805 aRv.Throw(NS_ERROR_UNEXPECTED);
49806 return;
49807 }
49808 if (rvalDecl.IsNull()) {
49809 aRetVal.SetNull();
49810 } else {
49811 aRetVal.SetValue() = std::move(rvalDecl.Value());
49812 }
49813}
49814
49815void
49816TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49817{
49818 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49819 if (aRv.Failed()) {
49820 return;
49821 }
49822 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49822); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49822); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49823 BindingCallContext& cx = s.GetCallContext();
49824
49825 JS::Rooted<JS::Value> rval(cx);
49826
49827 JS::Rooted<JS::Value> callable(cx);
49828 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49829 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49830 !InitIds(cx, atomsCache)) ||
49831 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id, &callable)) {
49832 aRv.Throw(NS_ERROR_UNEXPECTED);
49833 return;
49834 }
49835 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49836 if (!JS::Call(cx, thisValue, callable,
49837 JS::HandleValueArray::empty(), &rval)) {
49838 aRv.NoteJSContextException(cx);
49839 return;
49840 }
49841 Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl;
49842 if (rval.isObject()) {
49843 JS::ForOfIterator iter(cx);
49844 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49845 aRv.Throw(NS_ERROR_UNEXPECTED);
49846 return;
49847 }
49848 if (!iter.valueIsIterable()) {
49849 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence");
49850 aRv.Throw(NS_ERROR_UNEXPECTED);
49851 return;
49852 }
49853 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue();
49854 JS::Rooted<JS::Value> temp(cx);
49855 while (true) {
49856 bool done;
49857 if (!iter.next(&temp, &done)) {
49858 aRv.Throw(NS_ERROR_UNEXPECTED);
49859 return;
49860 }
49861 if (done) {
49862 break;
49863 }
49864 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49865 if (!slotPtr) {
49866 JS_ReportOutOfMemory(cx);
49867 aRv.Throw(NS_ERROR_UNEXPECTED);
49868 return;
49869 }
49870 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49871 if (temp.isObject()) {
49872 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49873 {
49874 // Our JSContext should be in the right global to do unwrapping in.
49875 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49876 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49877 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface");
49878 aRv.Throw(NS_ERROR_UNEXPECTED);
49879 return;
49880 }
49881 }
49882 } else if (temp.isNullOrUndefined()) {
49883 slot = nullptr;
49884 } else {
49885 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence");
49886 aRv.Throw(NS_ERROR_UNEXPECTED);
49887 return;
49888 }
49889 }
49890 } else if (rval.isNullOrUndefined()) {
49891 rvalDecl.SetNull();
49892 } else {
49893 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence");
49894 aRv.Throw(NS_ERROR_UNEXPECTED);
49895 return;
49896 }
49897 if (rvalDecl.IsNull()) {
49898 aRetVal.SetNull();
49899 } else {
49900 aRetVal.SetValue() = std::move(rvalDecl.Value());
49901 }
49902}
49903
49904already_AddRefed<TestExternalInterface>
49905TestJSImplInterfaceJSImpl::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm)
49906{
49907 CallSetup s(this, aRv, "TestJSImplInterface.receiveExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49908 if (aRv.Failed()) {
49909 return nullptr;
49910 }
49911 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49911); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49911); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49912 BindingCallContext& cx = s.GetCallContext();
49913
49914 JS::Rooted<JS::Value> rval(cx);
49915
49916 JS::Rooted<JS::Value> callable(cx);
49917 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49918 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49919 !InitIds(cx, atomsCache)) ||
49920 !GetCallableProperty(cx, atomsCache->receiveExternal_id, &callable)) {
49921 aRv.Throw(NS_ERROR_UNEXPECTED);
49922 return nullptr;
49923 }
49924 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49925 if (!JS::Call(cx, thisValue, callable,
49926 JS::HandleValueArray::empty(), &rval)) {
49927 aRv.NoteJSContextException(cx);
49928 return nullptr;
49929 }
49930 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49931 if (rval.isObject()) {
49932 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49933 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49934 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49935 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)))
) {
49936 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveExternal", "TestExternalInterface");
49937 aRv.Throw(NS_ERROR_UNEXPECTED);
49938 return nullptr;
49939 }
49940 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"
, 49940); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 49940); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49941 rvalDecl = rvalHolder;
49942 } else {
49943 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveExternal");
49944 aRv.Throw(NS_ERROR_UNEXPECTED);
49945 return nullptr;
49946 }
49947 return rvalDecl.forget();
49948}
49949
49950already_AddRefed<TestExternalInterface>
49951TestJSImplInterfaceJSImpl::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
49952{
49953 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49954 if (aRv.Failed()) {
49955 return nullptr;
49956 }
49957 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49957); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 49957); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
49958 BindingCallContext& cx = s.GetCallContext();
49959
49960 JS::Rooted<JS::Value> rval(cx);
49961
49962 JS::Rooted<JS::Value> callable(cx);
49963 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49964 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49965 !InitIds(cx, atomsCache)) ||
49966 !GetCallableProperty(cx, atomsCache->receiveNullableExternal_id, &callable)) {
49967 aRv.Throw(NS_ERROR_UNEXPECTED);
49968 return nullptr;
49969 }
49970 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49971 if (!JS::Call(cx, thisValue, callable,
49972 JS::HandleValueArray::empty(), &rval)) {
49973 aRv.NoteJSContextException(cx);
49974 return nullptr;
49975 }
49976 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49977 if (rval.isObject()) {
49978 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49979 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49980 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49981 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)))
) {
49982 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableExternal", "TestExternalInterface");
49983 aRv.Throw(NS_ERROR_UNEXPECTED);
49984 return nullptr;
49985 }
49986 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"
, 49986); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 49986); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49987 rvalDecl = rvalHolder;
49988 } else if (rval.isNullOrUndefined()) {
49989 rvalDecl = nullptr;
49990 } else {
49991 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableExternal");
49992 aRv.Throw(NS_ERROR_UNEXPECTED);
49993 return nullptr;
49994 }
49995 return rvalDecl.forget();
49996}
49997
49998already_AddRefed<TestExternalInterface>
49999TestJSImplInterfaceJSImpl::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm)
50000{
50001 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50002 if (aRv.Failed()) {
50003 return nullptr;
50004 }
50005 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50005); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50006 BindingCallContext& cx = s.GetCallContext();
50007
50008 JS::Rooted<JS::Value> rval(cx);
50009
50010 JS::Rooted<JS::Value> callable(cx);
50011 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50012 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50013 !InitIds(cx, atomsCache)) ||
50014 !GetCallableProperty(cx, atomsCache->receiveWeakExternal_id, &callable)) {
50015 aRv.Throw(NS_ERROR_UNEXPECTED);
50016 return nullptr;
50017 }
50018 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50019 if (!JS::Call(cx, thisValue, callable,
50020 JS::HandleValueArray::empty(), &rval)) {
50021 aRv.NoteJSContextException(cx);
50022 return nullptr;
50023 }
50024 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
50025 if (rval.isObject()) {
50026 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
50027 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
50028 JS::Rooted<JSObject*> source(cx, &rval.toObject());
50029 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)))
) {
50030 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakExternal", "TestExternalInterface");
50031 aRv.Throw(NS_ERROR_UNEXPECTED);
50032 return nullptr;
50033 }
50034 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"
, 50034); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 50034); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
50035 rvalDecl = rvalHolder;
50036 } else {
50037 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakExternal");
50038 aRv.Throw(NS_ERROR_UNEXPECTED);
50039 return nullptr;
50040 }
50041 return rvalDecl.forget();
50042}
50043
50044already_AddRefed<TestExternalInterface>
50045TestJSImplInterfaceJSImpl::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
50046{
50047 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50048 if (aRv.Failed()) {
50049 return nullptr;
50050 }
50051 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50051); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50051); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50052 BindingCallContext& cx = s.GetCallContext();
50053
50054 JS::Rooted<JS::Value> rval(cx);
50055
50056 JS::Rooted<JS::Value> callable(cx);
50057 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50058 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50059 !InitIds(cx, atomsCache)) ||
50060 !GetCallableProperty(cx, atomsCache->receiveWeakNullableExternal_id, &callable)) {
50061 aRv.Throw(NS_ERROR_UNEXPECTED);
50062 return nullptr;
50063 }
50064 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50065 if (!JS::Call(cx, thisValue, callable,
50066 JS::HandleValueArray::empty(), &rval)) {
50067 aRv.NoteJSContextException(cx);
50068 return nullptr;
50069 }
50070 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
50071 if (rval.isObject()) {
50072 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
50073 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
50074 JS::Rooted<JSObject*> source(cx, &rval.toObject());
50075 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)))
) {
50076 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableExternal", "TestExternalInterface");
50077 aRv.Throw(NS_ERROR_UNEXPECTED);
50078 return nullptr;
50079 }
50080 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"
, 50080); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 50080); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
50081 rvalDecl = rvalHolder;
50082 } else if (rval.isNullOrUndefined()) {
50083 rvalDecl = nullptr;
50084 } else {
50085 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableExternal");
50086 aRv.Throw(NS_ERROR_UNEXPECTED);
50087 return nullptr;
50088 }
50089 return rvalDecl.forget();
50090}
50091
50092void
50093TestJSImplInterfaceJSImpl::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50094{
50095 CallSetup s(this, aRv, "TestJSImplInterface.passExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50096 if (aRv.Failed()) {
50097 return;
50098 }
50099 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50099); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50100 BindingCallContext& cx = s.GetCallContext();
50101
50102 JS::Rooted<JS::Value> rval(cx);
50103 JS::RootedVector<JS::Value> argv(cx);
50104 if (!argv.resize(1)) {
50105 // That threw an exception on the JSContext, and our CallSetup will do
50106 // the right thing with that.
50107 return;
50108 }
50109 unsigned argc = 1;
50110
50111 do {
50112 if (!WrapObject(cx, arg, argv[0])) {
50113 aRv.Throw(NS_ERROR_UNEXPECTED);
50114 return;
50115 }
50116 break;
50117 } while (false);
50118
50119 JS::Rooted<JS::Value> callable(cx);
50120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50122 !InitIds(cx, atomsCache)) ||
50123 !GetCallableProperty(cx, atomsCache->passExternal_id, &callable)) {
50124 aRv.Throw(NS_ERROR_UNEXPECTED);
50125 return;
50126 }
50127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50128 if (!JS::Call(cx, thisValue, callable,
50129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50130 aRv.NoteJSContextException(cx);
50131 return;
50132 }
50133}
50134
50135void
50136TestJSImplInterfaceJSImpl::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50137{
50138 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50139 if (aRv.Failed()) {
50140 return;
50141 }
50142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50142); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50143 BindingCallContext& cx = s.GetCallContext();
50144
50145 JS::Rooted<JS::Value> rval(cx);
50146 JS::RootedVector<JS::Value> argv(cx);
50147 if (!argv.resize(1)) {
50148 // That threw an exception on the JSContext, and our CallSetup will do
50149 // the right thing with that.
50150 return;
50151 }
50152 unsigned argc = 1;
50153
50154 do {
50155 if (!arg) {
50156 argv[0].setNull();
50157 break;
50158 }
50159 if (!WrapObject(cx, arg, argv[0])) {
50160 aRv.Throw(NS_ERROR_UNEXPECTED);
50161 return;
50162 }
50163 break;
50164 } while (false);
50165
50166 JS::Rooted<JS::Value> callable(cx);
50167 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50168 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50169 !InitIds(cx, atomsCache)) ||
50170 !GetCallableProperty(cx, atomsCache->passNullableExternal_id, &callable)) {
50171 aRv.Throw(NS_ERROR_UNEXPECTED);
50172 return;
50173 }
50174 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50175 if (!JS::Call(cx, thisValue, callable,
50176 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50177 aRv.NoteJSContextException(cx);
50178 return;
50179 }
50180}
50181
50182void
50183TestJSImplInterfaceJSImpl::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50184{
50185 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50186 if (aRv.Failed()) {
50187 return;
50188 }
50189 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50189); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50189); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50190 BindingCallContext& cx = s.GetCallContext();
50191
50192 JS::Rooted<JS::Value> rval(cx);
50193 JS::RootedVector<JS::Value> argv(cx);
50194 if (!argv.resize(1)) {
50195 // That threw an exception on the JSContext, and our CallSetup will do
50196 // the right thing with that.
50197 return;
50198 }
50199 unsigned argc = 1;
50200
50201 do {
50202 if (arg.WasPassed()) {
50203 if (!arg.Value()) {
50204 argv[0].setNull();
50205 break;
50206 }
50207 if (!WrapObject(cx, arg.Value(), argv[0])) {
50208 aRv.Throw(NS_ERROR_UNEXPECTED);
50209 return;
50210 }
50211 break;
50212 } else if (argc == 1) {
50213 // This is our current trailing argument; reduce argc
50214 --argc;
50215 } else {
50216 argv[0].setUndefined();
50217 }
50218 } while (false);
50219
50220 JS::Rooted<JS::Value> callable(cx);
50221 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50222 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50223 !InitIds(cx, atomsCache)) ||
50224 !GetCallableProperty(cx, atomsCache->passOptionalExternal_id, &callable)) {
50225 aRv.Throw(NS_ERROR_UNEXPECTED);
50226 return;
50227 }
50228 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50229 if (!JS::Call(cx, thisValue, callable,
50230 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50231 aRv.NoteJSContextException(cx);
50232 return;
50233 }
50234}
50235
50236void
50237TestJSImplInterfaceJSImpl::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50238{
50239 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50240 if (aRv.Failed()) {
50241 return;
50242 }
50243 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50243); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50244 BindingCallContext& cx = s.GetCallContext();
50245
50246 JS::Rooted<JS::Value> rval(cx);
50247 JS::RootedVector<JS::Value> argv(cx);
50248 if (!argv.resize(1)) {
50249 // That threw an exception on the JSContext, and our CallSetup will do
50250 // the right thing with that.
50251 return;
50252 }
50253 unsigned argc = 1;
50254
50255 do {
50256 if (arg.WasPassed()) {
50257 if (!WrapObject(cx, arg.Value(), argv[0])) {
50258 aRv.Throw(NS_ERROR_UNEXPECTED);
50259 return;
50260 }
50261 break;
50262 } else if (argc == 1) {
50263 // This is our current trailing argument; reduce argc
50264 --argc;
50265 } else {
50266 argv[0].setUndefined();
50267 }
50268 } while (false);
50269
50270 JS::Rooted<JS::Value> callable(cx);
50271 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50272 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50273 !InitIds(cx, atomsCache)) ||
50274 !GetCallableProperty(cx, atomsCache->passOptionalNonNullExternal_id, &callable)) {
50275 aRv.Throw(NS_ERROR_UNEXPECTED);
50276 return;
50277 }
50278 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50279 if (!JS::Call(cx, thisValue, callable,
50280 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50281 aRv.NoteJSContextException(cx);
50282 return;
50283 }
50284}
50285
50286void
50287TestJSImplInterfaceJSImpl::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50288{
50289 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternalWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50290 if (aRv.Failed()) {
50291 return;
50292 }
50293 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50293); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50293); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50294 BindingCallContext& cx = s.GetCallContext();
50295
50296 JS::Rooted<JS::Value> rval(cx);
50297 JS::RootedVector<JS::Value> argv(cx);
50298 if (!argv.resize(1)) {
50299 // That threw an exception on the JSContext, and our CallSetup will do
50300 // the right thing with that.
50301 return;
50302 }
50303 unsigned argc = 1;
50304
50305 do {
50306 if (!arg) {
50307 argv[0].setNull();
50308 break;
50309 }
50310 if (!WrapObject(cx, arg, argv[0])) {
50311 aRv.Throw(NS_ERROR_UNEXPECTED);
50312 return;
50313 }
50314 break;
50315 } while (false);
50316
50317 JS::Rooted<JS::Value> callable(cx);
50318 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50319 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50320 !InitIds(cx, atomsCache)) ||
50321 !GetCallableProperty(cx, atomsCache->passOptionalExternalWithDefault_id, &callable)) {
50322 aRv.Throw(NS_ERROR_UNEXPECTED);
50323 return;
50324 }
50325 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50326 if (!JS::Call(cx, thisValue, callable,
50327 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50328 aRv.NoteJSContextException(cx);
50329 return;
50330 }
50331}
50332
50333already_AddRefed<TestCallbackInterface>
50334TestJSImplInterfaceJSImpl::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50335{
50336 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50337 if (aRv.Failed()) {
50338 return nullptr;
50339 }
50340 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50340); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50340); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50341 BindingCallContext& cx = s.GetCallContext();
50342
50343 JS::Rooted<JS::Value> rval(cx);
50344
50345 JS::Rooted<JS::Value> callable(cx);
50346 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50347 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50348 !InitIds(cx, atomsCache)) ||
50349 !GetCallableProperty(cx, atomsCache->receiveCallbackInterface_id, &callable)) {
50350 aRv.Throw(NS_ERROR_UNEXPECTED);
50351 return nullptr;
50352 }
50353 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50354 if (!JS::Call(cx, thisValue, callable,
50355 JS::HandleValueArray::empty(), &rval)) {
50356 aRv.NoteJSContextException(cx);
50357 return nullptr;
50358 }
50359 RefPtr<TestCallbackInterface> rvalDecl;
50360 if (rval.isObject()) {
50361 { // scope for tempRoot and tempGlobalRoot if needed
50362 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50363 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50364 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50365 }
50366 } else {
50367 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallbackInterface");
50368 aRv.Throw(NS_ERROR_UNEXPECTED);
50369 return nullptr;
50370 }
50371 return rvalDecl.forget();
50372}
50373
50374already_AddRefed<TestCallbackInterface>
50375TestJSImplInterfaceJSImpl::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50376{
50377 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50378 if (aRv.Failed()) {
50379 return nullptr;
50380 }
50381 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50381); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50381); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50382 BindingCallContext& cx = s.GetCallContext();
50383
50384 JS::Rooted<JS::Value> rval(cx);
50385
50386 JS::Rooted<JS::Value> callable(cx);
50387 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50388 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50389 !InitIds(cx, atomsCache)) ||
50390 !GetCallableProperty(cx, atomsCache->receiveNullableCallbackInterface_id, &callable)) {
50391 aRv.Throw(NS_ERROR_UNEXPECTED);
50392 return nullptr;
50393 }
50394 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50395 if (!JS::Call(cx, thisValue, callable,
50396 JS::HandleValueArray::empty(), &rval)) {
50397 aRv.NoteJSContextException(cx);
50398 return nullptr;
50399 }
50400 RefPtr<TestCallbackInterface> rvalDecl;
50401 if (rval.isObject()) {
50402 { // scope for tempRoot and tempGlobalRoot if needed
50403 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50404 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50405 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50406 }
50407 } else if (rval.isNullOrUndefined()) {
50408 rvalDecl = nullptr;
50409 } else {
50410 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallbackInterface");
50411 aRv.Throw(NS_ERROR_UNEXPECTED);
50412 return nullptr;
50413 }
50414 return rvalDecl.forget();
50415}
50416
50417already_AddRefed<TestCallbackInterface>
50418TestJSImplInterfaceJSImpl::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50419{
50420 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50421 if (aRv.Failed()) {
50422 return nullptr;
50423 }
50424 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50424); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50424); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50425 BindingCallContext& cx = s.GetCallContext();
50426
50427 JS::Rooted<JS::Value> rval(cx);
50428
50429 JS::Rooted<JS::Value> callable(cx);
50430 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50431 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50432 !InitIds(cx, atomsCache)) ||
50433 !GetCallableProperty(cx, atomsCache->receiveWeakCallbackInterface_id, &callable)) {
50434 aRv.Throw(NS_ERROR_UNEXPECTED);
50435 return nullptr;
50436 }
50437 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50438 if (!JS::Call(cx, thisValue, callable,
50439 JS::HandleValueArray::empty(), &rval)) {
50440 aRv.NoteJSContextException(cx);
50441 return nullptr;
50442 }
50443 RefPtr<TestCallbackInterface> rvalDecl;
50444 if (rval.isObject()) {
50445 { // scope for tempRoot and tempGlobalRoot if needed
50446 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50447 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50448 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50449 }
50450 } else {
50451 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakCallbackInterface");
50452 aRv.Throw(NS_ERROR_UNEXPECTED);
50453 return nullptr;
50454 }
50455 return rvalDecl.forget();
50456}
50457
50458already_AddRefed<TestCallbackInterface>
50459TestJSImplInterfaceJSImpl::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50460{
50461 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50462 if (aRv.Failed()) {
50463 return nullptr;
50464 }
50465 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50465); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50465); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50466 BindingCallContext& cx = s.GetCallContext();
50467
50468 JS::Rooted<JS::Value> rval(cx);
50469
50470 JS::Rooted<JS::Value> callable(cx);
50471 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50472 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50473 !InitIds(cx, atomsCache)) ||
50474 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCallbackInterface_id, &callable)) {
50475 aRv.Throw(NS_ERROR_UNEXPECTED);
50476 return nullptr;
50477 }
50478 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50479 if (!JS::Call(cx, thisValue, callable,
50480 JS::HandleValueArray::empty(), &rval)) {
50481 aRv.NoteJSContextException(cx);
50482 return nullptr;
50483 }
50484 RefPtr<TestCallbackInterface> rvalDecl;
50485 if (rval.isObject()) {
50486 { // scope for tempRoot and tempGlobalRoot if needed
50487 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50488 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50489 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50490 }
50491 } else if (rval.isNullOrUndefined()) {
50492 rvalDecl = nullptr;
50493 } else {
50494 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableCallbackInterface");
50495 aRv.Throw(NS_ERROR_UNEXPECTED);
50496 return nullptr;
50497 }
50498 return rvalDecl.forget();
50499}
50500
50501void
50502TestJSImplInterfaceJSImpl::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
50503{
50504 CallSetup s(this, aRv, "TestJSImplInterface.passCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50505 if (aRv.Failed()) {
50506 return;
50507 }
50508 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50508); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50509 BindingCallContext& cx = s.GetCallContext();
50510
50511 JS::Rooted<JS::Value> rval(cx);
50512 JS::RootedVector<JS::Value> argv(cx);
50513 if (!argv.resize(1)) {
50514 // That threw an exception on the JSContext, and our CallSetup will do
50515 // the right thing with that.
50516 return;
50517 }
50518 unsigned argc = 1;
50519
50520 do {
50521 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50522 if (!MaybeWrapObjectValue(cx, argv[0])) {
50523 aRv.Throw(NS_ERROR_UNEXPECTED);
50524 return;
50525 }
50526 break;
50527 } while (false);
50528
50529 JS::Rooted<JS::Value> callable(cx);
50530 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50531 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50532 !InitIds(cx, atomsCache)) ||
50533 !GetCallableProperty(cx, atomsCache->passCallbackInterface_id, &callable)) {
50534 aRv.Throw(NS_ERROR_UNEXPECTED);
50535 return;
50536 }
50537 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50538 if (!JS::Call(cx, thisValue, callable,
50539 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50540 aRv.NoteJSContextException(cx);
50541 return;
50542 }
50543}
50544
50545void
50546TestJSImplInterfaceJSImpl::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50547{
50548 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50549 if (aRv.Failed()) {
50550 return;
50551 }
50552 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50552); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50553 BindingCallContext& cx = s.GetCallContext();
50554
50555 JS::Rooted<JS::Value> rval(cx);
50556 JS::RootedVector<JS::Value> argv(cx);
50557 if (!argv.resize(1)) {
50558 // That threw an exception on the JSContext, and our CallSetup will do
50559 // the right thing with that.
50560 return;
50561 }
50562 unsigned argc = 1;
50563
50564 do {
50565 if (arg) {
50566 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50567 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50568 aRv.Throw(NS_ERROR_UNEXPECTED);
50569 return;
50570 }
50571 break;
50572 } else {
50573 argv[0].setNull();
50574 break;
50575 }
50576 } while (false);
50577
50578 JS::Rooted<JS::Value> callable(cx);
50579 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50580 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50581 !InitIds(cx, atomsCache)) ||
50582 !GetCallableProperty(cx, atomsCache->passNullableCallbackInterface_id, &callable)) {
50583 aRv.Throw(NS_ERROR_UNEXPECTED);
50584 return;
50585 }
50586 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50587 if (!JS::Call(cx, thisValue, callable,
50588 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50589 aRv.NoteJSContextException(cx);
50590 return;
50591 }
50592}
50593
50594void
50595TestJSImplInterfaceJSImpl::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50596{
50597 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50598 if (aRv.Failed()) {
50599 return;
50600 }
50601 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50601); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50601); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50602 BindingCallContext& cx = s.GetCallContext();
50603
50604 JS::Rooted<JS::Value> rval(cx);
50605 JS::RootedVector<JS::Value> argv(cx);
50606 if (!argv.resize(1)) {
50607 // That threw an exception on the JSContext, and our CallSetup will do
50608 // the right thing with that.
50609 return;
50610 }
50611 unsigned argc = 1;
50612
50613 do {
50614 if (arg.WasPassed()) {
50615 if (arg.Value()) {
50616 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
50617 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50618 aRv.Throw(NS_ERROR_UNEXPECTED);
50619 return;
50620 }
50621 break;
50622 } else {
50623 argv[0].setNull();
50624 break;
50625 }
50626 } else if (argc == 1) {
50627 // This is our current trailing argument; reduce argc
50628 --argc;
50629 } else {
50630 argv[0].setUndefined();
50631 }
50632 } while (false);
50633
50634 JS::Rooted<JS::Value> callable(cx);
50635 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50636 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50637 !InitIds(cx, atomsCache)) ||
50638 !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterface_id, &callable)) {
50639 aRv.Throw(NS_ERROR_UNEXPECTED);
50640 return;
50641 }
50642 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50643 if (!JS::Call(cx, thisValue, callable,
50644 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50645 aRv.NoteJSContextException(cx);
50646 return;
50647 }
50648}
50649
50650void
50651TestJSImplInterfaceJSImpl::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50652{
50653 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50654 if (aRv.Failed()) {
50655 return;
50656 }
50657 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50657); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50657); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50658 BindingCallContext& cx = s.GetCallContext();
50659
50660 JS::Rooted<JS::Value> rval(cx);
50661 JS::RootedVector<JS::Value> argv(cx);
50662 if (!argv.resize(1)) {
50663 // That threw an exception on the JSContext, and our CallSetup will do
50664 // the right thing with that.
50665 return;
50666 }
50667 unsigned argc = 1;
50668
50669 do {
50670 if (arg.WasPassed()) {
50671 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
50672 if (!MaybeWrapObjectValue(cx, argv[0])) {
50673 aRv.Throw(NS_ERROR_UNEXPECTED);
50674 return;
50675 }
50676 break;
50677 } else if (argc == 1) {
50678 // This is our current trailing argument; reduce argc
50679 --argc;
50680 } else {
50681 argv[0].setUndefined();
50682 }
50683 } while (false);
50684
50685 JS::Rooted<JS::Value> callable(cx);
50686 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50687 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50688 !InitIds(cx, atomsCache)) ||
50689 !GetCallableProperty(cx, atomsCache->passOptionalNonNullCallbackInterface_id, &callable)) {
50690 aRv.Throw(NS_ERROR_UNEXPECTED);
50691 return;
50692 }
50693 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50694 if (!JS::Call(cx, thisValue, callable,
50695 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50696 aRv.NoteJSContextException(cx);
50697 return;
50698 }
50699}
50700
50701void
50702TestJSImplInterfaceJSImpl::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50703{
50704 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50705 if (aRv.Failed()) {
50706 return;
50707 }
50708 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50708); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50708); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50709 BindingCallContext& cx = s.GetCallContext();
50710
50711 JS::Rooted<JS::Value> rval(cx);
50712 JS::RootedVector<JS::Value> argv(cx);
50713 if (!argv.resize(1)) {
50714 // That threw an exception on the JSContext, and our CallSetup will do
50715 // the right thing with that.
50716 return;
50717 }
50718 unsigned argc = 1;
50719
50720 do {
50721 if (arg) {
50722 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50723 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50724 aRv.Throw(NS_ERROR_UNEXPECTED);
50725 return;
50726 }
50727 break;
50728 } else {
50729 argv[0].setNull();
50730 break;
50731 }
50732 } while (false);
50733
50734 JS::Rooted<JS::Value> callable(cx);
50735 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50736 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50737 !InitIds(cx, atomsCache)) ||
50738 !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterfaceWithDefault_id, &callable)) {
50739 aRv.Throw(NS_ERROR_UNEXPECTED);
50740 return;
50741 }
50742 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50743 if (!JS::Call(cx, thisValue, callable,
50744 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50745 aRv.NoteJSContextException(cx);
50746 return;
50747 }
50748}
50749
50750void
50751TestJSImplInterfaceJSImpl::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50752{
50753 CallSetup s(this, aRv, "TestJSImplInterface.receiveSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50754 if (aRv.Failed()) {
50755 return;
50756 }
50757 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50757); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50757); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50758 BindingCallContext& cx = s.GetCallContext();
50759
50760 JS::Rooted<JS::Value> rval(cx);
50761
50762 JS::Rooted<JS::Value> callable(cx);
50763 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50764 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50765 !InitIds(cx, atomsCache)) ||
50766 !GetCallableProperty(cx, atomsCache->receiveSequence_id, &callable)) {
50767 aRv.Throw(NS_ERROR_UNEXPECTED);
50768 return;
50769 }
50770 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50771 if (!JS::Call(cx, thisValue, callable,
50772 JS::HandleValueArray::empty(), &rval)) {
50773 aRv.NoteJSContextException(cx);
50774 return;
50775 }
50776 Sequence<int32_t> rvalDecl;
50777 if (rval.isObject()) {
50778 JS::ForOfIterator iter(cx);
50779 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50780 aRv.Throw(NS_ERROR_UNEXPECTED);
50781 return;
50782 }
50783 if (!iter.valueIsIterable()) {
50784 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence");
50785 aRv.Throw(NS_ERROR_UNEXPECTED);
50786 return;
50787 }
50788 Sequence<int32_t> &arr = rvalDecl;
50789 JS::Rooted<JS::Value> temp(cx);
50790 while (true) {
50791 bool done;
50792 if (!iter.next(&temp, &done)) {
50793 aRv.Throw(NS_ERROR_UNEXPECTED);
50794 return;
50795 }
50796 if (done) {
50797 break;
50798 }
50799 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
50800 if (!slotPtr) {
50801 JS_ReportOutOfMemory(cx);
50802 aRv.Throw(NS_ERROR_UNEXPECTED);
50803 return;
50804 }
50805 int32_t& slot = *slotPtr;
50806 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequence", &slot)) {
50807 aRv.Throw(NS_ERROR_UNEXPECTED);
50808 return;
50809 }
50810 }
50811 } else {
50812 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence");
50813 aRv.Throw(NS_ERROR_UNEXPECTED);
50814 return;
50815 }
50816 aRetVal = std::move(rvalDecl);
50817}
50818
50819void
50820TestJSImplInterfaceJSImpl::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50821{
50822 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50823 if (aRv.Failed()) {
50824 return;
50825 }
50826 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50826); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50827 BindingCallContext& cx = s.GetCallContext();
50828
50829 JS::Rooted<JS::Value> rval(cx);
50830
50831 JS::Rooted<JS::Value> callable(cx);
50832 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50833 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50834 !InitIds(cx, atomsCache)) ||
50835 !GetCallableProperty(cx, atomsCache->receiveNullableSequence_id, &callable)) {
50836 aRv.Throw(NS_ERROR_UNEXPECTED);
50837 return;
50838 }
50839 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50840 if (!JS::Call(cx, thisValue, callable,
50841 JS::HandleValueArray::empty(), &rval)) {
50842 aRv.NoteJSContextException(cx);
50843 return;
50844 }
50845 Nullable<Sequence<int32_t>> rvalDecl;
50846 if (rval.isObject()) {
50847 JS::ForOfIterator iter(cx);
50848 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50849 aRv.Throw(NS_ERROR_UNEXPECTED);
50850 return;
50851 }
50852 if (!iter.valueIsIterable()) {
50853 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence");
50854 aRv.Throw(NS_ERROR_UNEXPECTED);
50855 return;
50856 }
50857 Sequence<int32_t> &arr = rvalDecl.SetValue();
50858 JS::Rooted<JS::Value> temp(cx);
50859 while (true) {
50860 bool done;
50861 if (!iter.next(&temp, &done)) {
50862 aRv.Throw(NS_ERROR_UNEXPECTED);
50863 return;
50864 }
50865 if (done) {
50866 break;
50867 }
50868 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
50869 if (!slotPtr) {
50870 JS_ReportOutOfMemory(cx);
50871 aRv.Throw(NS_ERROR_UNEXPECTED);
50872 return;
50873 }
50874 int32_t& slot = *slotPtr;
50875 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequence", &slot)) {
50876 aRv.Throw(NS_ERROR_UNEXPECTED);
50877 return;
50878 }
50879 }
50880 } else if (rval.isNullOrUndefined()) {
50881 rvalDecl.SetNull();
50882 } else {
50883 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence");
50884 aRv.Throw(NS_ERROR_UNEXPECTED);
50885 return;
50886 }
50887 if (rvalDecl.IsNull()) {
50888 aRetVal.SetNull();
50889 } else {
50890 aRetVal.SetValue() = std::move(rvalDecl.Value());
50891 }
50892}
50893
50894void
50895TestJSImplInterfaceJSImpl::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50896{
50897 CallSetup s(this, aRv, "TestJSImplInterface.receiveSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50898 if (aRv.Failed()) {
50899 return;
50900 }
50901 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50901); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50901); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50902 BindingCallContext& cx = s.GetCallContext();
50903
50904 JS::Rooted<JS::Value> rval(cx);
50905
50906 JS::Rooted<JS::Value> callable(cx);
50907 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50908 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50909 !InitIds(cx, atomsCache)) ||
50910 !GetCallableProperty(cx, atomsCache->receiveSequenceOfNullableInts_id, &callable)) {
50911 aRv.Throw(NS_ERROR_UNEXPECTED);
50912 return;
50913 }
50914 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50915 if (!JS::Call(cx, thisValue, callable,
50916 JS::HandleValueArray::empty(), &rval)) {
50917 aRv.NoteJSContextException(cx);
50918 return;
50919 }
50920 Sequence<Nullable<int32_t>> rvalDecl;
50921 if (rval.isObject()) {
50922 JS::ForOfIterator iter(cx);
50923 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50924 aRv.Throw(NS_ERROR_UNEXPECTED);
50925 return;
50926 }
50927 if (!iter.valueIsIterable()) {
50928 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence");
50929 aRv.Throw(NS_ERROR_UNEXPECTED);
50930 return;
50931 }
50932 Sequence<Nullable<int32_t>> &arr = rvalDecl;
50933 JS::Rooted<JS::Value> temp(cx);
50934 while (true) {
50935 bool done;
50936 if (!iter.next(&temp, &done)) {
50937 aRv.Throw(NS_ERROR_UNEXPECTED);
50938 return;
50939 }
50940 if (done) {
50941 break;
50942 }
50943 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
50944 if (!slotPtr) {
50945 JS_ReportOutOfMemory(cx);
50946 aRv.Throw(NS_ERROR_UNEXPECTED);
50947 return;
50948 }
50949 Nullable<int32_t>& slot = *slotPtr;
50950 if (temp.isNullOrUndefined()) {
50951 slot.SetNull();
50952 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequenceOfNullableInts", &slot.SetValue())) {
50953 aRv.Throw(NS_ERROR_UNEXPECTED);
50954 return;
50955 }
50956 }
50957 } else {
50958 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence");
50959 aRv.Throw(NS_ERROR_UNEXPECTED);
50960 return;
50961 }
50962 aRetVal = std::move(rvalDecl);
50963}
50964
50965void
50966TestJSImplInterfaceJSImpl::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50967{
50968 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50969 if (aRv.Failed()) {
50970 return;
50971 }
50972 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 50972); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
50973 BindingCallContext& cx = s.GetCallContext();
50974
50975 JS::Rooted<JS::Value> rval(cx);
50976
50977 JS::Rooted<JS::Value> callable(cx);
50978 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50979 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50980 !InitIds(cx, atomsCache)) ||
50981 !GetCallableProperty(cx, atomsCache->receiveNullableSequenceOfNullableInts_id, &callable)) {
50982 aRv.Throw(NS_ERROR_UNEXPECTED);
50983 return;
50984 }
50985 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50986 if (!JS::Call(cx, thisValue, callable,
50987 JS::HandleValueArray::empty(), &rval)) {
50988 aRv.NoteJSContextException(cx);
50989 return;
50990 }
50991 Nullable<Sequence<Nullable<int32_t>>> rvalDecl;
50992 if (rval.isObject()) {
50993 JS::ForOfIterator iter(cx);
50994 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50995 aRv.Throw(NS_ERROR_UNEXPECTED);
50996 return;
50997 }
50998 if (!iter.valueIsIterable()) {
50999 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence");
51000 aRv.Throw(NS_ERROR_UNEXPECTED);
51001 return;
51002 }
51003 Sequence<Nullable<int32_t>> &arr = rvalDecl.SetValue();
51004 JS::Rooted<JS::Value> temp(cx);
51005 while (true) {
51006 bool done;
51007 if (!iter.next(&temp, &done)) {
51008 aRv.Throw(NS_ERROR_UNEXPECTED);
51009 return;
51010 }
51011 if (done) {
51012 break;
51013 }
51014 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
51015 if (!slotPtr) {
51016 JS_ReportOutOfMemory(cx);
51017 aRv.Throw(NS_ERROR_UNEXPECTED);
51018 return;
51019 }
51020 Nullable<int32_t>& slot = *slotPtr;
51021 if (temp.isNullOrUndefined()) {
51022 slot.SetNull();
51023 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", &slot.SetValue())) {
51024 aRv.Throw(NS_ERROR_UNEXPECTED);
51025 return;
51026 }
51027 }
51028 } else if (rval.isNullOrUndefined()) {
51029 rvalDecl.SetNull();
51030 } else {
51031 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence");
51032 aRv.Throw(NS_ERROR_UNEXPECTED);
51033 return;
51034 }
51035 if (rvalDecl.IsNull()) {
51036 aRetVal.SetNull();
51037 } else {
51038 aRetVal.SetValue() = std::move(rvalDecl.Value());
51039 }
51040}
51041
51042void
51043TestJSImplInterfaceJSImpl::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51044{
51045 CallSetup s(this, aRv, "TestJSImplInterface.passSequence", 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 { MOZ_CrashSequence
(__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 tmp.setInt32(int32_t(arg[sequenceIdx0]));
51077 break;
51078 } while (false);
51079 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51080 JSPROP_ENUMERATE)) {
51081 aRv.Throw(NS_ERROR_UNEXPECTED);
51082 return;
51083 }
51084 }
51085 }
51086 argv[0].setObject(*returnArray);
51087 break;
51088 } while (false);
51089
51090 JS::Rooted<JS::Value> callable(cx);
51091 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51092 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51093 !InitIds(cx, atomsCache)) ||
51094 !GetCallableProperty(cx, atomsCache->passSequence_id, &callable)) {
51095 aRv.Throw(NS_ERROR_UNEXPECTED);
51096 return;
51097 }
51098 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51099 if (!JS::Call(cx, thisValue, callable,
51100 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51101 aRv.NoteJSContextException(cx);
51102 return;
51103 }
51104}
51105
51106void
51107TestJSImplInterfaceJSImpl::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51108{
51109 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51110 if (aRv.Failed()) {
51111 return;
51112 }
51113 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51113); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51113); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51114 BindingCallContext& cx = s.GetCallContext();
51115
51116 JS::Rooted<JS::Value> rval(cx);
51117 JS::RootedVector<JS::Value> argv(cx);
51118 if (!argv.resize(1)) {
51119 // That threw an exception on the JSContext, and our CallSetup will do
51120 // the right thing with that.
51121 return;
51122 }
51123 unsigned argc = 1;
51124
51125 do {
51126
51127 if (arg.IsNull()) {
51128 argv[0].setNull();
51129 break;
51130 }
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 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
51146 break;
51147 } while (false);
51148 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51149 JSPROP_ENUMERATE)) {
51150 aRv.Throw(NS_ERROR_UNEXPECTED);
51151 return;
51152 }
51153 }
51154 }
51155 argv[0].setObject(*returnArray);
51156 break;
51157 } while (false);
51158
51159 JS::Rooted<JS::Value> callable(cx);
51160 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51161 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51162 !InitIds(cx, atomsCache)) ||
51163 !GetCallableProperty(cx, atomsCache->passNullableSequence_id, &callable)) {
51164 aRv.Throw(NS_ERROR_UNEXPECTED);
51165 return;
51166 }
51167 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51168 if (!JS::Call(cx, thisValue, callable,
51169 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51170 aRv.NoteJSContextException(cx);
51171 return;
51172 }
51173}
51174
51175void
51176TestJSImplInterfaceJSImpl::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51177{
51178 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51179 if (aRv.Failed()) {
51180 return;
51181 }
51182 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51182); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51182); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51183 BindingCallContext& cx = s.GetCallContext();
51184
51185 JS::Rooted<JS::Value> rval(cx);
51186 JS::RootedVector<JS::Value> argv(cx);
51187 if (!argv.resize(1)) {
51188 // That threw an exception on the JSContext, and our CallSetup will do
51189 // the right thing with that.
51190 return;
51191 }
51192 unsigned argc = 1;
51193
51194 do {
51195
51196 uint32_t length = arg.Length();
51197 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51198 if (!returnArray) {
51199 aRv.Throw(NS_ERROR_UNEXPECTED);
51200 return;
51201 }
51202 // Scope for 'tmp'
51203 {
51204 JS::Rooted<JS::Value> tmp(cx);
51205 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51206 // Control block to let us common up the JS_DefineElement calls when there
51207 // are different ways to succeed at wrapping the object.
51208 do {
51209 if (arg[sequenceIdx0].IsNull()) {
51210 tmp.setNull();
51211 break;
51212 }
51213 tmp.setInt32(int32_t(arg[sequenceIdx0].Value()));
51214 break;
51215 } while (false);
51216 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51217 JSPROP_ENUMERATE)) {
51218 aRv.Throw(NS_ERROR_UNEXPECTED);
51219 return;
51220 }
51221 }
51222 }
51223 argv[0].setObject(*returnArray);
51224 break;
51225 } while (false);
51226
51227 JS::Rooted<JS::Value> callable(cx);
51228 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51229 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51230 !InitIds(cx, atomsCache)) ||
51231 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableInts_id, &callable)) {
51232 aRv.Throw(NS_ERROR_UNEXPECTED);
51233 return;
51234 }
51235 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51236 if (!JS::Call(cx, thisValue, callable,
51237 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51238 aRv.NoteJSContextException(cx);
51239 return;
51240 }
51241}
51242
51243void
51244TestJSImplInterfaceJSImpl::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51245{
51246 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51247 if (aRv.Failed()) {
51248 return;
51249 }
51250 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51250); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51250); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51251 BindingCallContext& cx = s.GetCallContext();
51252
51253 JS::Rooted<JS::Value> rval(cx);
51254 JS::RootedVector<JS::Value> argv(cx);
51255 if (!argv.resize(1)) {
51256 // That threw an exception on the JSContext, and our CallSetup will do
51257 // the right thing with that.
51258 return;
51259 }
51260 unsigned argc = 1;
51261
51262 do {
51263 if (arg.WasPassed()) {
51264
51265 uint32_t length = arg.Value().Length();
51266 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51267 if (!returnArray) {
51268 aRv.Throw(NS_ERROR_UNEXPECTED);
51269 return;
51270 }
51271 // Scope for 'tmp'
51272 {
51273 JS::Rooted<JS::Value> tmp(cx);
51274 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51275 // Control block to let us common up the JS_DefineElement calls when there
51276 // are different ways to succeed at wrapping the object.
51277 do {
51278 if (arg.Value()[sequenceIdx0].IsNull()) {
51279 tmp.setNull();
51280 break;
51281 }
51282 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0].Value()));
51283 break;
51284 } while (false);
51285 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51286 JSPROP_ENUMERATE)) {
51287 aRv.Throw(NS_ERROR_UNEXPECTED);
51288 return;
51289 }
51290 }
51291 }
51292 argv[0].setObject(*returnArray);
51293 break;
51294 } else if (argc == 1) {
51295 // This is our current trailing argument; reduce argc
51296 --argc;
51297 } else {
51298 argv[0].setUndefined();
51299 }
51300 } while (false);
51301
51302 JS::Rooted<JS::Value> callable(cx);
51303 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51304 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51305 !InitIds(cx, atomsCache)) ||
51306 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfNullableInts_id, &callable)) {
51307 aRv.Throw(NS_ERROR_UNEXPECTED);
51308 return;
51309 }
51310 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51311 if (!JS::Call(cx, thisValue, callable,
51312 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51313 aRv.NoteJSContextException(cx);
51314 return;
51315 }
51316}
51317
51318void
51319TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51320{
51321 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51322 if (aRv.Failed()) {
51323 return;
51324 }
51325 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51325); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51325); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51326 BindingCallContext& cx = s.GetCallContext();
51327
51328 JS::Rooted<JS::Value> rval(cx);
51329 JS::RootedVector<JS::Value> argv(cx);
51330 if (!argv.resize(1)) {
51331 // That threw an exception on the JSContext, and our CallSetup will do
51332 // the right thing with that.
51333 return;
51334 }
51335 unsigned argc = 1;
51336
51337 do {
51338 if (arg.WasPassed()) {
51339
51340 if (arg.Value().IsNull()) {
51341 argv[0].setNull();
51342 break;
51343 }
51344
51345 uint32_t length = arg.Value().Value().Length();
51346 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51347 if (!returnArray) {
51348 aRv.Throw(NS_ERROR_UNEXPECTED);
51349 return;
51350 }
51351 // Scope for 'tmp'
51352 {
51353 JS::Rooted<JS::Value> tmp(cx);
51354 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51355 // Control block to let us common up the JS_DefineElement calls when there
51356 // are different ways to succeed at wrapping the object.
51357 do {
51358 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
51359 tmp.setNull();
51360 break;
51361 }
51362 tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0].Value()));
51363 break;
51364 } while (false);
51365 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51366 JSPROP_ENUMERATE)) {
51367 aRv.Throw(NS_ERROR_UNEXPECTED);
51368 return;
51369 }
51370 }
51371 }
51372 argv[0].setObject(*returnArray);
51373 break;
51374 } else if (argc == 1) {
51375 // This is our current trailing argument; reduce argc
51376 --argc;
51377 } else {
51378 argv[0].setUndefined();
51379 }
51380 } while (false);
51381
51382 JS::Rooted<JS::Value> callable(cx);
51383 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51384 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51385 !InitIds(cx, atomsCache)) ||
51386 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableInts_id, &callable)) {
51387 aRv.Throw(NS_ERROR_UNEXPECTED);
51388 return;
51389 }
51390 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51391 if (!JS::Call(cx, thisValue, callable,
51392 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51393 aRv.NoteJSContextException(cx);
51394 return;
51395 }
51396}
51397
51398void
51399TestJSImplInterfaceJSImpl::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51400{
51401 CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51402 if (aRv.Failed()) {
51403 return;
51404 }
51405 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51406 BindingCallContext& cx = s.GetCallContext();
51407
51408 JS::Rooted<JS::Value> rval(cx);
51409
51410 JS::Rooted<JS::Value> callable(cx);
51411 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51412 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51413 !InitIds(cx, atomsCache)) ||
51414 !GetCallableProperty(cx, atomsCache->receiveCastableObjectSequence_id, &callable)) {
51415 aRv.Throw(NS_ERROR_UNEXPECTED);
51416 return;
51417 }
51418 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51419 if (!JS::Call(cx, thisValue, callable,
51420 JS::HandleValueArray::empty(), &rval)) {
51421 aRv.NoteJSContextException(cx);
51422 return;
51423 }
51424 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51425 if (rval.isObject()) {
51426 JS::ForOfIterator iter(cx);
51427 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51428 aRv.Throw(NS_ERROR_UNEXPECTED);
51429 return;
51430 }
51431 if (!iter.valueIsIterable()) {
51432 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence");
51433 aRv.Throw(NS_ERROR_UNEXPECTED);
51434 return;
51435 }
51436 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51437 JS::Rooted<JS::Value> temp(cx);
51438 while (true) {
51439 bool done;
51440 if (!iter.next(&temp, &done)) {
51441 aRv.Throw(NS_ERROR_UNEXPECTED);
51442 return;
51443 }
51444 if (done) {
51445 break;
51446 }
51447 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51448 if (!slotPtr) {
51449 JS_ReportOutOfMemory(cx);
51450 aRv.Throw(NS_ERROR_UNEXPECTED);
51451 return;
51452 }
51453 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51454 if (temp.isObject()) {
51455 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51456 {
51457 // Our JSContext should be in the right global to do unwrapping in.
51458 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51459 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51460 // Be careful to not wrap random DOM objects here, even if
51461 // they're wrapped in opaque security wrappers for some reason.
51462 // XXXbz Wish we could check for a JS-implemented object
51463 // that already has a content reflection...
51464 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51465 nsCOMPtr<nsIGlobalObject> contentGlobal;
51466 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51467 if (!callback ||
51468 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51469 aRv.Throw(NS_ERROR_UNEXPECTED);
51470 return;
51471 }
51472 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51473 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", 51474); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51474); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51474 "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", 51474); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51474); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51475 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51476 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51477 } else {
51478 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence", "TestJSImplInterface");
51479 aRv.Throw(NS_ERROR_UNEXPECTED);
51480 return;
51481 }
51482 }
51483 }
51484 } else {
51485 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence");
51486 aRv.Throw(NS_ERROR_UNEXPECTED);
51487 return;
51488 }
51489 }
51490 } else {
51491 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence");
51492 aRv.Throw(NS_ERROR_UNEXPECTED);
51493 return;
51494 }
51495 aRetVal = std::move(rvalDecl);
51496}
51497
51498void
51499TestJSImplInterfaceJSImpl::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51500{
51501 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51502 if (aRv.Failed()) {
51503 return;
51504 }
51505 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51505); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51505); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51506 BindingCallContext& cx = s.GetCallContext();
51507
51508 JS::Rooted<JS::Value> rval(cx);
51509
51510 JS::Rooted<JS::Value> callable(cx);
51511 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51512 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51513 !InitIds(cx, atomsCache)) ||
51514 !GetCallableProperty(cx, atomsCache->receiveCallbackObjectSequence_id, &callable)) {
51515 aRv.Throw(NS_ERROR_UNEXPECTED);
51516 return;
51517 }
51518 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51519 if (!JS::Call(cx, thisValue, callable,
51520 JS::HandleValueArray::empty(), &rval)) {
51521 aRv.NoteJSContextException(cx);
51522 return;
51523 }
51524 Sequence<RefPtr<TestCallbackInterface>> rvalDecl;
51525 if (rval.isObject()) {
51526 JS::ForOfIterator iter(cx);
51527 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51528 aRv.Throw(NS_ERROR_UNEXPECTED);
51529 return;
51530 }
51531 if (!iter.valueIsIterable()) {
51532 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence");
51533 aRv.Throw(NS_ERROR_UNEXPECTED);
51534 return;
51535 }
51536 Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl;
51537 JS::Rooted<JS::Value> temp(cx);
51538 while (true) {
51539 bool done;
51540 if (!iter.next(&temp, &done)) {
51541 aRv.Throw(NS_ERROR_UNEXPECTED);
51542 return;
51543 }
51544 if (done) {
51545 break;
51546 }
51547 RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51548 if (!slotPtr) {
51549 JS_ReportOutOfMemory(cx);
51550 aRv.Throw(NS_ERROR_UNEXPECTED);
51551 return;
51552 }
51553 RefPtr<TestCallbackInterface>& slot = *slotPtr;
51554 if (temp.isObject()) {
51555 { // scope for tempRoot and tempGlobalRoot if needed
51556 JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject());
51557 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
51558 slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
51559 }
51560 } else {
51561 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCallbackObjectSequence");
51562 aRv.Throw(NS_ERROR_UNEXPECTED);
51563 return;
51564 }
51565 }
51566 } else {
51567 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence");
51568 aRv.Throw(NS_ERROR_UNEXPECTED);
51569 return;
51570 }
51571 aRetVal = std::move(rvalDecl);
51572}
51573
51574void
51575TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51576{
51577 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51578 if (aRv.Failed()) {
51579 return;
51580 }
51581 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51581); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51581); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51582 BindingCallContext& cx = s.GetCallContext();
51583
51584 JS::Rooted<JS::Value> rval(cx);
51585
51586 JS::Rooted<JS::Value> callable(cx);
51587 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51588 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51589 !InitIds(cx, atomsCache)) ||
51590 !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectSequence_id, &callable)) {
51591 aRv.Throw(NS_ERROR_UNEXPECTED);
51592 return;
51593 }
51594 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51595 if (!JS::Call(cx, thisValue, callable,
51596 JS::HandleValueArray::empty(), &rval)) {
51597 aRv.NoteJSContextException(cx);
51598 return;
51599 }
51600 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51601 if (rval.isObject()) {
51602 JS::ForOfIterator iter(cx);
51603 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51604 aRv.Throw(NS_ERROR_UNEXPECTED);
51605 return;
51606 }
51607 if (!iter.valueIsIterable()) {
51608 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence");
51609 aRv.Throw(NS_ERROR_UNEXPECTED);
51610 return;
51611 }
51612 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51613 JS::Rooted<JS::Value> temp(cx);
51614 while (true) {
51615 bool done;
51616 if (!iter.next(&temp, &done)) {
51617 aRv.Throw(NS_ERROR_UNEXPECTED);
51618 return;
51619 }
51620 if (done) {
51621 break;
51622 }
51623 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51624 if (!slotPtr) {
51625 JS_ReportOutOfMemory(cx);
51626 aRv.Throw(NS_ERROR_UNEXPECTED);
51627 return;
51628 }
51629 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51630 if (temp.isObject()) {
51631 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51632 {
51633 // Our JSContext should be in the right global to do unwrapping in.
51634 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51635 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51636 // Be careful to not wrap random DOM objects here, even if
51637 // they're wrapped in opaque security wrappers for some reason.
51638 // XXXbz Wish we could check for a JS-implemented object
51639 // that already has a content reflection...
51640 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51641 nsCOMPtr<nsIGlobalObject> contentGlobal;
51642 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51643 if (!callback ||
51644 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51645 aRv.Throw(NS_ERROR_UNEXPECTED);
51646 return;
51647 }
51648 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51649 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", 51650); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51650); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51650 "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", 51650); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51650); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51651 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51652 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51653 } else {
51654 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "TestJSImplInterface");
51655 aRv.Throw(NS_ERROR_UNEXPECTED);
51656 return;
51657 }
51658 }
51659 }
51660 } else if (temp.isNullOrUndefined()) {
51661 slot = nullptr;
51662 } else {
51663 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence");
51664 aRv.Throw(NS_ERROR_UNEXPECTED);
51665 return;
51666 }
51667 }
51668 } else {
51669 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence");
51670 aRv.Throw(NS_ERROR_UNEXPECTED);
51671 return;
51672 }
51673 aRetVal = std::move(rvalDecl);
51674}
51675
51676void
51677TestJSImplInterfaceJSImpl::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51678{
51679 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51680 if (aRv.Failed()) {
51681 return;
51682 }
51683 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51683); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51683); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51684 BindingCallContext& cx = s.GetCallContext();
51685
51686 JS::Rooted<JS::Value> rval(cx);
51687
51688 JS::Rooted<JS::Value> callable(cx);
51689 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51690 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51691 !InitIds(cx, atomsCache)) ||
51692 !GetCallableProperty(cx, atomsCache->receiveNullableCallbackObjectSequence_id, &callable)) {
51693 aRv.Throw(NS_ERROR_UNEXPECTED);
51694 return;
51695 }
51696 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51697 if (!JS::Call(cx, thisValue, callable,
51698 JS::HandleValueArray::empty(), &rval)) {
51699 aRv.NoteJSContextException(cx);
51700 return;
51701 }
51702 Sequence<RefPtr<TestCallbackInterface>> rvalDecl;
51703 if (rval.isObject()) {
51704 JS::ForOfIterator iter(cx);
51705 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51706 aRv.Throw(NS_ERROR_UNEXPECTED);
51707 return;
51708 }
51709 if (!iter.valueIsIterable()) {
51710 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence");
51711 aRv.Throw(NS_ERROR_UNEXPECTED);
51712 return;
51713 }
51714 Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl;
51715 JS::Rooted<JS::Value> temp(cx);
51716 while (true) {
51717 bool done;
51718 if (!iter.next(&temp, &done)) {
51719 aRv.Throw(NS_ERROR_UNEXPECTED);
51720 return;
51721 }
51722 if (done) {
51723 break;
51724 }
51725 RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51726 if (!slotPtr) {
51727 JS_ReportOutOfMemory(cx);
51728 aRv.Throw(NS_ERROR_UNEXPECTED);
51729 return;
51730 }
51731 RefPtr<TestCallbackInterface>& slot = *slotPtr;
51732 if (temp.isObject()) {
51733 { // scope for tempRoot and tempGlobalRoot if needed
51734 JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject());
51735 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
51736 slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
51737 }
51738 } else if (temp.isNullOrUndefined()) {
51739 slot = nullptr;
51740 } else {
51741 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCallbackObjectSequence");
51742 aRv.Throw(NS_ERROR_UNEXPECTED);
51743 return;
51744 }
51745 }
51746 } else {
51747 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence");
51748 aRv.Throw(NS_ERROR_UNEXPECTED);
51749 return;
51750 }
51751 aRetVal = std::move(rvalDecl);
51752}
51753
51754void
51755TestJSImplInterfaceJSImpl::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51756{
51757 CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51758 if (aRv.Failed()) {
51759 return;
51760 }
51761 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51761); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51761); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51762 BindingCallContext& cx = s.GetCallContext();
51763
51764 JS::Rooted<JS::Value> rval(cx);
51765
51766 JS::Rooted<JS::Value> callable(cx);
51767 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51768 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51769 !InitIds(cx, atomsCache)) ||
51770 !GetCallableProperty(cx, atomsCache->receiveCastableObjectNullableSequence_id, &callable)) {
51771 aRv.Throw(NS_ERROR_UNEXPECTED);
51772 return;
51773 }
51774 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51775 if (!JS::Call(cx, thisValue, callable,
51776 JS::HandleValueArray::empty(), &rval)) {
51777 aRv.NoteJSContextException(cx);
51778 return;
51779 }
51780 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
51781 if (rval.isObject()) {
51782 JS::ForOfIterator iter(cx);
51783 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51784 aRv.Throw(NS_ERROR_UNEXPECTED);
51785 return;
51786 }
51787 if (!iter.valueIsIterable()) {
51788 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence");
51789 aRv.Throw(NS_ERROR_UNEXPECTED);
51790 return;
51791 }
51792 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
51793 JS::Rooted<JS::Value> temp(cx);
51794 while (true) {
51795 bool done;
51796 if (!iter.next(&temp, &done)) {
51797 aRv.Throw(NS_ERROR_UNEXPECTED);
51798 return;
51799 }
51800 if (done) {
51801 break;
51802 }
51803 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51804 if (!slotPtr) {
51805 JS_ReportOutOfMemory(cx);
51806 aRv.Throw(NS_ERROR_UNEXPECTED);
51807 return;
51808 }
51809 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51810 if (temp.isObject()) {
51811 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51812 {
51813 // Our JSContext should be in the right global to do unwrapping in.
51814 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51815 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51816 // Be careful to not wrap random DOM objects here, even if
51817 // they're wrapped in opaque security wrappers for some reason.
51818 // XXXbz Wish we could check for a JS-implemented object
51819 // that already has a content reflection...
51820 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51821 nsCOMPtr<nsIGlobalObject> contentGlobal;
51822 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51823 if (!callback ||
51824 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51825 aRv.Throw(NS_ERROR_UNEXPECTED);
51826 return;
51827 }
51828 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51829 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", 51830); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51830); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51830 "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", 51830); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51830); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51831 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51832 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51833 } else {
51834 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "TestJSImplInterface");
51835 aRv.Throw(NS_ERROR_UNEXPECTED);
51836 return;
51837 }
51838 }
51839 }
51840 } else {
51841 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence");
51842 aRv.Throw(NS_ERROR_UNEXPECTED);
51843 return;
51844 }
51845 }
51846 } else if (rval.isNullOrUndefined()) {
51847 rvalDecl.SetNull();
51848 } else {
51849 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence");
51850 aRv.Throw(NS_ERROR_UNEXPECTED);
51851 return;
51852 }
51853 if (rvalDecl.IsNull()) {
51854 aRetVal.SetNull();
51855 } else {
51856 aRetVal.SetValue() = std::move(rvalDecl.Value());
51857 }
51858}
51859
51860void
51861TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51862{
51863 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51864 if (aRv.Failed()) {
51865 return;
51866 }
51867 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51867); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51867); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51868 BindingCallContext& cx = s.GetCallContext();
51869
51870 JS::Rooted<JS::Value> rval(cx);
51871
51872 JS::Rooted<JS::Value> callable(cx);
51873 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51874 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51875 !InitIds(cx, atomsCache)) ||
51876 !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectNullableSequence_id, &callable)) {
51877 aRv.Throw(NS_ERROR_UNEXPECTED);
51878 return;
51879 }
51880 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51881 if (!JS::Call(cx, thisValue, callable,
51882 JS::HandleValueArray::empty(), &rval)) {
51883 aRv.NoteJSContextException(cx);
51884 return;
51885 }
51886 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
51887 if (rval.isObject()) {
51888 JS::ForOfIterator iter(cx);
51889 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51890 aRv.Throw(NS_ERROR_UNEXPECTED);
51891 return;
51892 }
51893 if (!iter.valueIsIterable()) {
51894 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence");
51895 aRv.Throw(NS_ERROR_UNEXPECTED);
51896 return;
51897 }
51898 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
51899 JS::Rooted<JS::Value> temp(cx);
51900 while (true) {
51901 bool done;
51902 if (!iter.next(&temp, &done)) {
51903 aRv.Throw(NS_ERROR_UNEXPECTED);
51904 return;
51905 }
51906 if (done) {
51907 break;
51908 }
51909 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51910 if (!slotPtr) {
51911 JS_ReportOutOfMemory(cx);
51912 aRv.Throw(NS_ERROR_UNEXPECTED);
51913 return;
51914 }
51915 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51916 if (temp.isObject()) {
51917 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51918 {
51919 // Our JSContext should be in the right global to do unwrapping in.
51920 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51921 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51922 // Be careful to not wrap random DOM objects here, even if
51923 // they're wrapped in opaque security wrappers for some reason.
51924 // XXXbz Wish we could check for a JS-implemented object
51925 // that already has a content reflection...
51926 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51927 nsCOMPtr<nsIGlobalObject> contentGlobal;
51928 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51929 if (!callback ||
51930 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51931 aRv.Throw(NS_ERROR_UNEXPECTED);
51932 return;
51933 }
51934 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51935 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", 51936); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51936); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51936 "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", 51936); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 51936); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51937 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51938 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51939 } else {
51940 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "TestJSImplInterface");
51941 aRv.Throw(NS_ERROR_UNEXPECTED);
51942 return;
51943 }
51944 }
51945 }
51946 } else if (temp.isNullOrUndefined()) {
51947 slot = nullptr;
51948 } else {
51949 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence");
51950 aRv.Throw(NS_ERROR_UNEXPECTED);
51951 return;
51952 }
51953 }
51954 } else if (rval.isNullOrUndefined()) {
51955 rvalDecl.SetNull();
51956 } else {
51957 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence");
51958 aRv.Throw(NS_ERROR_UNEXPECTED);
51959 return;
51960 }
51961 if (rvalDecl.IsNull()) {
51962 aRetVal.SetNull();
51963 } else {
51964 aRetVal.SetValue() = std::move(rvalDecl.Value());
51965 }
51966}
51967
51968void
51969TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51970{
51971 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51972 if (aRv.Failed()) {
51973 return;
51974 }
51975 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51975); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 51975); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
51976 BindingCallContext& cx = s.GetCallContext();
51977
51978 JS::Rooted<JS::Value> rval(cx);
51979
51980 JS::Rooted<JS::Value> callable(cx);
51981 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51982 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51983 !InitIds(cx, atomsCache)) ||
51984 !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectSequence_id, &callable)) {
51985 aRv.Throw(NS_ERROR_UNEXPECTED);
51986 return;
51987 }
51988 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51989 if (!JS::Call(cx, thisValue, callable,
51990 JS::HandleValueArray::empty(), &rval)) {
51991 aRv.NoteJSContextException(cx);
51992 return;
51993 }
51994 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51995 if (rval.isObject()) {
51996 JS::ForOfIterator iter(cx);
51997 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51998 aRv.Throw(NS_ERROR_UNEXPECTED);
51999 return;
52000 }
52001 if (!iter.valueIsIterable()) {
52002 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence");
52003 aRv.Throw(NS_ERROR_UNEXPECTED);
52004 return;
52005 }
52006 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
52007 JS::Rooted<JS::Value> temp(cx);
52008 while (true) {
52009 bool done;
52010 if (!iter.next(&temp, &done)) {
52011 aRv.Throw(NS_ERROR_UNEXPECTED);
52012 return;
52013 }
52014 if (done) {
52015 break;
52016 }
52017 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52018 if (!slotPtr) {
52019 JS_ReportOutOfMemory(cx);
52020 aRv.Throw(NS_ERROR_UNEXPECTED);
52021 return;
52022 }
52023 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52024 if (temp.isObject()) {
52025 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52026 {
52027 // Our JSContext should be in the right global to do unwrapping in.
52028 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52029 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52030 // Be careful to not wrap random DOM objects here, even if
52031 // they're wrapped in opaque security wrappers for some reason.
52032 // XXXbz Wish we could check for a JS-implemented object
52033 // that already has a content reflection...
52034 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52035 nsCOMPtr<nsIGlobalObject> contentGlobal;
52036 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52037 if (!callback ||
52038 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52039 aRv.Throw(NS_ERROR_UNEXPECTED);
52040 return;
52041 }
52042 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52043 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", 52044); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52044); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52044 "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", 52044); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52044); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52045 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52046 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52047 } else {
52048 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "TestJSImplInterface");
52049 aRv.Throw(NS_ERROR_UNEXPECTED);
52050 return;
52051 }
52052 }
52053 }
52054 } else {
52055 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence");
52056 aRv.Throw(NS_ERROR_UNEXPECTED);
52057 return;
52058 }
52059 }
52060 } else {
52061 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence");
52062 aRv.Throw(NS_ERROR_UNEXPECTED);
52063 return;
52064 }
52065 aRetVal = std::move(rvalDecl);
52066}
52067
52068void
52069TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
52070{
52071 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52072 if (aRv.Failed()) {
52073 return;
52074 }
52075 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52075); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52075); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52076 BindingCallContext& cx = s.GetCallContext();
52077
52078 JS::Rooted<JS::Value> rval(cx);
52079
52080 JS::Rooted<JS::Value> callable(cx);
52081 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52082 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52083 !InitIds(cx, atomsCache)) ||
52084 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectSequence_id, &callable)) {
52085 aRv.Throw(NS_ERROR_UNEXPECTED);
52086 return;
52087 }
52088 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52089 if (!JS::Call(cx, thisValue, callable,
52090 JS::HandleValueArray::empty(), &rval)) {
52091 aRv.NoteJSContextException(cx);
52092 return;
52093 }
52094 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
52095 if (rval.isObject()) {
52096 JS::ForOfIterator iter(cx);
52097 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
52098 aRv.Throw(NS_ERROR_UNEXPECTED);
52099 return;
52100 }
52101 if (!iter.valueIsIterable()) {
52102 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence");
52103 aRv.Throw(NS_ERROR_UNEXPECTED);
52104 return;
52105 }
52106 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
52107 JS::Rooted<JS::Value> temp(cx);
52108 while (true) {
52109 bool done;
52110 if (!iter.next(&temp, &done)) {
52111 aRv.Throw(NS_ERROR_UNEXPECTED);
52112 return;
52113 }
52114 if (done) {
52115 break;
52116 }
52117 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52118 if (!slotPtr) {
52119 JS_ReportOutOfMemory(cx);
52120 aRv.Throw(NS_ERROR_UNEXPECTED);
52121 return;
52122 }
52123 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52124 if (temp.isObject()) {
52125 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52126 {
52127 // Our JSContext should be in the right global to do unwrapping in.
52128 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52129 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52130 // Be careful to not wrap random DOM objects here, even if
52131 // they're wrapped in opaque security wrappers for some reason.
52132 // XXXbz Wish we could check for a JS-implemented object
52133 // that already has a content reflection...
52134 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52135 nsCOMPtr<nsIGlobalObject> contentGlobal;
52136 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52137 if (!callback ||
52138 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52139 aRv.Throw(NS_ERROR_UNEXPECTED);
52140 return;
52141 }
52142 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52143 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", 52144); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52144); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52144 "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", 52144); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52144); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52145 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52146 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52147 } else {
52148 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "TestJSImplInterface");
52149 aRv.Throw(NS_ERROR_UNEXPECTED);
52150 return;
52151 }
52152 }
52153 }
52154 } else if (temp.isNullOrUndefined()) {
52155 slot = nullptr;
52156 } else {
52157 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence");
52158 aRv.Throw(NS_ERROR_UNEXPECTED);
52159 return;
52160 }
52161 }
52162 } else {
52163 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence");
52164 aRv.Throw(NS_ERROR_UNEXPECTED);
52165 return;
52166 }
52167 aRetVal = std::move(rvalDecl);
52168}
52169
52170void
52171TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
52172{
52173 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52174 if (aRv.Failed()) {
52175 return;
52176 }
52177 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52177); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52177); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52178 BindingCallContext& cx = s.GetCallContext();
52179
52180 JS::Rooted<JS::Value> rval(cx);
52181
52182 JS::Rooted<JS::Value> callable(cx);
52183 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52184 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52185 !InitIds(cx, atomsCache)) ||
52186 !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectNullableSequence_id, &callable)) {
52187 aRv.Throw(NS_ERROR_UNEXPECTED);
52188 return;
52189 }
52190 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52191 if (!JS::Call(cx, thisValue, callable,
52192 JS::HandleValueArray::empty(), &rval)) {
52193 aRv.NoteJSContextException(cx);
52194 return;
52195 }
52196 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
52197 if (rval.isObject()) {
52198 JS::ForOfIterator iter(cx);
52199 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
52200 aRv.Throw(NS_ERROR_UNEXPECTED);
52201 return;
52202 }
52203 if (!iter.valueIsIterable()) {
52204 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence");
52205 aRv.Throw(NS_ERROR_UNEXPECTED);
52206 return;
52207 }
52208 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
52209 JS::Rooted<JS::Value> temp(cx);
52210 while (true) {
52211 bool done;
52212 if (!iter.next(&temp, &done)) {
52213 aRv.Throw(NS_ERROR_UNEXPECTED);
52214 return;
52215 }
52216 if (done) {
52217 break;
52218 }
52219 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52220 if (!slotPtr) {
52221 JS_ReportOutOfMemory(cx);
52222 aRv.Throw(NS_ERROR_UNEXPECTED);
52223 return;
52224 }
52225 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52226 if (temp.isObject()) {
52227 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52228 {
52229 // Our JSContext should be in the right global to do unwrapping in.
52230 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52231 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52232 // Be careful to not wrap random DOM objects here, even if
52233 // they're wrapped in opaque security wrappers for some reason.
52234 // XXXbz Wish we could check for a JS-implemented object
52235 // that already has a content reflection...
52236 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52237 nsCOMPtr<nsIGlobalObject> contentGlobal;
52238 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52239 if (!callback ||
52240 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52241 aRv.Throw(NS_ERROR_UNEXPECTED);
52242 return;
52243 }
52244 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52245 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", 52246); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52246); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52246 "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", 52246); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52246); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52247 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52248 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52249 } else {
52250 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "TestJSImplInterface");
52251 aRv.Throw(NS_ERROR_UNEXPECTED);
52252 return;
52253 }
52254 }
52255 }
52256 } else {
52257 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence");
52258 aRv.Throw(NS_ERROR_UNEXPECTED);
52259 return;
52260 }
52261 }
52262 } else if (rval.isNullOrUndefined()) {
52263 rvalDecl.SetNull();
52264 } else {
52265 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence");
52266 aRv.Throw(NS_ERROR_UNEXPECTED);
52267 return;
52268 }
52269 if (rvalDecl.IsNull()) {
52270 aRetVal.SetNull();
52271 } else {
52272 aRetVal.SetValue() = std::move(rvalDecl.Value());
52273 }
52274}
52275
52276void
52277TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
52278{
52279 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52280 if (aRv.Failed()) {
52281 return;
52282 }
52283 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52283); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52283); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52284 BindingCallContext& cx = s.GetCallContext();
52285
52286 JS::Rooted<JS::Value> rval(cx);
52287
52288 JS::Rooted<JS::Value> callable(cx);
52289 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52290 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52291 !InitIds(cx, atomsCache)) ||
52292 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectNullableSequence_id, &callable)) {
52293 aRv.Throw(NS_ERROR_UNEXPECTED);
52294 return;
52295 }
52296 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52297 if (!JS::Call(cx, thisValue, callable,
52298 JS::HandleValueArray::empty(), &rval)) {
52299 aRv.NoteJSContextException(cx);
52300 return;
52301 }
52302 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
52303 if (rval.isObject()) {
52304 JS::ForOfIterator iter(cx);
52305 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
52306 aRv.Throw(NS_ERROR_UNEXPECTED);
52307 return;
52308 }
52309 if (!iter.valueIsIterable()) {
52310 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence");
52311 aRv.Throw(NS_ERROR_UNEXPECTED);
52312 return;
52313 }
52314 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
52315 JS::Rooted<JS::Value> temp(cx);
52316 while (true) {
52317 bool done;
52318 if (!iter.next(&temp, &done)) {
52319 aRv.Throw(NS_ERROR_UNEXPECTED);
52320 return;
52321 }
52322 if (done) {
52323 break;
52324 }
52325 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52326 if (!slotPtr) {
52327 JS_ReportOutOfMemory(cx);
52328 aRv.Throw(NS_ERROR_UNEXPECTED);
52329 return;
52330 }
52331 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52332 if (temp.isObject()) {
52333 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52334 {
52335 // Our JSContext should be in the right global to do unwrapping in.
52336 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52337 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52338 // Be careful to not wrap random DOM objects here, even if
52339 // they're wrapped in opaque security wrappers for some reason.
52340 // XXXbz Wish we could check for a JS-implemented object
52341 // that already has a content reflection...
52342 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52343 nsCOMPtr<nsIGlobalObject> contentGlobal;
52344 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52345 if (!callback ||
52346 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52347 aRv.Throw(NS_ERROR_UNEXPECTED);
52348 return;
52349 }
52350 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52351 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", 52352); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52352); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52352 "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", 52352); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 52352); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52353 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52354 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52355 } else {
52356 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "TestJSImplInterface");
52357 aRv.Throw(NS_ERROR_UNEXPECTED);
52358 return;
52359 }
52360 }
52361 }
52362 } else if (temp.isNullOrUndefined()) {
52363 slot = nullptr;
52364 } else {
52365 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence");
52366 aRv.Throw(NS_ERROR_UNEXPECTED);
52367 return;
52368 }
52369 }
52370 } else if (rval.isNullOrUndefined()) {
52371 rvalDecl.SetNull();
52372 } else {
52373 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence");
52374 aRv.Throw(NS_ERROR_UNEXPECTED);
52375 return;
52376 }
52377 if (rvalDecl.IsNull()) {
52378 aRetVal.SetNull();
52379 } else {
52380 aRetVal.SetValue() = std::move(rvalDecl.Value());
52381 }
52382}
52383
52384void
52385TestJSImplInterfaceJSImpl::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52386{
52387 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52388 if (aRv.Failed()) {
52389 return;
52390 }
52391 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52391); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52391); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52392 BindingCallContext& cx = s.GetCallContext();
52393
52394 JS::Rooted<JS::Value> rval(cx);
52395 JS::RootedVector<JS::Value> argv(cx);
52396 if (!argv.resize(1)) {
52397 // That threw an exception on the JSContext, and our CallSetup will do
52398 // the right thing with that.
52399 return;
52400 }
52401 unsigned argc = 1;
52402
52403 do {
52404
52405 uint32_t length = arg.Length();
52406 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52407 if (!returnArray) {
52408 aRv.Throw(NS_ERROR_UNEXPECTED);
52409 return;
52410 }
52411 // Scope for 'tmp'
52412 {
52413 JS::Rooted<JS::Value> tmp(cx);
52414 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52415 // Control block to let us common up the JS_DefineElement calls when there
52416 // are different ways to succeed at wrapping the object.
52417 do {
52418 if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) {
52419 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 52419); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52420 aRv.Throw(NS_ERROR_UNEXPECTED);
52421 return;
52422 }
52423 break;
52424 } while (false);
52425 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52426 JSPROP_ENUMERATE)) {
52427 aRv.Throw(NS_ERROR_UNEXPECTED);
52428 return;
52429 }
52430 }
52431 }
52432 argv[0].setObject(*returnArray);
52433 break;
52434 } while (false);
52435
52436 JS::Rooted<JS::Value> callable(cx);
52437 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52438 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52439 !InitIds(cx, atomsCache)) ||
52440 !GetCallableProperty(cx, atomsCache->passCastableObjectSequence_id, &callable)) {
52441 aRv.Throw(NS_ERROR_UNEXPECTED);
52442 return;
52443 }
52444 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52445 if (!JS::Call(cx, thisValue, callable,
52446 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52447 aRv.NoteJSContextException(cx);
52448 return;
52449 }
52450}
52451
52452void
52453TestJSImplInterfaceJSImpl::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52454{
52455 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52456 if (aRv.Failed()) {
52457 return;
52458 }
52459 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52459); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52459); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52460 BindingCallContext& cx = s.GetCallContext();
52461
52462 JS::Rooted<JS::Value> rval(cx);
52463 JS::RootedVector<JS::Value> argv(cx);
52464 if (!argv.resize(1)) {
52465 // That threw an exception on the JSContext, and our CallSetup will do
52466 // the right thing with that.
52467 return;
52468 }
52469 unsigned argc = 1;
52470
52471 do {
52472
52473 uint32_t length = arg.Length();
52474 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52475 if (!returnArray) {
52476 aRv.Throw(NS_ERROR_UNEXPECTED);
52477 return;
52478 }
52479 // Scope for 'tmp'
52480 {
52481 JS::Rooted<JS::Value> tmp(cx);
52482 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52483 // Control block to let us common up the JS_DefineElement calls when there
52484 // are different ways to succeed at wrapping the object.
52485 do {
52486 if (!arg[sequenceIdx0]) {
52487 tmp.setNull();
52488 break;
52489 }
52490 if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) {
52491 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52491); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 52491); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52492 aRv.Throw(NS_ERROR_UNEXPECTED);
52493 return;
52494 }
52495 break;
52496 } while (false);
52497 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52498 JSPROP_ENUMERATE)) {
52499 aRv.Throw(NS_ERROR_UNEXPECTED);
52500 return;
52501 }
52502 }
52503 }
52504 argv[0].setObject(*returnArray);
52505 break;
52506 } while (false);
52507
52508 JS::Rooted<JS::Value> callable(cx);
52509 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52510 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52511 !InitIds(cx, atomsCache)) ||
52512 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectSequence_id, &callable)) {
52513 aRv.Throw(NS_ERROR_UNEXPECTED);
52514 return;
52515 }
52516 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52517 if (!JS::Call(cx, thisValue, callable,
52518 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52519 aRv.NoteJSContextException(cx);
52520 return;
52521 }
52522}
52523
52524void
52525TestJSImplInterfaceJSImpl::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52526{
52527 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52528 if (aRv.Failed()) {
52529 return;
52530 }
52531 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52531); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52531); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52532 BindingCallContext& cx = s.GetCallContext();
52533
52534 JS::Rooted<JS::Value> rval(cx);
52535 JS::RootedVector<JS::Value> argv(cx);
52536 if (!argv.resize(1)) {
52537 // That threw an exception on the JSContext, and our CallSetup will do
52538 // the right thing with that.
52539 return;
52540 }
52541 unsigned argc = 1;
52542
52543 do {
52544
52545 if (arg.IsNull()) {
52546 argv[0].setNull();
52547 break;
52548 }
52549
52550 uint32_t length = arg.Value().Length();
52551 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52552 if (!returnArray) {
52553 aRv.Throw(NS_ERROR_UNEXPECTED);
52554 return;
52555 }
52556 // Scope for 'tmp'
52557 {
52558 JS::Rooted<JS::Value> tmp(cx);
52559 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52560 // Control block to let us common up the JS_DefineElement calls when there
52561 // are different ways to succeed at wrapping the object.
52562 do {
52563 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
52564 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52564); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 52564); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52565 aRv.Throw(NS_ERROR_UNEXPECTED);
52566 return;
52567 }
52568 break;
52569 } while (false);
52570 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52571 JSPROP_ENUMERATE)) {
52572 aRv.Throw(NS_ERROR_UNEXPECTED);
52573 return;
52574 }
52575 }
52576 }
52577 argv[0].setObject(*returnArray);
52578 break;
52579 } while (false);
52580
52581 JS::Rooted<JS::Value> callable(cx);
52582 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52583 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52584 !InitIds(cx, atomsCache)) ||
52585 !GetCallableProperty(cx, atomsCache->passCastableObjectNullableSequence_id, &callable)) {
52586 aRv.Throw(NS_ERROR_UNEXPECTED);
52587 return;
52588 }
52589 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52590 if (!JS::Call(cx, thisValue, callable,
52591 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52592 aRv.NoteJSContextException(cx);
52593 return;
52594 }
52595}
52596
52597void
52598TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52599{
52600 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52601 if (aRv.Failed()) {
52602 return;
52603 }
52604 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52604); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52604); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52605 BindingCallContext& cx = s.GetCallContext();
52606
52607 JS::Rooted<JS::Value> rval(cx);
52608 JS::RootedVector<JS::Value> argv(cx);
52609 if (!argv.resize(1)) {
52610 // That threw an exception on the JSContext, and our CallSetup will do
52611 // the right thing with that.
52612 return;
52613 }
52614 unsigned argc = 1;
52615
52616 do {
52617
52618 if (arg.IsNull()) {
52619 argv[0].setNull();
52620 break;
52621 }
52622
52623 uint32_t length = arg.Value().Length();
52624 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52625 if (!returnArray) {
52626 aRv.Throw(NS_ERROR_UNEXPECTED);
52627 return;
52628 }
52629 // Scope for 'tmp'
52630 {
52631 JS::Rooted<JS::Value> tmp(cx);
52632 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52633 // Control block to let us common up the JS_DefineElement calls when there
52634 // are different ways to succeed at wrapping the object.
52635 do {
52636 if (!arg.Value()[sequenceIdx0]) {
52637 tmp.setNull();
52638 break;
52639 }
52640 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
52641 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52641); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 52641); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52642 aRv.Throw(NS_ERROR_UNEXPECTED);
52643 return;
52644 }
52645 break;
52646 } while (false);
52647 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52648 JSPROP_ENUMERATE)) {
52649 aRv.Throw(NS_ERROR_UNEXPECTED);
52650 return;
52651 }
52652 }
52653 }
52654 argv[0].setObject(*returnArray);
52655 break;
52656 } while (false);
52657
52658 JS::Rooted<JS::Value> callable(cx);
52659 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52660 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52661 !InitIds(cx, atomsCache)) ||
52662 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableSequence_id, &callable)) {
52663 aRv.Throw(NS_ERROR_UNEXPECTED);
52664 return;
52665 }
52666 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52667 if (!JS::Call(cx, thisValue, callable,
52668 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52669 aRv.NoteJSContextException(cx);
52670 return;
52671 }
52672}
52673
52674void
52675TestJSImplInterfaceJSImpl::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52676{
52677 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52678 if (aRv.Failed()) {
52679 return;
52680 }
52681 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52681); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52681); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52682 BindingCallContext& cx = s.GetCallContext();
52683
52684 JS::Rooted<JS::Value> rval(cx);
52685 JS::RootedVector<JS::Value> argv(cx);
52686 if (!argv.resize(1)) {
52687 // That threw an exception on the JSContext, and our CallSetup will do
52688 // the right thing with that.
52689 return;
52690 }
52691 unsigned argc = 1;
52692
52693 do {
52694 if (arg.WasPassed()) {
52695
52696 uint32_t length = arg.Value().Length();
52697 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52698 if (!returnArray) {
52699 aRv.Throw(NS_ERROR_UNEXPECTED);
52700 return;
52701 }
52702 // Scope for 'tmp'
52703 {
52704 JS::Rooted<JS::Value> tmp(cx);
52705 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52706 // Control block to let us common up the JS_DefineElement calls when there
52707 // are different ways to succeed at wrapping the object.
52708 do {
52709 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52710 break;
52711 } while (false);
52712 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52713 JSPROP_ENUMERATE)) {
52714 aRv.Throw(NS_ERROR_UNEXPECTED);
52715 return;
52716 }
52717 }
52718 }
52719 argv[0].setObject(*returnArray);
52720 break;
52721 } else if (argc == 1) {
52722 // This is our current trailing argument; reduce argc
52723 --argc;
52724 } else {
52725 argv[0].setUndefined();
52726 }
52727 } while (false);
52728
52729 JS::Rooted<JS::Value> callable(cx);
52730 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52731 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52732 !InitIds(cx, atomsCache)) ||
52733 !GetCallableProperty(cx, atomsCache->passOptionalSequence_id, &callable)) {
52734 aRv.Throw(NS_ERROR_UNEXPECTED);
52735 return;
52736 }
52737 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52738 if (!JS::Call(cx, thisValue, callable,
52739 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52740 aRv.NoteJSContextException(cx);
52741 return;
52742 }
52743}
52744
52745void
52746TestJSImplInterfaceJSImpl::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52747{
52748 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52749 if (aRv.Failed()) {
52750 return;
52751 }
52752 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52752); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52752); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52753 BindingCallContext& cx = s.GetCallContext();
52754
52755 JS::Rooted<JS::Value> rval(cx);
52756 JS::RootedVector<JS::Value> argv(cx);
52757 if (!argv.resize(1)) {
52758 // That threw an exception on the JSContext, and our CallSetup will do
52759 // the right thing with that.
52760 return;
52761 }
52762 unsigned argc = 1;
52763
52764 do {
52765
52766 uint32_t length = arg.Length();
52767 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52768 if (!returnArray) {
52769 aRv.Throw(NS_ERROR_UNEXPECTED);
52770 return;
52771 }
52772 // Scope for 'tmp'
52773 {
52774 JS::Rooted<JS::Value> tmp(cx);
52775 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52776 // Control block to let us common up the JS_DefineElement calls when there
52777 // are different ways to succeed at wrapping the object.
52778 do {
52779 tmp.setInt32(int32_t(arg[sequenceIdx0]));
52780 break;
52781 } while (false);
52782 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52783 JSPROP_ENUMERATE)) {
52784 aRv.Throw(NS_ERROR_UNEXPECTED);
52785 return;
52786 }
52787 }
52788 }
52789 argv[0].setObject(*returnArray);
52790 break;
52791 } while (false);
52792
52793 JS::Rooted<JS::Value> callable(cx);
52794 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52795 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52796 !InitIds(cx, atomsCache)) ||
52797 !GetCallableProperty(cx, atomsCache->passOptionalSequenceWithDefaultValue_id, &callable)) {
52798 aRv.Throw(NS_ERROR_UNEXPECTED);
52799 return;
52800 }
52801 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52802 if (!JS::Call(cx, thisValue, callable,
52803 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52804 aRv.NoteJSContextException(cx);
52805 return;
52806 }
52807}
52808
52809void
52810TestJSImplInterfaceJSImpl::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52811{
52812 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52813 if (aRv.Failed()) {
52814 return;
52815 }
52816 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52816); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52816); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52817 BindingCallContext& cx = s.GetCallContext();
52818
52819 JS::Rooted<JS::Value> rval(cx);
52820 JS::RootedVector<JS::Value> argv(cx);
52821 if (!argv.resize(1)) {
52822 // That threw an exception on the JSContext, and our CallSetup will do
52823 // the right thing with that.
52824 return;
52825 }
52826 unsigned argc = 1;
52827
52828 do {
52829 if (arg.WasPassed()) {
52830
52831 if (arg.Value().IsNull()) {
52832 argv[0].setNull();
52833 break;
52834 }
52835
52836 uint32_t length = arg.Value().Value().Length();
52837 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52838 if (!returnArray) {
52839 aRv.Throw(NS_ERROR_UNEXPECTED);
52840 return;
52841 }
52842 // Scope for 'tmp'
52843 {
52844 JS::Rooted<JS::Value> tmp(cx);
52845 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52846 // Control block to let us common up the JS_DefineElement calls when there
52847 // are different ways to succeed at wrapping the object.
52848 do {
52849 tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0]));
52850 break;
52851 } while (false);
52852 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52853 JSPROP_ENUMERATE)) {
52854 aRv.Throw(NS_ERROR_UNEXPECTED);
52855 return;
52856 }
52857 }
52858 }
52859 argv[0].setObject(*returnArray);
52860 break;
52861 } else if (argc == 1) {
52862 // This is our current trailing argument; reduce argc
52863 --argc;
52864 } else {
52865 argv[0].setUndefined();
52866 }
52867 } while (false);
52868
52869 JS::Rooted<JS::Value> callable(cx);
52870 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52871 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52872 !InitIds(cx, atomsCache)) ||
52873 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequence_id, &callable)) {
52874 aRv.Throw(NS_ERROR_UNEXPECTED);
52875 return;
52876 }
52877 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52878 if (!JS::Call(cx, thisValue, callable,
52879 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52880 aRv.NoteJSContextException(cx);
52881 return;
52882 }
52883}
52884
52885void
52886TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52887{
52888 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52889 if (aRv.Failed()) {
52890 return;
52891 }
52892 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52892); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52892); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52893 BindingCallContext& cx = s.GetCallContext();
52894
52895 JS::Rooted<JS::Value> rval(cx);
52896 JS::RootedVector<JS::Value> argv(cx);
52897 if (!argv.resize(1)) {
52898 // That threw an exception on the JSContext, and our CallSetup will do
52899 // the right thing with that.
52900 return;
52901 }
52902 unsigned argc = 1;
52903
52904 do {
52905
52906 if (arg.IsNull()) {
52907 argv[0].setNull();
52908 break;
52909 }
52910
52911 uint32_t length = arg.Value().Length();
52912 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52913 if (!returnArray) {
52914 aRv.Throw(NS_ERROR_UNEXPECTED);
52915 return;
52916 }
52917 // Scope for 'tmp'
52918 {
52919 JS::Rooted<JS::Value> tmp(cx);
52920 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52921 // Control block to let us common up the JS_DefineElement calls when there
52922 // are different ways to succeed at wrapping the object.
52923 do {
52924 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52925 break;
52926 } while (false);
52927 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52928 JSPROP_ENUMERATE)) {
52929 aRv.Throw(NS_ERROR_UNEXPECTED);
52930 return;
52931 }
52932 }
52933 }
52934 argv[0].setObject(*returnArray);
52935 break;
52936 } while (false);
52937
52938 JS::Rooted<JS::Value> callable(cx);
52939 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52940 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52941 !InitIds(cx, atomsCache)) ||
52942 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue_id, &callable)) {
52943 aRv.Throw(NS_ERROR_UNEXPECTED);
52944 return;
52945 }
52946 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52947 if (!JS::Call(cx, thisValue, callable,
52948 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52949 aRv.NoteJSContextException(cx);
52950 return;
52951 }
52952}
52953
52954void
52955TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52956{
52957 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52958 if (aRv.Failed()) {
52959 return;
52960 }
52961 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52961); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 52961); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
52962 BindingCallContext& cx = s.GetCallContext();
52963
52964 JS::Rooted<JS::Value> rval(cx);
52965 JS::RootedVector<JS::Value> argv(cx);
52966 if (!argv.resize(1)) {
52967 // That threw an exception on the JSContext, and our CallSetup will do
52968 // the right thing with that.
52969 return;
52970 }
52971 unsigned argc = 1;
52972
52973 do {
52974
52975 if (arg.IsNull()) {
52976 argv[0].setNull();
52977 break;
52978 }
52979
52980 uint32_t length = arg.Value().Length();
52981 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52982 if (!returnArray) {
52983 aRv.Throw(NS_ERROR_UNEXPECTED);
52984 return;
52985 }
52986 // Scope for 'tmp'
52987 {
52988 JS::Rooted<JS::Value> tmp(cx);
52989 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52990 // Control block to let us common up the JS_DefineElement calls when there
52991 // are different ways to succeed at wrapping the object.
52992 do {
52993 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52994 break;
52995 } while (false);
52996 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52997 JSPROP_ENUMERATE)) {
52998 aRv.Throw(NS_ERROR_UNEXPECTED);
52999 return;
53000 }
53001 }
53002 }
53003 argv[0].setObject(*returnArray);
53004 break;
53005 } while (false);
53006
53007 JS::Rooted<JS::Value> callable(cx);
53008 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53009 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53010 !InitIds(cx, atomsCache)) ||
53011 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue2_id, &callable)) {
53012 aRv.Throw(NS_ERROR_UNEXPECTED);
53013 return;
53014 }
53015 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53016 if (!JS::Call(cx, thisValue, callable,
53017 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53018 aRv.NoteJSContextException(cx);
53019 return;
53020 }
53021}
53022
53023void
53024TestJSImplInterfaceJSImpl::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53025{
53026 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53027 if (aRv.Failed()) {
53028 return;
53029 }
53030 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53030); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53030); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53031 BindingCallContext& cx = s.GetCallContext();
53032
53033 JS::Rooted<JS::Value> rval(cx);
53034 JS::RootedVector<JS::Value> argv(cx);
53035 if (!argv.resize(1)) {
53036 // That threw an exception on the JSContext, and our CallSetup will do
53037 // the right thing with that.
53038 return;
53039 }
53040 unsigned argc = 1;
53041
53042 do {
53043 if (arg.WasPassed()) {
53044
53045 uint32_t length = arg.Value().Length();
53046 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53047 if (!returnArray) {
53048 aRv.Throw(NS_ERROR_UNEXPECTED);
53049 return;
53050 }
53051 // Scope for 'tmp'
53052 {
53053 JS::Rooted<JS::Value> tmp(cx);
53054 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53055 // Control block to let us common up the JS_DefineElement calls when there
53056 // are different ways to succeed at wrapping the object.
53057 do {
53058 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
53059 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 53059); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 53059); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53060 aRv.Throw(NS_ERROR_UNEXPECTED);
53061 return;
53062 }
53063 break;
53064 } while (false);
53065 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53066 JSPROP_ENUMERATE)) {
53067 aRv.Throw(NS_ERROR_UNEXPECTED);
53068 return;
53069 }
53070 }
53071 }
53072 argv[0].setObject(*returnArray);
53073 break;
53074 } else if (argc == 1) {
53075 // This is our current trailing argument; reduce argc
53076 --argc;
53077 } else {
53078 argv[0].setUndefined();
53079 }
53080 } while (false);
53081
53082 JS::Rooted<JS::Value> callable(cx);
53083 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53084 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53085 !InitIds(cx, atomsCache)) ||
53086 !GetCallableProperty(cx, atomsCache->passOptionalObjectSequence_id, &callable)) {
53087 aRv.Throw(NS_ERROR_UNEXPECTED);
53088 return;
53089 }
53090 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53091 if (!JS::Call(cx, thisValue, callable,
53092 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53093 aRv.NoteJSContextException(cx);
53094 return;
53095 }
53096}
53097
53098void
53099TestJSImplInterfaceJSImpl::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53100{
53101 CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53102 if (aRv.Failed()) {
53103 return;
53104 }
53105 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53105); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53105); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53106 BindingCallContext& cx = s.GetCallContext();
53107
53108 JS::Rooted<JS::Value> rval(cx);
53109 JS::RootedVector<JS::Value> argv(cx);
53110 if (!argv.resize(1)) {
53111 // That threw an exception on the JSContext, and our CallSetup will do
53112 // the right thing with that.
53113 return;
53114 }
53115 unsigned argc = 1;
53116
53117 do {
53118
53119 uint32_t length = arg.Length();
53120 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53121 if (!returnArray) {
53122 aRv.Throw(NS_ERROR_UNEXPECTED);
53123 return;
53124 }
53125 // Scope for 'tmp'
53126 {
53127 JS::Rooted<JS::Value> tmp(cx);
53128 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53129 // Control block to let us common up the JS_DefineElement calls when there
53130 // are different ways to succeed at wrapping the object.
53131 do {
53132 if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) {
53133 aRv.Throw(NS_ERROR_UNEXPECTED);
53134 return;
53135 }
53136 break;
53137 } while (false);
53138 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53139 JSPROP_ENUMERATE)) {
53140 aRv.Throw(NS_ERROR_UNEXPECTED);
53141 return;
53142 }
53143 }
53144 }
53145 argv[0].setObject(*returnArray);
53146 break;
53147 } while (false);
53148
53149 JS::Rooted<JS::Value> callable(cx);
53150 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53151 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53152 !InitIds(cx, atomsCache)) ||
53153 !GetCallableProperty(cx, atomsCache->passExternalInterfaceSequence_id, &callable)) {
53154 aRv.Throw(NS_ERROR_UNEXPECTED);
53155 return;
53156 }
53157 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53158 if (!JS::Call(cx, thisValue, callable,
53159 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53160 aRv.NoteJSContextException(cx);
53161 return;
53162 }
53163}
53164
53165void
53166TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53167{
53168 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53169 if (aRv.Failed()) {
53170 return;
53171 }
53172 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53172); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53172); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53173 BindingCallContext& cx = s.GetCallContext();
53174
53175 JS::Rooted<JS::Value> rval(cx);
53176 JS::RootedVector<JS::Value> argv(cx);
53177 if (!argv.resize(1)) {
53178 // That threw an exception on the JSContext, and our CallSetup will do
53179 // the right thing with that.
53180 return;
53181 }
53182 unsigned argc = 1;
53183
53184 do {
53185
53186 uint32_t length = arg.Length();
53187 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53188 if (!returnArray) {
53189 aRv.Throw(NS_ERROR_UNEXPECTED);
53190 return;
53191 }
53192 // Scope for 'tmp'
53193 {
53194 JS::Rooted<JS::Value> tmp(cx);
53195 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53196 // Control block to let us common up the JS_DefineElement calls when there
53197 // are different ways to succeed at wrapping the object.
53198 do {
53199 if (!arg[sequenceIdx0]) {
53200 tmp.setNull();
53201 break;
53202 }
53203 if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) {
53204 aRv.Throw(NS_ERROR_UNEXPECTED);
53205 return;
53206 }
53207 break;
53208 } while (false);
53209 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53210 JSPROP_ENUMERATE)) {
53211 aRv.Throw(NS_ERROR_UNEXPECTED);
53212 return;
53213 }
53214 }
53215 }
53216 argv[0].setObject(*returnArray);
53217 break;
53218 } while (false);
53219
53220 JS::Rooted<JS::Value> callable(cx);
53221 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53222 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53223 !InitIds(cx, atomsCache)) ||
53224 !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceSequence_id, &callable)) {
53225 aRv.Throw(NS_ERROR_UNEXPECTED);
53226 return;
53227 }
53228 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53229 if (!JS::Call(cx, thisValue, callable,
53230 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53231 aRv.NoteJSContextException(cx);
53232 return;
53233 }
53234}
53235
53236void
53237TestJSImplInterfaceJSImpl::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53238{
53239 CallSetup s(this, aRv, "TestJSImplInterface.receiveStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53240 if (aRv.Failed()) {
53241 return;
53242 }
53243 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53243); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53244 BindingCallContext& cx = s.GetCallContext();
53245
53246 JS::Rooted<JS::Value> rval(cx);
53247
53248 JS::Rooted<JS::Value> callable(cx);
53249 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53250 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53251 !InitIds(cx, atomsCache)) ||
53252 !GetCallableProperty(cx, atomsCache->receiveStringSequence_id, &callable)) {
53253 aRv.Throw(NS_ERROR_UNEXPECTED);
53254 return;
53255 }
53256 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53257 if (!JS::Call(cx, thisValue, callable,
53258 JS::HandleValueArray::empty(), &rval)) {
53259 aRv.NoteJSContextException(cx);
53260 return;
53261 }
53262 Sequence<nsString> rvalDecl;
53263 if (rval.isObject()) {
53264 JS::ForOfIterator iter(cx);
53265 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53266 aRv.Throw(NS_ERROR_UNEXPECTED);
53267 return;
53268 }
53269 if (!iter.valueIsIterable()) {
53270 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence");
53271 aRv.Throw(NS_ERROR_UNEXPECTED);
53272 return;
53273 }
53274 Sequence<nsString> &arr = rvalDecl;
53275 JS::Rooted<JS::Value> temp(cx);
53276 while (true) {
53277 bool done;
53278 if (!iter.next(&temp, &done)) {
53279 aRv.Throw(NS_ERROR_UNEXPECTED);
53280 return;
53281 }
53282 if (done) {
53283 break;
53284 }
53285 nsString* slotPtr = arr.AppendElement(mozilla::fallible);
53286 if (!slotPtr) {
53287 JS_ReportOutOfMemory(cx);
53288 aRv.Throw(NS_ERROR_UNEXPECTED);
53289 return;
53290 }
53291 nsString& slot = *slotPtr;
53292 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
53293 aRv.Throw(NS_ERROR_UNEXPECTED);
53294 return;
53295 }
53296 }
53297 } else {
53298 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence");
53299 aRv.Throw(NS_ERROR_UNEXPECTED);
53300 return;
53301 }
53302 aRetVal = std::move(rvalDecl);
53303}
53304
53305void
53306TestJSImplInterfaceJSImpl::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53307{
53308 CallSetup s(this, aRv, "TestJSImplInterface.receiveByteStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53309 if (aRv.Failed()) {
53310 return;
53311 }
53312 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53312); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53312); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53313 BindingCallContext& cx = s.GetCallContext();
53314
53315 JS::Rooted<JS::Value> rval(cx);
53316
53317 JS::Rooted<JS::Value> callable(cx);
53318 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53319 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53320 !InitIds(cx, atomsCache)) ||
53321 !GetCallableProperty(cx, atomsCache->receiveByteStringSequence_id, &callable)) {
53322 aRv.Throw(NS_ERROR_UNEXPECTED);
53323 return;
53324 }
53325 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53326 if (!JS::Call(cx, thisValue, callable,
53327 JS::HandleValueArray::empty(), &rval)) {
53328 aRv.NoteJSContextException(cx);
53329 return;
53330 }
53331 Sequence<nsCString> rvalDecl;
53332 if (rval.isObject()) {
53333 JS::ForOfIterator iter(cx);
53334 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53335 aRv.Throw(NS_ERROR_UNEXPECTED);
53336 return;
53337 }
53338 if (!iter.valueIsIterable()) {
53339 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence");
53340 aRv.Throw(NS_ERROR_UNEXPECTED);
53341 return;
53342 }
53343 Sequence<nsCString> &arr = rvalDecl;
53344 JS::Rooted<JS::Value> temp(cx);
53345 while (true) {
53346 bool done;
53347 if (!iter.next(&temp, &done)) {
53348 aRv.Throw(NS_ERROR_UNEXPECTED);
53349 return;
53350 }
53351 if (done) {
53352 break;
53353 }
53354 nsCString* slotPtr = arr.AppendElement(mozilla::fallible);
53355 if (!slotPtr) {
53356 JS_ReportOutOfMemory(cx);
53357 aRv.Throw(NS_ERROR_UNEXPECTED);
53358 return;
53359 }
53360 nsCString& slot = *slotPtr;
53361 if (!ConvertJSValueToByteString(cx, temp, false, "element of return value of TestJSImplInterface.receiveByteStringSequence", slot)) {
53362 aRv.Throw(NS_ERROR_UNEXPECTED);
53363 return;
53364 }
53365 }
53366 } else {
53367 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence");
53368 aRv.Throw(NS_ERROR_UNEXPECTED);
53369 return;
53370 }
53371 aRetVal = std::move(rvalDecl);
53372}
53373
53374void
53375TestJSImplInterfaceJSImpl::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53376{
53377 CallSetup s(this, aRv, "TestJSImplInterface.receiveUTF8StringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53378 if (aRv.Failed()) {
53379 return;
53380 }
53381 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53381); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53381); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53382 BindingCallContext& cx = s.GetCallContext();
53383
53384 JS::Rooted<JS::Value> rval(cx);
53385
53386 JS::Rooted<JS::Value> callable(cx);
53387 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53388 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53389 !InitIds(cx, atomsCache)) ||
53390 !GetCallableProperty(cx, atomsCache->receiveUTF8StringSequence_id, &callable)) {
53391 aRv.Throw(NS_ERROR_UNEXPECTED);
53392 return;
53393 }
53394 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53395 if (!JS::Call(cx, thisValue, callable,
53396 JS::HandleValueArray::empty(), &rval)) {
53397 aRv.NoteJSContextException(cx);
53398 return;
53399 }
53400 Sequence<nsCString> rvalDecl;
53401 if (rval.isObject()) {
53402 JS::ForOfIterator iter(cx);
53403 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53404 aRv.Throw(NS_ERROR_UNEXPECTED);
53405 return;
53406 }
53407 if (!iter.valueIsIterable()) {
53408 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence");
53409 aRv.Throw(NS_ERROR_UNEXPECTED);
53410 return;
53411 }
53412 Sequence<nsCString> &arr = rvalDecl;
53413 JS::Rooted<JS::Value> temp(cx);
53414 while (true) {
53415 bool done;
53416 if (!iter.next(&temp, &done)) {
53417 aRv.Throw(NS_ERROR_UNEXPECTED);
53418 return;
53419 }
53420 if (done) {
53421 break;
53422 }
53423 nsCString* slotPtr = arr.AppendElement(mozilla::fallible);
53424 if (!slotPtr) {
53425 JS_ReportOutOfMemory(cx);
53426 aRv.Throw(NS_ERROR_UNEXPECTED);
53427 return;
53428 }
53429 nsCString& slot = *slotPtr;
53430 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
53431 aRv.Throw(NS_ERROR_UNEXPECTED);
53432 return;
53433 }
53434 }
53435 } else {
53436 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence");
53437 aRv.Throw(NS_ERROR_UNEXPECTED);
53438 return;
53439 }
53440 aRetVal = std::move(rvalDecl);
53441}
53442
53443void
53444TestJSImplInterfaceJSImpl::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53445{
53446 CallSetup s(this, aRv, "TestJSImplInterface.receiveAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53447 if (aRv.Failed()) {
53448 return;
53449 }
53450 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53450); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53451 BindingCallContext& cx = s.GetCallContext();
53452
53453 JS::Rooted<JS::Value> rval(cx);
53454
53455 JS::Rooted<JS::Value> callable(cx);
53456 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53457 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53458 !InitIds(cx, atomsCache)) ||
53459 !GetCallableProperty(cx, atomsCache->receiveAnySequence_id, &callable)) {
53460 aRv.Throw(NS_ERROR_UNEXPECTED);
53461 return;
53462 }
53463 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53464 if (!JS::Call(cx, thisValue, callable,
53465 JS::HandleValueArray::empty(), &rval)) {
53466 aRv.NoteJSContextException(cx);
53467 return;
53468 }
53469 Sequence<JS::Value> rvalDecl;
53470 SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl);
53471 if (rval.isObject()) {
53472 JS::ForOfIterator iter(cx);
53473 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53474 aRv.Throw(NS_ERROR_UNEXPECTED);
53475 return;
53476 }
53477 if (!iter.valueIsIterable()) {
53478 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence");
53479 aRv.Throw(NS_ERROR_UNEXPECTED);
53480 return;
53481 }
53482 Sequence<JS::Value> &arr = rvalDecl;
53483 JS::Rooted<JS::Value> temp(cx);
53484 while (true) {
53485 bool done;
53486 if (!iter.next(&temp, &done)) {
53487 aRv.Throw(NS_ERROR_UNEXPECTED);
53488 return;
53489 }
53490 if (done) {
53491 break;
53492 }
53493 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
53494 if (!slotPtr) {
53495 JS_ReportOutOfMemory(cx);
53496 aRv.Throw(NS_ERROR_UNEXPECTED);
53497 return;
53498 }
53499 JS::Value& slot = *slotPtr;
53500#ifdef __clang__1
53501#pragma clang diagnostic push
53502#pragma clang diagnostic ignored "-Wunreachable-code"
53503#pragma clang diagnostic ignored "-Wunreachable-code-return"
53504#endif // __clang__
53505 if ((false) && !CallerSubsumes(temp)) {
53506 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveAnySequence");
53507 aRv.Throw(NS_ERROR_UNEXPECTED);
53508 return;
53509 }
53510#ifdef __clang__1
53511#pragma clang diagnostic pop
53512#endif // __clang__
53513 slot = temp;
53514 }
53515 } else {
53516 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence");
53517 aRv.Throw(NS_ERROR_UNEXPECTED);
53518 return;
53519 }
53520 aRetVal = std::move(rvalDecl);
53521}
53522
53523void
53524TestJSImplInterfaceJSImpl::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53525{
53526 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53527 if (aRv.Failed()) {
53528 return;
53529 }
53530 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53530); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53530); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53531 BindingCallContext& cx = s.GetCallContext();
53532
53533 JS::Rooted<JS::Value> rval(cx);
53534
53535 JS::Rooted<JS::Value> callable(cx);
53536 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53537 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53538 !InitIds(cx, atomsCache)) ||
53539 !GetCallableProperty(cx, atomsCache->receiveNullableAnySequence_id, &callable)) {
53540 aRv.Throw(NS_ERROR_UNEXPECTED);
53541 return;
53542 }
53543 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53544 if (!JS::Call(cx, thisValue, callable,
53545 JS::HandleValueArray::empty(), &rval)) {
53546 aRv.NoteJSContextException(cx);
53547 return;
53548 }
53549 Nullable<Sequence<JS::Value>> rvalDecl;
53550 SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl.SetValue());
53551 if (rval.isObject()) {
53552 JS::ForOfIterator iter(cx);
53553 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53554 aRv.Throw(NS_ERROR_UNEXPECTED);
53555 return;
53556 }
53557 if (!iter.valueIsIterable()) {
53558 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence");
53559 aRv.Throw(NS_ERROR_UNEXPECTED);
53560 return;
53561 }
53562 Sequence<JS::Value> &arr = rvalDecl.SetValue();
53563 JS::Rooted<JS::Value> temp(cx);
53564 while (true) {
53565 bool done;
53566 if (!iter.next(&temp, &done)) {
53567 aRv.Throw(NS_ERROR_UNEXPECTED);
53568 return;
53569 }
53570 if (done) {
53571 break;
53572 }
53573 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
53574 if (!slotPtr) {
53575 JS_ReportOutOfMemory(cx);
53576 aRv.Throw(NS_ERROR_UNEXPECTED);
53577 return;
53578 }
53579 JS::Value& slot = *slotPtr;
53580#ifdef __clang__1
53581#pragma clang diagnostic push
53582#pragma clang diagnostic ignored "-Wunreachable-code"
53583#pragma clang diagnostic ignored "-Wunreachable-code-return"
53584#endif // __clang__
53585 if ((false) && !CallerSubsumes(temp)) {
53586 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableAnySequence");
53587 aRv.Throw(NS_ERROR_UNEXPECTED);
53588 return;
53589 }
53590#ifdef __clang__1
53591#pragma clang diagnostic pop
53592#endif // __clang__
53593 slot = temp;
53594 }
53595 } else if (rval.isNullOrUndefined()) {
53596 rvalDecl.SetNull();
53597 } else {
53598 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence");
53599 aRv.Throw(NS_ERROR_UNEXPECTED);
53600 return;
53601 }
53602 if (rvalDecl.IsNull()) {
53603 aRetVal.SetNull();
53604 } else {
53605 aRetVal.SetValue() = std::move(rvalDecl.Value());
53606 }
53607}
53608
53609void
53610TestJSImplInterfaceJSImpl::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53611{
53612 CallSetup s(this, aRv, "TestJSImplInterface.receiveObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53613 if (aRv.Failed()) {
53614 return;
53615 }
53616 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53616); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53617 BindingCallContext& cx = s.GetCallContext();
53618
53619 JS::Rooted<JS::Value> rval(cx);
53620
53621 JS::Rooted<JS::Value> callable(cx);
53622 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53623 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53624 !InitIds(cx, atomsCache)) ||
53625 !GetCallableProperty(cx, atomsCache->receiveObjectSequence_id, &callable)) {
53626 aRv.Throw(NS_ERROR_UNEXPECTED);
53627 return;
53628 }
53629 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53630 if (!JS::Call(cx, thisValue, callable,
53631 JS::HandleValueArray::empty(), &rval)) {
53632 aRv.NoteJSContextException(cx);
53633 return;
53634 }
53635 Sequence<JSObject*> rvalDecl;
53636 SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl);
53637 if (rval.isObject()) {
53638 JS::ForOfIterator iter(cx);
53639 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53640 aRv.Throw(NS_ERROR_UNEXPECTED);
53641 return;
53642 }
53643 if (!iter.valueIsIterable()) {
53644 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence");
53645 aRv.Throw(NS_ERROR_UNEXPECTED);
53646 return;
53647 }
53648 Sequence<JSObject*> &arr = rvalDecl;
53649 JS::Rooted<JS::Value> temp(cx);
53650 while (true) {
53651 bool done;
53652 if (!iter.next(&temp, &done)) {
53653 aRv.Throw(NS_ERROR_UNEXPECTED);
53654 return;
53655 }
53656 if (done) {
53657 break;
53658 }
53659 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
53660 if (!slotPtr) {
53661 JS_ReportOutOfMemory(cx);
53662 aRv.Throw(NS_ERROR_UNEXPECTED);
53663 return;
53664 }
53665 JSObject*& slot = *slotPtr;
53666 if (temp.isObject()) {
53667#ifdef __clang__1
53668#pragma clang diagnostic push
53669#pragma clang diagnostic ignored "-Wunreachable-code"
53670#pragma clang diagnostic ignored "-Wunreachable-code-return"
53671#endif // __clang__
53672 if ((false) && !CallerSubsumes(temp)) {
53673 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveObjectSequence");
53674 aRv.Throw(NS_ERROR_UNEXPECTED);
53675 return;
53676 }
53677#ifdef __clang__1
53678#pragma clang diagnostic pop
53679#endif // __clang__
53680 slot = &temp.toObject();
53681 } else {
53682 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveObjectSequence");
53683 aRv.Throw(NS_ERROR_UNEXPECTED);
53684 return;
53685 }
53686 }
53687 } else {
53688 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence");
53689 aRv.Throw(NS_ERROR_UNEXPECTED);
53690 return;
53691 }
53692 aRetVal = std::move(rvalDecl);
53693}
53694
53695void
53696TestJSImplInterfaceJSImpl::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53697{
53698 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53699 if (aRv.Failed()) {
53700 return;
53701 }
53702 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53702); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53702); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53703 BindingCallContext& cx = s.GetCallContext();
53704
53705 JS::Rooted<JS::Value> rval(cx);
53706
53707 JS::Rooted<JS::Value> callable(cx);
53708 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53709 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53710 !InitIds(cx, atomsCache)) ||
53711 !GetCallableProperty(cx, atomsCache->receiveNullableObjectSequence_id, &callable)) {
53712 aRv.Throw(NS_ERROR_UNEXPECTED);
53713 return;
53714 }
53715 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53716 if (!JS::Call(cx, thisValue, callable,
53717 JS::HandleValueArray::empty(), &rval)) {
53718 aRv.NoteJSContextException(cx);
53719 return;
53720 }
53721 Sequence<JSObject*> rvalDecl;
53722 SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl);
53723 if (rval.isObject()) {
53724 JS::ForOfIterator iter(cx);
53725 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53726 aRv.Throw(NS_ERROR_UNEXPECTED);
53727 return;
53728 }
53729 if (!iter.valueIsIterable()) {
53730 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence");
53731 aRv.Throw(NS_ERROR_UNEXPECTED);
53732 return;
53733 }
53734 Sequence<JSObject*> &arr = rvalDecl;
53735 JS::Rooted<JS::Value> temp(cx);
53736 while (true) {
53737 bool done;
53738 if (!iter.next(&temp, &done)) {
53739 aRv.Throw(NS_ERROR_UNEXPECTED);
53740 return;
53741 }
53742 if (done) {
53743 break;
53744 }
53745 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
53746 if (!slotPtr) {
53747 JS_ReportOutOfMemory(cx);
53748 aRv.Throw(NS_ERROR_UNEXPECTED);
53749 return;
53750 }
53751 JSObject*& slot = *slotPtr;
53752 if (temp.isObject()) {
53753#ifdef __clang__1
53754#pragma clang diagnostic push
53755#pragma clang diagnostic ignored "-Wunreachable-code"
53756#pragma clang diagnostic ignored "-Wunreachable-code-return"
53757#endif // __clang__
53758 if ((false) && !CallerSubsumes(temp)) {
53759 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableObjectSequence");
53760 aRv.Throw(NS_ERROR_UNEXPECTED);
53761 return;
53762 }
53763#ifdef __clang__1
53764#pragma clang diagnostic pop
53765#endif // __clang__
53766 slot = &temp.toObject();
53767 } else if (temp.isNullOrUndefined()) {
53768 slot = nullptr;
53769 } else {
53770 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableObjectSequence");
53771 aRv.Throw(NS_ERROR_UNEXPECTED);
53772 return;
53773 }
53774 }
53775 } else {
53776 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence");
53777 aRv.Throw(NS_ERROR_UNEXPECTED);
53778 return;
53779 }
53780 aRetVal = std::move(rvalDecl);
53781}
53782
53783void
53784TestJSImplInterfaceJSImpl::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53785{
53786 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53787 if (aRv.Failed()) {
53788 return;
53789 }
53790 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53790); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53790); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53791 BindingCallContext& cx = s.GetCallContext();
53792
53793 JS::Rooted<JS::Value> rval(cx);
53794 JS::RootedVector<JS::Value> argv(cx);
53795 if (!argv.resize(1)) {
53796 // That threw an exception on the JSContext, and our CallSetup will do
53797 // the right thing with that.
53798 return;
53799 }
53800 unsigned argc = 1;
53801
53802 do {
53803
53804 uint32_t length = arg.Length();
53805 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53806 if (!returnArray) {
53807 aRv.Throw(NS_ERROR_UNEXPECTED);
53808 return;
53809 }
53810 // Scope for 'tmp'
53811 {
53812 JS::Rooted<JS::Value> tmp(cx);
53813 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53814 // Control block to let us common up the JS_DefineElement calls when there
53815 // are different ways to succeed at wrapping the object.
53816 do {
53817
53818 uint32_t length = arg[sequenceIdx0].Length();
53819 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53820 if (!returnArray) {
53821 aRv.Throw(NS_ERROR_UNEXPECTED);
53822 return;
53823 }
53824 // Scope for 'tmp'
53825 {
53826 JS::Rooted<JS::Value> tmp(cx);
53827 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
53828 // Control block to let us common up the JS_DefineElement calls when there
53829 // are different ways to succeed at wrapping the object.
53830 do {
53831 tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1]));
53832 break;
53833 } while (false);
53834 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
53835 JSPROP_ENUMERATE)) {
53836 aRv.Throw(NS_ERROR_UNEXPECTED);
53837 return;
53838 }
53839 }
53840 }
53841 tmp.setObject(*returnArray);
53842 break;
53843 } while (false);
53844 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53845 JSPROP_ENUMERATE)) {
53846 aRv.Throw(NS_ERROR_UNEXPECTED);
53847 return;
53848 }
53849 }
53850 }
53851 argv[0].setObject(*returnArray);
53852 break;
53853 } while (false);
53854
53855 JS::Rooted<JS::Value> callable(cx);
53856 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53857 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53858 !InitIds(cx, atomsCache)) ||
53859 !GetCallableProperty(cx, atomsCache->passSequenceOfSequences_id, &callable)) {
53860 aRv.Throw(NS_ERROR_UNEXPECTED);
53861 return;
53862 }
53863 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53864 if (!JS::Call(cx, thisValue, callable,
53865 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53866 aRv.NoteJSContextException(cx);
53867 return;
53868 }
53869}
53870
53871void
53872TestJSImplInterfaceJSImpl::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53873{
53874 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequencesOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53875 if (aRv.Failed()) {
53876 return;
53877 }
53878 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53878); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53879 BindingCallContext& cx = s.GetCallContext();
53880
53881 JS::Rooted<JS::Value> rval(cx);
53882 JS::RootedVector<JS::Value> argv(cx);
53883 if (!argv.resize(1)) {
53884 // That threw an exception on the JSContext, and our CallSetup will do
53885 // the right thing with that.
53886 return;
53887 }
53888 unsigned argc = 1;
53889
53890 do {
53891
53892 uint32_t length = arg.Length();
53893 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53894 if (!returnArray) {
53895 aRv.Throw(NS_ERROR_UNEXPECTED);
53896 return;
53897 }
53898 // Scope for 'tmp'
53899 {
53900 JS::Rooted<JS::Value> tmp(cx);
53901 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53902 // Control block to let us common up the JS_DefineElement calls when there
53903 // are different ways to succeed at wrapping the object.
53904 do {
53905
53906 uint32_t length = arg[sequenceIdx0].Length();
53907 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53908 if (!returnArray) {
53909 aRv.Throw(NS_ERROR_UNEXPECTED);
53910 return;
53911 }
53912 // Scope for 'tmp'
53913 {
53914 JS::Rooted<JS::Value> tmp(cx);
53915 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
53916 // Control block to let us common up the JS_DefineElement calls when there
53917 // are different ways to succeed at wrapping the object.
53918 do {
53919
53920 uint32_t length = arg[sequenceIdx0][sequenceIdx1].Length();
53921 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53922 if (!returnArray) {
53923 aRv.Throw(NS_ERROR_UNEXPECTED);
53924 return;
53925 }
53926 // Scope for 'tmp'
53927 {
53928 JS::Rooted<JS::Value> tmp(cx);
53929 for (uint32_t sequenceIdx2 = 0; sequenceIdx2 < length; ++sequenceIdx2) {
53930 // Control block to let us common up the JS_DefineElement calls when there
53931 // are different ways to succeed at wrapping the object.
53932 do {
53933 tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1][sequenceIdx2]));
53934 break;
53935 } while (false);
53936 if (!JS_DefineElement(cx, returnArray, sequenceIdx2, tmp,
53937 JSPROP_ENUMERATE)) {
53938 aRv.Throw(NS_ERROR_UNEXPECTED);
53939 return;
53940 }
53941 }
53942 }
53943 tmp.setObject(*returnArray);
53944 break;
53945 } while (false);
53946 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
53947 JSPROP_ENUMERATE)) {
53948 aRv.Throw(NS_ERROR_UNEXPECTED);
53949 return;
53950 }
53951 }
53952 }
53953 tmp.setObject(*returnArray);
53954 break;
53955 } while (false);
53956 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53957 JSPROP_ENUMERATE)) {
53958 aRv.Throw(NS_ERROR_UNEXPECTED);
53959 return;
53960 }
53961 }
53962 }
53963 argv[0].setObject(*returnArray);
53964 break;
53965 } while (false);
53966
53967 JS::Rooted<JS::Value> callable(cx);
53968 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53969 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53970 !InitIds(cx, atomsCache)) ||
53971 !GetCallableProperty(cx, atomsCache->passSequenceOfSequencesOfSequences_id, &callable)) {
53972 aRv.Throw(NS_ERROR_UNEXPECTED);
53973 return;
53974 }
53975 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53976 if (!JS::Call(cx, thisValue, callable,
53977 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53978 aRv.NoteJSContextException(cx);
53979 return;
53980 }
53981}
53982
53983void
53984TestJSImplInterfaceJSImpl::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53985{
53986 CallSetup s(this, aRv, "TestJSImplInterface.passRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53987 if (aRv.Failed()) {
53988 return;
53989 }
53990 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53990); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 53990); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
53991 BindingCallContext& cx = s.GetCallContext();
53992
53993 JS::Rooted<JS::Value> rval(cx);
53994 JS::RootedVector<JS::Value> argv(cx);
53995 if (!argv.resize(1)) {
53996 // That threw an exception on the JSContext, and our CallSetup will do
53997 // the right thing with that.
53998 return;
53999 }
54000 unsigned argc = 1;
54001
54002 do {
54003
54004 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54005 if (!returnObj) {
54006 aRv.Throw(NS_ERROR_UNEXPECTED);
54007 return;
54008 }
54009 // Scope for 'tmp'
54010 {
54011 JS::Rooted<JS::Value> tmp(cx);
54012 for (auto& entry : arg.Entries()) {
54013 auto& recordValue0 = entry.mValue;
54014 // Control block to let us common up the JS_DefineUCProperty calls when there
54015 // are different ways to succeed at wrapping the value.
54016 do {
54017 tmp.setInt32(int32_t(recordValue0));
54018 break;
54019 } while (false);
54020 if (!JS_DefineUCProperty(cx, returnObj,
54021 entry.mKey.BeginReading(),
54022 entry.mKey.Length(), tmp,
54023 JSPROP_ENUMERATE)) {
54024 aRv.Throw(NS_ERROR_UNEXPECTED);
54025 return;
54026 }
54027 }
54028 }
54029 argv[0].setObject(*returnObj);
54030 break;
54031 } while (false);
54032
54033 JS::Rooted<JS::Value> callable(cx);
54034 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54035 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54036 !InitIds(cx, atomsCache)) ||
54037 !GetCallableProperty(cx, atomsCache->passRecord_id, &callable)) {
54038 aRv.Throw(NS_ERROR_UNEXPECTED);
54039 return;
54040 }
54041 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54042 if (!JS::Call(cx, thisValue, callable,
54043 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54044 aRv.NoteJSContextException(cx);
54045 return;
54046 }
54047}
54048
54049void
54050TestJSImplInterfaceJSImpl::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54051{
54052 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54053 if (aRv.Failed()) {
54054 return;
54055 }
54056 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54056); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54056); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54057 BindingCallContext& cx = s.GetCallContext();
54058
54059 JS::Rooted<JS::Value> rval(cx);
54060 JS::RootedVector<JS::Value> argv(cx);
54061 if (!argv.resize(1)) {
54062 // That threw an exception on the JSContext, and our CallSetup will do
54063 // the right thing with that.
54064 return;
54065 }
54066 unsigned argc = 1;
54067
54068 do {
54069
54070 if (arg.IsNull()) {
54071 argv[0].setNull();
54072 break;
54073 }
54074
54075 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54076 if (!returnObj) {
54077 aRv.Throw(NS_ERROR_UNEXPECTED);
54078 return;
54079 }
54080 // Scope for 'tmp'
54081 {
54082 JS::Rooted<JS::Value> tmp(cx);
54083 for (auto& entry : arg.Value().Entries()) {
54084 auto& recordValue0 = entry.mValue;
54085 // Control block to let us common up the JS_DefineUCProperty calls when there
54086 // are different ways to succeed at wrapping the value.
54087 do {
54088 tmp.setInt32(int32_t(recordValue0));
54089 break;
54090 } while (false);
54091 if (!JS_DefineUCProperty(cx, returnObj,
54092 entry.mKey.BeginReading(),
54093 entry.mKey.Length(), tmp,
54094 JSPROP_ENUMERATE)) {
54095 aRv.Throw(NS_ERROR_UNEXPECTED);
54096 return;
54097 }
54098 }
54099 }
54100 argv[0].setObject(*returnObj);
54101 break;
54102 } while (false);
54103
54104 JS::Rooted<JS::Value> callable(cx);
54105 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54106 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54107 !InitIds(cx, atomsCache)) ||
54108 !GetCallableProperty(cx, atomsCache->passNullableRecord_id, &callable)) {
54109 aRv.Throw(NS_ERROR_UNEXPECTED);
54110 return;
54111 }
54112 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54113 if (!JS::Call(cx, thisValue, callable,
54114 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54115 aRv.NoteJSContextException(cx);
54116 return;
54117 }
54118}
54119
54120void
54121TestJSImplInterfaceJSImpl::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54122{
54123 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54124 if (aRv.Failed()) {
54125 return;
54126 }
54127 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54127); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54127); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54128 BindingCallContext& cx = s.GetCallContext();
54129
54130 JS::Rooted<JS::Value> rval(cx);
54131 JS::RootedVector<JS::Value> argv(cx);
54132 if (!argv.resize(1)) {
54133 // That threw an exception on the JSContext, and our CallSetup will do
54134 // the right thing with that.
54135 return;
54136 }
54137 unsigned argc = 1;
54138
54139 do {
54140
54141 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54142 if (!returnObj) {
54143 aRv.Throw(NS_ERROR_UNEXPECTED);
54144 return;
54145 }
54146 // Scope for 'tmp'
54147 {
54148 JS::Rooted<JS::Value> tmp(cx);
54149 for (auto& entry : arg.Entries()) {
54150 auto& recordValue0 = entry.mValue;
54151 // Control block to let us common up the JS_DefineUCProperty calls when there
54152 // are different ways to succeed at wrapping the value.
54153 do {
54154 if (recordValue0.IsNull()) {
54155 tmp.setNull();
54156 break;
54157 }
54158 tmp.setInt32(int32_t(recordValue0.Value()));
54159 break;
54160 } while (false);
54161 if (!JS_DefineUCProperty(cx, returnObj,
54162 entry.mKey.BeginReading(),
54163 entry.mKey.Length(), tmp,
54164 JSPROP_ENUMERATE)) {
54165 aRv.Throw(NS_ERROR_UNEXPECTED);
54166 return;
54167 }
54168 }
54169 }
54170 argv[0].setObject(*returnObj);
54171 break;
54172 } while (false);
54173
54174 JS::Rooted<JS::Value> callable(cx);
54175 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54176 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54177 !InitIds(cx, atomsCache)) ||
54178 !GetCallableProperty(cx, atomsCache->passRecordOfNullableInts_id, &callable)) {
54179 aRv.Throw(NS_ERROR_UNEXPECTED);
54180 return;
54181 }
54182 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54183 if (!JS::Call(cx, thisValue, callable,
54184 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54185 aRv.NoteJSContextException(cx);
54186 return;
54187 }
54188}
54189
54190void
54191TestJSImplInterfaceJSImpl::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54192{
54193 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54194 if (aRv.Failed()) {
54195 return;
54196 }
54197 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54197); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54197); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54198 BindingCallContext& cx = s.GetCallContext();
54199
54200 JS::Rooted<JS::Value> rval(cx);
54201 JS::RootedVector<JS::Value> argv(cx);
54202 if (!argv.resize(1)) {
54203 // That threw an exception on the JSContext, and our CallSetup will do
54204 // the right thing with that.
54205 return;
54206 }
54207 unsigned argc = 1;
54208
54209 do {
54210 if (arg.WasPassed()) {
54211
54212 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54213 if (!returnObj) {
54214 aRv.Throw(NS_ERROR_UNEXPECTED);
54215 return;
54216 }
54217 // Scope for 'tmp'
54218 {
54219 JS::Rooted<JS::Value> tmp(cx);
54220 for (auto& entry : arg.Value().Entries()) {
54221 auto& recordValue0 = entry.mValue;
54222 // Control block to let us common up the JS_DefineUCProperty calls when there
54223 // are different ways to succeed at wrapping the value.
54224 do {
54225 if (recordValue0.IsNull()) {
54226 tmp.setNull();
54227 break;
54228 }
54229 tmp.setInt32(int32_t(recordValue0.Value()));
54230 break;
54231 } while (false);
54232 if (!JS_DefineUCProperty(cx, returnObj,
54233 entry.mKey.BeginReading(),
54234 entry.mKey.Length(), tmp,
54235 JSPROP_ENUMERATE)) {
54236 aRv.Throw(NS_ERROR_UNEXPECTED);
54237 return;
54238 }
54239 }
54240 }
54241 argv[0].setObject(*returnObj);
54242 break;
54243 } else if (argc == 1) {
54244 // This is our current trailing argument; reduce argc
54245 --argc;
54246 } else {
54247 argv[0].setUndefined();
54248 }
54249 } while (false);
54250
54251 JS::Rooted<JS::Value> callable(cx);
54252 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54253 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54254 !InitIds(cx, atomsCache)) ||
54255 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfNullableInts_id, &callable)) {
54256 aRv.Throw(NS_ERROR_UNEXPECTED);
54257 return;
54258 }
54259 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54260 if (!JS::Call(cx, thisValue, callable,
54261 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54262 aRv.NoteJSContextException(cx);
54263 return;
54264 }
54265}
54266
54267void
54268TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54269{
54270 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54271 if (aRv.Failed()) {
54272 return;
54273 }
54274 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54274); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54274); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54275 BindingCallContext& cx = s.GetCallContext();
54276
54277 JS::Rooted<JS::Value> rval(cx);
54278 JS::RootedVector<JS::Value> argv(cx);
54279 if (!argv.resize(1)) {
54280 // That threw an exception on the JSContext, and our CallSetup will do
54281 // the right thing with that.
54282 return;
54283 }
54284 unsigned argc = 1;
54285
54286 do {
54287 if (arg.WasPassed()) {
54288
54289 if (arg.Value().IsNull()) {
54290 argv[0].setNull();
54291 break;
54292 }
54293
54294 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54295 if (!returnObj) {
54296 aRv.Throw(NS_ERROR_UNEXPECTED);
54297 return;
54298 }
54299 // Scope for 'tmp'
54300 {
54301 JS::Rooted<JS::Value> tmp(cx);
54302 for (auto& entry : arg.Value().Value().Entries()) {
54303 auto& recordValue0 = entry.mValue;
54304 // Control block to let us common up the JS_DefineUCProperty calls when there
54305 // are different ways to succeed at wrapping the value.
54306 do {
54307 if (recordValue0.IsNull()) {
54308 tmp.setNull();
54309 break;
54310 }
54311 tmp.setInt32(int32_t(recordValue0.Value()));
54312 break;
54313 } while (false);
54314 if (!JS_DefineUCProperty(cx, returnObj,
54315 entry.mKey.BeginReading(),
54316 entry.mKey.Length(), tmp,
54317 JSPROP_ENUMERATE)) {
54318 aRv.Throw(NS_ERROR_UNEXPECTED);
54319 return;
54320 }
54321 }
54322 }
54323 argv[0].setObject(*returnObj);
54324 break;
54325 } else if (argc == 1) {
54326 // This is our current trailing argument; reduce argc
54327 --argc;
54328 } else {
54329 argv[0].setUndefined();
54330 }
54331 } while (false);
54332
54333 JS::Rooted<JS::Value> callable(cx);
54334 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54335 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54336 !InitIds(cx, atomsCache)) ||
54337 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableInts_id, &callable)) {
54338 aRv.Throw(NS_ERROR_UNEXPECTED);
54339 return;
54340 }
54341 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54342 if (!JS::Call(cx, thisValue, callable,
54343 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54344 aRv.NoteJSContextException(cx);
54345 return;
54346 }
54347}
54348
54349void
54350TestJSImplInterfaceJSImpl::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54351{
54352 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54353 if (aRv.Failed()) {
54354 return;
54355 }
54356 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54356); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54356); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54357 BindingCallContext& cx = s.GetCallContext();
54358
54359 JS::Rooted<JS::Value> rval(cx);
54360 JS::RootedVector<JS::Value> argv(cx);
54361 if (!argv.resize(1)) {
54362 // That threw an exception on the JSContext, and our CallSetup will do
54363 // the right thing with that.
54364 return;
54365 }
54366 unsigned argc = 1;
54367
54368 do {
54369
54370 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54371 if (!returnObj) {
54372 aRv.Throw(NS_ERROR_UNEXPECTED);
54373 return;
54374 }
54375 // Scope for 'tmp'
54376 {
54377 JS::Rooted<JS::Value> tmp(cx);
54378 for (auto& entry : arg.Entries()) {
54379 auto& recordValue0 = entry.mValue;
54380 // Control block to let us common up the JS_DefineUCProperty calls when there
54381 // are different ways to succeed at wrapping the value.
54382 do {
54383 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54384 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54384); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 54384); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54385 aRv.Throw(NS_ERROR_UNEXPECTED);
54386 return;
54387 }
54388 break;
54389 } while (false);
54390 if (!JS_DefineUCProperty(cx, returnObj,
54391 entry.mKey.BeginReading(),
54392 entry.mKey.Length(), tmp,
54393 JSPROP_ENUMERATE)) {
54394 aRv.Throw(NS_ERROR_UNEXPECTED);
54395 return;
54396 }
54397 }
54398 }
54399 argv[0].setObject(*returnObj);
54400 break;
54401 } while (false);
54402
54403 JS::Rooted<JS::Value> callable(cx);
54404 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54405 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54406 !InitIds(cx, atomsCache)) ||
54407 !GetCallableProperty(cx, atomsCache->passCastableObjectRecord_id, &callable)) {
54408 aRv.Throw(NS_ERROR_UNEXPECTED);
54409 return;
54410 }
54411 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54412 if (!JS::Call(cx, thisValue, callable,
54413 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54414 aRv.NoteJSContextException(cx);
54415 return;
54416 }
54417}
54418
54419void
54420TestJSImplInterfaceJSImpl::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54421{
54422 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54423 if (aRv.Failed()) {
54424 return;
54425 }
54426 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54426); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54426); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54427 BindingCallContext& cx = s.GetCallContext();
54428
54429 JS::Rooted<JS::Value> rval(cx);
54430 JS::RootedVector<JS::Value> argv(cx);
54431 if (!argv.resize(1)) {
54432 // That threw an exception on the JSContext, and our CallSetup will do
54433 // the right thing with that.
54434 return;
54435 }
54436 unsigned argc = 1;
54437
54438 do {
54439
54440 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54441 if (!returnObj) {
54442 aRv.Throw(NS_ERROR_UNEXPECTED);
54443 return;
54444 }
54445 // Scope for 'tmp'
54446 {
54447 JS::Rooted<JS::Value> tmp(cx);
54448 for (auto& entry : arg.Entries()) {
54449 auto& recordValue0 = entry.mValue;
54450 // Control block to let us common up the JS_DefineUCProperty calls when there
54451 // are different ways to succeed at wrapping the value.
54452 do {
54453 if (!recordValue0) {
54454 tmp.setNull();
54455 break;
54456 }
54457 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54458 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54458); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 54458); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54459 aRv.Throw(NS_ERROR_UNEXPECTED);
54460 return;
54461 }
54462 break;
54463 } while (false);
54464 if (!JS_DefineUCProperty(cx, returnObj,
54465 entry.mKey.BeginReading(),
54466 entry.mKey.Length(), tmp,
54467 JSPROP_ENUMERATE)) {
54468 aRv.Throw(NS_ERROR_UNEXPECTED);
54469 return;
54470 }
54471 }
54472 }
54473 argv[0].setObject(*returnObj);
54474 break;
54475 } while (false);
54476
54477 JS::Rooted<JS::Value> callable(cx);
54478 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54479 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54480 !InitIds(cx, atomsCache)) ||
54481 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectRecord_id, &callable)) {
54482 aRv.Throw(NS_ERROR_UNEXPECTED);
54483 return;
54484 }
54485 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54486 if (!JS::Call(cx, thisValue, callable,
54487 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54488 aRv.NoteJSContextException(cx);
54489 return;
54490 }
54491}
54492
54493void
54494TestJSImplInterfaceJSImpl::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54495{
54496 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54497 if (aRv.Failed()) {
54498 return;
54499 }
54500 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54500); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54501 BindingCallContext& cx = s.GetCallContext();
54502
54503 JS::Rooted<JS::Value> rval(cx);
54504 JS::RootedVector<JS::Value> argv(cx);
54505 if (!argv.resize(1)) {
54506 // That threw an exception on the JSContext, and our CallSetup will do
54507 // the right thing with that.
54508 return;
54509 }
54510 unsigned argc = 1;
54511
54512 do {
54513
54514 if (arg.IsNull()) {
54515 argv[0].setNull();
54516 break;
54517 }
54518
54519 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54520 if (!returnObj) {
54521 aRv.Throw(NS_ERROR_UNEXPECTED);
54522 return;
54523 }
54524 // Scope for 'tmp'
54525 {
54526 JS::Rooted<JS::Value> tmp(cx);
54527 for (auto& entry : arg.Value().Entries()) {
54528 auto& recordValue0 = entry.mValue;
54529 // Control block to let us common up the JS_DefineUCProperty calls when there
54530 // are different ways to succeed at wrapping the value.
54531 do {
54532 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54533 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54533); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 54533); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54534 aRv.Throw(NS_ERROR_UNEXPECTED);
54535 return;
54536 }
54537 break;
54538 } while (false);
54539 if (!JS_DefineUCProperty(cx, returnObj,
54540 entry.mKey.BeginReading(),
54541 entry.mKey.Length(), tmp,
54542 JSPROP_ENUMERATE)) {
54543 aRv.Throw(NS_ERROR_UNEXPECTED);
54544 return;
54545 }
54546 }
54547 }
54548 argv[0].setObject(*returnObj);
54549 break;
54550 } while (false);
54551
54552 JS::Rooted<JS::Value> callable(cx);
54553 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54554 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54555 !InitIds(cx, atomsCache)) ||
54556 !GetCallableProperty(cx, atomsCache->passCastableObjectNullableRecord_id, &callable)) {
54557 aRv.Throw(NS_ERROR_UNEXPECTED);
54558 return;
54559 }
54560 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54561 if (!JS::Call(cx, thisValue, callable,
54562 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54563 aRv.NoteJSContextException(cx);
54564 return;
54565 }
54566}
54567
54568void
54569TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54570{
54571 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54572 if (aRv.Failed()) {
54573 return;
54574 }
54575 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54575); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54576 BindingCallContext& cx = s.GetCallContext();
54577
54578 JS::Rooted<JS::Value> rval(cx);
54579 JS::RootedVector<JS::Value> argv(cx);
54580 if (!argv.resize(1)) {
54581 // That threw an exception on the JSContext, and our CallSetup will do
54582 // the right thing with that.
54583 return;
54584 }
54585 unsigned argc = 1;
54586
54587 do {
54588
54589 if (arg.IsNull()) {
54590 argv[0].setNull();
54591 break;
54592 }
54593
54594 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54595 if (!returnObj) {
54596 aRv.Throw(NS_ERROR_UNEXPECTED);
54597 return;
54598 }
54599 // Scope for 'tmp'
54600 {
54601 JS::Rooted<JS::Value> tmp(cx);
54602 for (auto& entry : arg.Value().Entries()) {
54603 auto& recordValue0 = entry.mValue;
54604 // Control block to let us common up the JS_DefineUCProperty calls when there
54605 // are different ways to succeed at wrapping the value.
54606 do {
54607 if (!recordValue0) {
54608 tmp.setNull();
54609 break;
54610 }
54611 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54612 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54612); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 54612); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54613 aRv.Throw(NS_ERROR_UNEXPECTED);
54614 return;
54615 }
54616 break;
54617 } while (false);
54618 if (!JS_DefineUCProperty(cx, returnObj,
54619 entry.mKey.BeginReading(),
54620 entry.mKey.Length(), tmp,
54621 JSPROP_ENUMERATE)) {
54622 aRv.Throw(NS_ERROR_UNEXPECTED);
54623 return;
54624 }
54625 }
54626 }
54627 argv[0].setObject(*returnObj);
54628 break;
54629 } while (false);
54630
54631 JS::Rooted<JS::Value> callable(cx);
54632 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54633 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54634 !InitIds(cx, atomsCache)) ||
54635 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableRecord_id, &callable)) {
54636 aRv.Throw(NS_ERROR_UNEXPECTED);
54637 return;
54638 }
54639 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54640 if (!JS::Call(cx, thisValue, callable,
54641 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54642 aRv.NoteJSContextException(cx);
54643 return;
54644 }
54645}
54646
54647void
54648TestJSImplInterfaceJSImpl::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54649{
54650 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54651 if (aRv.Failed()) {
54652 return;
54653 }
54654 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54654); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54654); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54655 BindingCallContext& cx = s.GetCallContext();
54656
54657 JS::Rooted<JS::Value> rval(cx);
54658 JS::RootedVector<JS::Value> argv(cx);
54659 if (!argv.resize(1)) {
54660 // That threw an exception on the JSContext, and our CallSetup will do
54661 // the right thing with that.
54662 return;
54663 }
54664 unsigned argc = 1;
54665
54666 do {
54667 if (arg.WasPassed()) {
54668
54669 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54670 if (!returnObj) {
54671 aRv.Throw(NS_ERROR_UNEXPECTED);
54672 return;
54673 }
54674 // Scope for 'tmp'
54675 {
54676 JS::Rooted<JS::Value> tmp(cx);
54677 for (auto& entry : arg.Value().Entries()) {
54678 auto& recordValue0 = entry.mValue;
54679 // Control block to let us common up the JS_DefineUCProperty calls when there
54680 // are different ways to succeed at wrapping the value.
54681 do {
54682 tmp.setInt32(int32_t(recordValue0));
54683 break;
54684 } while (false);
54685 if (!JS_DefineUCProperty(cx, returnObj,
54686 entry.mKey.BeginReading(),
54687 entry.mKey.Length(), tmp,
54688 JSPROP_ENUMERATE)) {
54689 aRv.Throw(NS_ERROR_UNEXPECTED);
54690 return;
54691 }
54692 }
54693 }
54694 argv[0].setObject(*returnObj);
54695 break;
54696 } else if (argc == 1) {
54697 // This is our current trailing argument; reduce argc
54698 --argc;
54699 } else {
54700 argv[0].setUndefined();
54701 }
54702 } while (false);
54703
54704 JS::Rooted<JS::Value> callable(cx);
54705 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54706 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54707 !InitIds(cx, atomsCache)) ||
54708 !GetCallableProperty(cx, atomsCache->passOptionalRecord_id, &callable)) {
54709 aRv.Throw(NS_ERROR_UNEXPECTED);
54710 return;
54711 }
54712 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54713 if (!JS::Call(cx, thisValue, callable,
54714 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54715 aRv.NoteJSContextException(cx);
54716 return;
54717 }
54718}
54719
54720void
54721TestJSImplInterfaceJSImpl::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54722{
54723 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54724 if (aRv.Failed()) {
54725 return;
54726 }
54727 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54727); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54727); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54728 BindingCallContext& cx = s.GetCallContext();
54729
54730 JS::Rooted<JS::Value> rval(cx);
54731 JS::RootedVector<JS::Value> argv(cx);
54732 if (!argv.resize(1)) {
54733 // That threw an exception on the JSContext, and our CallSetup will do
54734 // the right thing with that.
54735 return;
54736 }
54737 unsigned argc = 1;
54738
54739 do {
54740 if (arg.WasPassed()) {
54741
54742 if (arg.Value().IsNull()) {
54743 argv[0].setNull();
54744 break;
54745 }
54746
54747 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54748 if (!returnObj) {
54749 aRv.Throw(NS_ERROR_UNEXPECTED);
54750 return;
54751 }
54752 // Scope for 'tmp'
54753 {
54754 JS::Rooted<JS::Value> tmp(cx);
54755 for (auto& entry : arg.Value().Value().Entries()) {
54756 auto& recordValue0 = entry.mValue;
54757 // Control block to let us common up the JS_DefineUCProperty calls when there
54758 // are different ways to succeed at wrapping the value.
54759 do {
54760 tmp.setInt32(int32_t(recordValue0));
54761 break;
54762 } while (false);
54763 if (!JS_DefineUCProperty(cx, returnObj,
54764 entry.mKey.BeginReading(),
54765 entry.mKey.Length(), tmp,
54766 JSPROP_ENUMERATE)) {
54767 aRv.Throw(NS_ERROR_UNEXPECTED);
54768 return;
54769 }
54770 }
54771 }
54772 argv[0].setObject(*returnObj);
54773 break;
54774 } else if (argc == 1) {
54775 // This is our current trailing argument; reduce argc
54776 --argc;
54777 } else {
54778 argv[0].setUndefined();
54779 }
54780 } while (false);
54781
54782 JS::Rooted<JS::Value> callable(cx);
54783 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54784 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54785 !InitIds(cx, atomsCache)) ||
54786 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecord_id, &callable)) {
54787 aRv.Throw(NS_ERROR_UNEXPECTED);
54788 return;
54789 }
54790 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54791 if (!JS::Call(cx, thisValue, callable,
54792 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54793 aRv.NoteJSContextException(cx);
54794 return;
54795 }
54796}
54797
54798void
54799TestJSImplInterfaceJSImpl::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54800{
54801 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54802 if (aRv.Failed()) {
54803 return;
54804 }
54805 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54805); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54805); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54806 BindingCallContext& cx = s.GetCallContext();
54807
54808 JS::Rooted<JS::Value> rval(cx);
54809 JS::RootedVector<JS::Value> argv(cx);
54810 if (!argv.resize(1)) {
54811 // That threw an exception on the JSContext, and our CallSetup will do
54812 // the right thing with that.
54813 return;
54814 }
54815 unsigned argc = 1;
54816
54817 do {
54818
54819 if (arg.IsNull()) {
54820 argv[0].setNull();
54821 break;
54822 }
54823
54824 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54825 if (!returnObj) {
54826 aRv.Throw(NS_ERROR_UNEXPECTED);
54827 return;
54828 }
54829 // Scope for 'tmp'
54830 {
54831 JS::Rooted<JS::Value> tmp(cx);
54832 for (auto& entry : arg.Value().Entries()) {
54833 auto& recordValue0 = entry.mValue;
54834 // Control block to let us common up the JS_DefineUCProperty calls when there
54835 // are different ways to succeed at wrapping the value.
54836 do {
54837 tmp.setInt32(int32_t(recordValue0));
54838 break;
54839 } while (false);
54840 if (!JS_DefineUCProperty(cx, returnObj,
54841 entry.mKey.BeginReading(),
54842 entry.mKey.Length(), tmp,
54843 JSPROP_ENUMERATE)) {
54844 aRv.Throw(NS_ERROR_UNEXPECTED);
54845 return;
54846 }
54847 }
54848 }
54849 argv[0].setObject(*returnObj);
54850 break;
54851 } while (false);
54852
54853 JS::Rooted<JS::Value> callable(cx);
54854 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54855 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54856 !InitIds(cx, atomsCache)) ||
54857 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordWithDefaultValue_id, &callable)) {
54858 aRv.Throw(NS_ERROR_UNEXPECTED);
54859 return;
54860 }
54861 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54862 if (!JS::Call(cx, thisValue, callable,
54863 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54864 aRv.NoteJSContextException(cx);
54865 return;
54866 }
54867}
54868
54869void
54870TestJSImplInterfaceJSImpl::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54871{
54872 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54873 if (aRv.Failed()) {
54874 return;
54875 }
54876 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54876); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54876); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54877 BindingCallContext& cx = s.GetCallContext();
54878
54879 JS::Rooted<JS::Value> rval(cx);
54880 JS::RootedVector<JS::Value> argv(cx);
54881 if (!argv.resize(1)) {
54882 // That threw an exception on the JSContext, and our CallSetup will do
54883 // the right thing with that.
54884 return;
54885 }
54886 unsigned argc = 1;
54887
54888 do {
54889 if (arg.WasPassed()) {
54890
54891 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54892 if (!returnObj) {
54893 aRv.Throw(NS_ERROR_UNEXPECTED);
54894 return;
54895 }
54896 // Scope for 'tmp'
54897 {
54898 JS::Rooted<JS::Value> tmp(cx);
54899 for (auto& entry : arg.Value().Entries()) {
54900 auto& recordValue0 = entry.mValue;
54901 // Control block to let us common up the JS_DefineUCProperty calls when there
54902 // are different ways to succeed at wrapping the value.
54903 do {
54904 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54905 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54905); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 54905); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54906 aRv.Throw(NS_ERROR_UNEXPECTED);
54907 return;
54908 }
54909 break;
54910 } while (false);
54911 if (!JS_DefineUCProperty(cx, returnObj,
54912 entry.mKey.BeginReading(),
54913 entry.mKey.Length(), tmp,
54914 JSPROP_ENUMERATE)) {
54915 aRv.Throw(NS_ERROR_UNEXPECTED);
54916 return;
54917 }
54918 }
54919 }
54920 argv[0].setObject(*returnObj);
54921 break;
54922 } else if (argc == 1) {
54923 // This is our current trailing argument; reduce argc
54924 --argc;
54925 } else {
54926 argv[0].setUndefined();
54927 }
54928 } while (false);
54929
54930 JS::Rooted<JS::Value> callable(cx);
54931 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54932 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54933 !InitIds(cx, atomsCache)) ||
54934 !GetCallableProperty(cx, atomsCache->passOptionalObjectRecord_id, &callable)) {
54935 aRv.Throw(NS_ERROR_UNEXPECTED);
54936 return;
54937 }
54938 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54939 if (!JS::Call(cx, thisValue, callable,
54940 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54941 aRv.NoteJSContextException(cx);
54942 return;
54943 }
54944}
54945
54946void
54947TestJSImplInterfaceJSImpl::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54948{
54949 CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54950 if (aRv.Failed()) {
54951 return;
54952 }
54953 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54953); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 54953); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
54954 BindingCallContext& cx = s.GetCallContext();
54955
54956 JS::Rooted<JS::Value> rval(cx);
54957 JS::RootedVector<JS::Value> argv(cx);
54958 if (!argv.resize(1)) {
54959 // That threw an exception on the JSContext, and our CallSetup will do
54960 // the right thing with that.
54961 return;
54962 }
54963 unsigned argc = 1;
54964
54965 do {
54966
54967 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54968 if (!returnObj) {
54969 aRv.Throw(NS_ERROR_UNEXPECTED);
54970 return;
54971 }
54972 // Scope for 'tmp'
54973 {
54974 JS::Rooted<JS::Value> tmp(cx);
54975 for (auto& entry : arg.Entries()) {
54976 auto& recordValue0 = entry.mValue;
54977 // Control block to let us common up the JS_DefineUCProperty calls when there
54978 // are different ways to succeed at wrapping the value.
54979 do {
54980 if (!WrapObject(cx, recordValue0, &tmp)) {
54981 aRv.Throw(NS_ERROR_UNEXPECTED);
54982 return;
54983 }
54984 break;
54985 } while (false);
54986 if (!JS_DefineUCProperty(cx, returnObj,
54987 entry.mKey.BeginReading(),
54988 entry.mKey.Length(), tmp,
54989 JSPROP_ENUMERATE)) {
54990 aRv.Throw(NS_ERROR_UNEXPECTED);
54991 return;
54992 }
54993 }
54994 }
54995 argv[0].setObject(*returnObj);
54996 break;
54997 } while (false);
54998
54999 JS::Rooted<JS::Value> callable(cx);
55000 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55001 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55002 !InitIds(cx, atomsCache)) ||
55003 !GetCallableProperty(cx, atomsCache->passExternalInterfaceRecord_id, &callable)) {
55004 aRv.Throw(NS_ERROR_UNEXPECTED);
55005 return;
55006 }
55007 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55008 if (!JS::Call(cx, thisValue, callable,
55009 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55010 aRv.NoteJSContextException(cx);
55011 return;
55012 }
55013}
55014
55015void
55016TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55017{
55018 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55019 if (aRv.Failed()) {
55020 return;
55021 }
55022 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55022); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55022); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55023 BindingCallContext& cx = s.GetCallContext();
55024
55025 JS::Rooted<JS::Value> rval(cx);
55026 JS::RootedVector<JS::Value> argv(cx);
55027 if (!argv.resize(1)) {
55028 // That threw an exception on the JSContext, and our CallSetup will do
55029 // the right thing with that.
55030 return;
55031 }
55032 unsigned argc = 1;
55033
55034 do {
55035
55036 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55037 if (!returnObj) {
55038 aRv.Throw(NS_ERROR_UNEXPECTED);
55039 return;
55040 }
55041 // Scope for 'tmp'
55042 {
55043 JS::Rooted<JS::Value> tmp(cx);
55044 for (auto& entry : arg.Entries()) {
55045 auto& recordValue0 = entry.mValue;
55046 // Control block to let us common up the JS_DefineUCProperty calls when there
55047 // are different ways to succeed at wrapping the value.
55048 do {
55049 if (!recordValue0) {
55050 tmp.setNull();
55051 break;
55052 }
55053 if (!WrapObject(cx, recordValue0, &tmp)) {
55054 aRv.Throw(NS_ERROR_UNEXPECTED);
55055 return;
55056 }
55057 break;
55058 } while (false);
55059 if (!JS_DefineUCProperty(cx, returnObj,
55060 entry.mKey.BeginReading(),
55061 entry.mKey.Length(), tmp,
55062 JSPROP_ENUMERATE)) {
55063 aRv.Throw(NS_ERROR_UNEXPECTED);
55064 return;
55065 }
55066 }
55067 }
55068 argv[0].setObject(*returnObj);
55069 break;
55070 } while (false);
55071
55072 JS::Rooted<JS::Value> callable(cx);
55073 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55074 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55075 !InitIds(cx, atomsCache)) ||
55076 !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceRecord_id, &callable)) {
55077 aRv.Throw(NS_ERROR_UNEXPECTED);
55078 return;
55079 }
55080 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55081 if (!JS::Call(cx, thisValue, callable,
55082 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55083 aRv.NoteJSContextException(cx);
55084 return;
55085 }
55086}
55087
55088void
55089TestJSImplInterfaceJSImpl::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55090{
55091 CallSetup s(this, aRv, "TestJSImplInterface.passStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55092 if (aRv.Failed()) {
55093 return;
55094 }
55095 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55095); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55095); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55096 BindingCallContext& cx = s.GetCallContext();
55097
55098 JS::Rooted<JS::Value> rval(cx);
55099 JS::RootedVector<JS::Value> argv(cx);
55100 if (!argv.resize(1)) {
55101 // That threw an exception on the JSContext, and our CallSetup will do
55102 // the right thing with that.
55103 return;
55104 }
55105 unsigned argc = 1;
55106
55107 do {
55108
55109 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55110 if (!returnObj) {
55111 aRv.Throw(NS_ERROR_UNEXPECTED);
55112 return;
55113 }
55114 // Scope for 'tmp'
55115 {
55116 JS::Rooted<JS::Value> tmp(cx);
55117 for (auto& entry : arg.Entries()) {
55118 auto& recordValue0 = entry.mValue;
55119 // Control block to let us common up the JS_DefineUCProperty calls when there
55120 // are different ways to succeed at wrapping the value.
55121 do {
55122 if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) {
55123 aRv.Throw(NS_ERROR_UNEXPECTED);
55124 return;
55125 }
55126 break;
55127 } while (false);
55128 if (!JS_DefineUCProperty(cx, returnObj,
55129 entry.mKey.BeginReading(),
55130 entry.mKey.Length(), tmp,
55131 JSPROP_ENUMERATE)) {
55132 aRv.Throw(NS_ERROR_UNEXPECTED);
55133 return;
55134 }
55135 }
55136 }
55137 argv[0].setObject(*returnObj);
55138 break;
55139 } while (false);
55140
55141 JS::Rooted<JS::Value> callable(cx);
55142 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55143 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55144 !InitIds(cx, atomsCache)) ||
55145 !GetCallableProperty(cx, atomsCache->passStringRecord_id, &callable)) {
55146 aRv.Throw(NS_ERROR_UNEXPECTED);
55147 return;
55148 }
55149 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55150 if (!JS::Call(cx, thisValue, callable,
55151 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55152 aRv.NoteJSContextException(cx);
55153 return;
55154 }
55155}
55156
55157void
55158TestJSImplInterfaceJSImpl::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55159{
55160 CallSetup s(this, aRv, "TestJSImplInterface.passByteStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55161 if (aRv.Failed()) {
55162 return;
55163 }
55164 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55164); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55164); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55165 BindingCallContext& cx = s.GetCallContext();
55166
55167 JS::Rooted<JS::Value> rval(cx);
55168 JS::RootedVector<JS::Value> argv(cx);
55169 if (!argv.resize(1)) {
55170 // That threw an exception on the JSContext, and our CallSetup will do
55171 // the right thing with that.
55172 return;
55173 }
55174 unsigned argc = 1;
55175
55176 do {
55177
55178 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55179 if (!returnObj) {
55180 aRv.Throw(NS_ERROR_UNEXPECTED);
55181 return;
55182 }
55183 // Scope for 'tmp'
55184 {
55185 JS::Rooted<JS::Value> tmp(cx);
55186 for (auto& entry : arg.Entries()) {
55187 auto& recordValue0 = entry.mValue;
55188 // Control block to let us common up the JS_DefineUCProperty calls when there
55189 // are different ways to succeed at wrapping the value.
55190 do {
55191 if (!NonVoidByteStringToJsval(cx, recordValue0, &tmp)) {
55192 aRv.Throw(NS_ERROR_UNEXPECTED);
55193 return;
55194 }
55195 break;
55196 } while (false);
55197 if (!JS_DefineUCProperty(cx, returnObj,
55198 entry.mKey.BeginReading(),
55199 entry.mKey.Length(), tmp,
55200 JSPROP_ENUMERATE)) {
55201 aRv.Throw(NS_ERROR_UNEXPECTED);
55202 return;
55203 }
55204 }
55205 }
55206 argv[0].setObject(*returnObj);
55207 break;
55208 } while (false);
55209
55210 JS::Rooted<JS::Value> callable(cx);
55211 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55212 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55213 !InitIds(cx, atomsCache)) ||
55214 !GetCallableProperty(cx, atomsCache->passByteStringRecord_id, &callable)) {
55215 aRv.Throw(NS_ERROR_UNEXPECTED);
55216 return;
55217 }
55218 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55219 if (!JS::Call(cx, thisValue, callable,
55220 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55221 aRv.NoteJSContextException(cx);
55222 return;
55223 }
55224}
55225
55226void
55227TestJSImplInterfaceJSImpl::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55228{
55229 CallSetup s(this, aRv, "TestJSImplInterface.passUTF8StringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55230 if (aRv.Failed()) {
55231 return;
55232 }
55233 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55233); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55233); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55234 BindingCallContext& cx = s.GetCallContext();
55235
55236 JS::Rooted<JS::Value> rval(cx);
55237 JS::RootedVector<JS::Value> argv(cx);
55238 if (!argv.resize(1)) {
55239 // That threw an exception on the JSContext, and our CallSetup will do
55240 // the right thing with that.
55241 return;
55242 }
55243 unsigned argc = 1;
55244
55245 do {
55246
55247 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55248 if (!returnObj) {
55249 aRv.Throw(NS_ERROR_UNEXPECTED);
55250 return;
55251 }
55252 // Scope for 'tmp'
55253 {
55254 JS::Rooted<JS::Value> tmp(cx);
55255 for (auto& entry : arg.Entries()) {
55256 auto& recordValue0 = entry.mValue;
55257 // Control block to let us common up the JS_DefineUCProperty calls when there
55258 // are different ways to succeed at wrapping the value.
55259 do {
55260 if (!NonVoidUTF8StringToJsval(cx, recordValue0, &tmp)) {
55261 aRv.Throw(NS_ERROR_UNEXPECTED);
55262 return;
55263 }
55264 break;
55265 } while (false);
55266 if (!JS_DefineUCProperty(cx, returnObj,
55267 entry.mKey.BeginReading(),
55268 entry.mKey.Length(), tmp,
55269 JSPROP_ENUMERATE)) {
55270 aRv.Throw(NS_ERROR_UNEXPECTED);
55271 return;
55272 }
55273 }
55274 }
55275 argv[0].setObject(*returnObj);
55276 break;
55277 } while (false);
55278
55279 JS::Rooted<JS::Value> callable(cx);
55280 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55281 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55282 !InitIds(cx, atomsCache)) ||
55283 !GetCallableProperty(cx, atomsCache->passUTF8StringRecord_id, &callable)) {
55284 aRv.Throw(NS_ERROR_UNEXPECTED);
55285 return;
55286 }
55287 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55288 if (!JS::Call(cx, thisValue, callable,
55289 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55290 aRv.NoteJSContextException(cx);
55291 return;
55292 }
55293}
55294
55295void
55296TestJSImplInterfaceJSImpl::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55297{
55298 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecords", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55299 if (aRv.Failed()) {
55300 return;
55301 }
55302 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55302); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55303 BindingCallContext& cx = s.GetCallContext();
55304
55305 JS::Rooted<JS::Value> rval(cx);
55306 JS::RootedVector<JS::Value> argv(cx);
55307 if (!argv.resize(1)) {
55308 // That threw an exception on the JSContext, and our CallSetup will do
55309 // the right thing with that.
55310 return;
55311 }
55312 unsigned argc = 1;
55313
55314 do {
55315
55316 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55317 if (!returnObj) {
55318 aRv.Throw(NS_ERROR_UNEXPECTED);
55319 return;
55320 }
55321 // Scope for 'tmp'
55322 {
55323 JS::Rooted<JS::Value> tmp(cx);
55324 for (auto& entry : arg.Entries()) {
55325 auto& recordValue0 = entry.mValue;
55326 // Control block to let us common up the JS_DefineUCProperty calls when there
55327 // are different ways to succeed at wrapping the value.
55328 do {
55329
55330 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55331 if (!returnObj) {
55332 aRv.Throw(NS_ERROR_UNEXPECTED);
55333 return;
55334 }
55335 // Scope for 'tmp'
55336 {
55337 JS::Rooted<JS::Value> tmp(cx);
55338 for (auto& entry : recordValue0.Entries()) {
55339 auto& recordValue1 = entry.mValue;
55340 // Control block to let us common up the JS_DefineUCProperty calls when there
55341 // are different ways to succeed at wrapping the value.
55342 do {
55343 tmp.setInt32(int32_t(recordValue1));
55344 break;
55345 } while (false);
55346 if (!JS_DefineUCProperty(cx, returnObj,
55347 entry.mKey.BeginReading(),
55348 entry.mKey.Length(), tmp,
55349 JSPROP_ENUMERATE)) {
55350 aRv.Throw(NS_ERROR_UNEXPECTED);
55351 return;
55352 }
55353 }
55354 }
55355 tmp.setObject(*returnObj);
55356 break;
55357 } while (false);
55358 if (!JS_DefineUCProperty(cx, returnObj,
55359 entry.mKey.BeginReading(),
55360 entry.mKey.Length(), tmp,
55361 JSPROP_ENUMERATE)) {
55362 aRv.Throw(NS_ERROR_UNEXPECTED);
55363 return;
55364 }
55365 }
55366 }
55367 argv[0].setObject(*returnObj);
55368 break;
55369 } while (false);
55370
55371 JS::Rooted<JS::Value> callable(cx);
55372 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55373 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55374 !InitIds(cx, atomsCache)) ||
55375 !GetCallableProperty(cx, atomsCache->passRecordOfRecords_id, &callable)) {
55376 aRv.Throw(NS_ERROR_UNEXPECTED);
55377 return;
55378 }
55379 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55380 if (!JS::Call(cx, thisValue, callable,
55381 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55382 aRv.NoteJSContextException(cx);
55383 return;
55384 }
55385}
55386
55387void
55388TestJSImplInterfaceJSImpl::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55389{
55390 CallSetup s(this, aRv, "TestJSImplInterface.receiveRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55391 if (aRv.Failed()) {
55392 return;
55393 }
55394 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55394); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55394); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55395 BindingCallContext& cx = s.GetCallContext();
55396
55397 JS::Rooted<JS::Value> rval(cx);
55398
55399 JS::Rooted<JS::Value> callable(cx);
55400 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55401 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55402 !InitIds(cx, atomsCache)) ||
55403 !GetCallableProperty(cx, atomsCache->receiveRecord_id, &callable)) {
55404 aRv.Throw(NS_ERROR_UNEXPECTED);
55405 return;
55406 }
55407 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55408 if (!JS::Call(cx, thisValue, callable,
55409 JS::HandleValueArray::empty(), &rval)) {
55410 aRv.NoteJSContextException(cx);
55411 return;
55412 }
55413 Record<nsString, int32_t>& rvalDecl(aRetVal);
55414 if (rval.isObject()) {
55415 auto& recordEntries = rvalDecl.Entries();
55416
55417 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55418 JS::RootedVector<jsid> ids(cx);
55419 if (!js::GetPropertyKeys(cx, recordObj,
55420 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55421 aRv.Throw(NS_ERROR_UNEXPECTED);
55422 return;
55423 }
55424 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55425 JS_ReportOutOfMemory(cx);
55426 aRv.Throw(NS_ERROR_UNEXPECTED);
55427 return;
55428 }
55429 JS::Rooted<JS::Value> propNameValue(cx);
55430 JS::Rooted<JS::Value> temp(cx);
55431 JS::Rooted<jsid> curId(cx);
55432 JS::Rooted<JS::Value> idVal(cx);
55433 // Use a hashset to keep track of ids seen, to avoid
55434 // introducing nasty O(N^2) behavior scanning for them all the
55435 // time. Ideally we'd use a data structure with O(1) lookup
55436 // _and_ ordering for the MozMap, but we don't have one lying
55437 // around.
55438 nsTHashtable<nsStringHashKey> idsSeen;
55439 for (size_t i = 0; i < ids.length(); ++i) {
55440 curId = ids[i];
55441
55442 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55443 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55444 &desc)) {
55445 aRv.Throw(NS_ERROR_UNEXPECTED);
55446 return;
55447 }
55448
55449 if (desc.isNothing() || !desc->enumerable()) {
55450 continue;
55451 }
55452
55453 idVal = js::IdToValue(curId);
55454 nsString propName;
55455 // This will just throw if idVal is a Symbol, like the spec says
55456 // to do.
55457 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecord", propName)) {
55458 aRv.Throw(NS_ERROR_UNEXPECTED);
55459 return;
55460 }
55461
55462 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55463 aRv.Throw(NS_ERROR_UNEXPECTED);
55464 return;
55465 }
55466
55467 Record<nsString, int32_t>::EntryType* entry;
55468 if (!idsSeen.EnsureInserted(propName)) {
55469 // Find the existing entry.
55470 auto idx = recordEntries.IndexOf(propName);
55471 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", 55472); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55472); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55472 "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", 55472); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55472); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55473 // Now blow it away to make it look like it was just added
55474 // to the array, because it's not obvious that it's
55475 // safe to write to its already-initialized mValue via our
55476 // normal codegen conversions. For example, the value
55477 // could be a union and this would change its type, but
55478 // codegen assumes we won't do that.
55479 entry = recordEntries.ReconstructElementAt(idx);
55480 } else {
55481 // Safe to do an infallible append here, because we did a
55482 // SetCapacity above to the right capacity.
55483 entry = recordEntries.AppendElement();
55484 }
55485 entry->mKey = propName;
55486 int32_t& slot = entry->mValue;
55487 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecord", &slot)) {
55488 aRv.Throw(NS_ERROR_UNEXPECTED);
55489 return;
55490 }
55491 }
55492 } else {
55493 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecord");
55494 aRv.Throw(NS_ERROR_UNEXPECTED);
55495 return;
55496 }
55497}
55498
55499void
55500TestJSImplInterfaceJSImpl::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55501{
55502 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55503 if (aRv.Failed()) {
55504 return;
55505 }
55506 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55506); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55507 BindingCallContext& cx = s.GetCallContext();
55508
55509 JS::Rooted<JS::Value> rval(cx);
55510
55511 JS::Rooted<JS::Value> callable(cx);
55512 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55513 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55514 !InitIds(cx, atomsCache)) ||
55515 !GetCallableProperty(cx, atomsCache->receiveNullableRecord_id, &callable)) {
55516 aRv.Throw(NS_ERROR_UNEXPECTED);
55517 return;
55518 }
55519 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55520 if (!JS::Call(cx, thisValue, callable,
55521 JS::HandleValueArray::empty(), &rval)) {
55522 aRv.NoteJSContextException(cx);
55523 return;
55524 }
55525 Nullable<Record<nsString, int32_t>>& rvalDecl(aRetVal);
55526 if (rval.isObject()) {
55527 auto& recordEntries = rvalDecl.SetValue().Entries();
55528
55529 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55530 JS::RootedVector<jsid> ids(cx);
55531 if (!js::GetPropertyKeys(cx, recordObj,
55532 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55533 aRv.Throw(NS_ERROR_UNEXPECTED);
55534 return;
55535 }
55536 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55537 JS_ReportOutOfMemory(cx);
55538 aRv.Throw(NS_ERROR_UNEXPECTED);
55539 return;
55540 }
55541 JS::Rooted<JS::Value> propNameValue(cx);
55542 JS::Rooted<JS::Value> temp(cx);
55543 JS::Rooted<jsid> curId(cx);
55544 JS::Rooted<JS::Value> idVal(cx);
55545 // Use a hashset to keep track of ids seen, to avoid
55546 // introducing nasty O(N^2) behavior scanning for them all the
55547 // time. Ideally we'd use a data structure with O(1) lookup
55548 // _and_ ordering for the MozMap, but we don't have one lying
55549 // around.
55550 nsTHashtable<nsStringHashKey> idsSeen;
55551 for (size_t i = 0; i < ids.length(); ++i) {
55552 curId = ids[i];
55553
55554 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55555 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55556 &desc)) {
55557 aRv.Throw(NS_ERROR_UNEXPECTED);
55558 return;
55559 }
55560
55561 if (desc.isNothing() || !desc->enumerable()) {
55562 continue;
55563 }
55564
55565 idVal = js::IdToValue(curId);
55566 nsString propName;
55567 // This will just throw if idVal is a Symbol, like the spec says
55568 // to do.
55569 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecord", propName)) {
55570 aRv.Throw(NS_ERROR_UNEXPECTED);
55571 return;
55572 }
55573
55574 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55575 aRv.Throw(NS_ERROR_UNEXPECTED);
55576 return;
55577 }
55578
55579 Record<nsString, int32_t>::EntryType* entry;
55580 if (!idsSeen.EnsureInserted(propName)) {
55581 // Find the existing entry.
55582 auto idx = recordEntries.IndexOf(propName);
55583 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", 55584); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55584); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55584 "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", 55584); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55584); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55585 // Now blow it away to make it look like it was just added
55586 // to the array, because it's not obvious that it's
55587 // safe to write to its already-initialized mValue via our
55588 // normal codegen conversions. For example, the value
55589 // could be a union and this would change its type, but
55590 // codegen assumes we won't do that.
55591 entry = recordEntries.ReconstructElementAt(idx);
55592 } else {
55593 // Safe to do an infallible append here, because we did a
55594 // SetCapacity above to the right capacity.
55595 entry = recordEntries.AppendElement();
55596 }
55597 entry->mKey = propName;
55598 int32_t& slot = entry->mValue;
55599 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecord", &slot)) {
55600 aRv.Throw(NS_ERROR_UNEXPECTED);
55601 return;
55602 }
55603 }
55604 } else if (rval.isNullOrUndefined()) {
55605 rvalDecl.SetNull();
55606 } else {
55607 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecord");
55608 aRv.Throw(NS_ERROR_UNEXPECTED);
55609 return;
55610 }
55611}
55612
55613void
55614TestJSImplInterfaceJSImpl::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55615{
55616 CallSetup s(this, aRv, "TestJSImplInterface.receiveRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55617 if (aRv.Failed()) {
55618 return;
55619 }
55620 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55620); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55620); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55621 BindingCallContext& cx = s.GetCallContext();
55622
55623 JS::Rooted<JS::Value> rval(cx);
55624
55625 JS::Rooted<JS::Value> callable(cx);
55626 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55627 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55628 !InitIds(cx, atomsCache)) ||
55629 !GetCallableProperty(cx, atomsCache->receiveRecordOfNullableInts_id, &callable)) {
55630 aRv.Throw(NS_ERROR_UNEXPECTED);
55631 return;
55632 }
55633 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55634 if (!JS::Call(cx, thisValue, callable,
55635 JS::HandleValueArray::empty(), &rval)) {
55636 aRv.NoteJSContextException(cx);
55637 return;
55638 }
55639 Record<nsString, Nullable<int32_t>>& rvalDecl(aRetVal);
55640 if (rval.isObject()) {
55641 auto& recordEntries = rvalDecl.Entries();
55642
55643 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55644 JS::RootedVector<jsid> ids(cx);
55645 if (!js::GetPropertyKeys(cx, recordObj,
55646 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55647 aRv.Throw(NS_ERROR_UNEXPECTED);
55648 return;
55649 }
55650 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55651 JS_ReportOutOfMemory(cx);
55652 aRv.Throw(NS_ERROR_UNEXPECTED);
55653 return;
55654 }
55655 JS::Rooted<JS::Value> propNameValue(cx);
55656 JS::Rooted<JS::Value> temp(cx);
55657 JS::Rooted<jsid> curId(cx);
55658 JS::Rooted<JS::Value> idVal(cx);
55659 // Use a hashset to keep track of ids seen, to avoid
55660 // introducing nasty O(N^2) behavior scanning for them all the
55661 // time. Ideally we'd use a data structure with O(1) lookup
55662 // _and_ ordering for the MozMap, but we don't have one lying
55663 // around.
55664 nsTHashtable<nsStringHashKey> idsSeen;
55665 for (size_t i = 0; i < ids.length(); ++i) {
55666 curId = ids[i];
55667
55668 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55669 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55670 &desc)) {
55671 aRv.Throw(NS_ERROR_UNEXPECTED);
55672 return;
55673 }
55674
55675 if (desc.isNothing() || !desc->enumerable()) {
55676 continue;
55677 }
55678
55679 idVal = js::IdToValue(curId);
55680 nsString propName;
55681 // This will just throw if idVal is a Symbol, like the spec says
55682 // to do.
55683 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecordOfNullableInts", propName)) {
55684 aRv.Throw(NS_ERROR_UNEXPECTED);
55685 return;
55686 }
55687
55688 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55689 aRv.Throw(NS_ERROR_UNEXPECTED);
55690 return;
55691 }
55692
55693 Record<nsString, Nullable<int32_t>>::EntryType* entry;
55694 if (!idsSeen.EnsureInserted(propName)) {
55695 // Find the existing entry.
55696 auto idx = recordEntries.IndexOf(propName);
55697 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", 55698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55698); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55698 "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", 55698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55698); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55699 // Now blow it away to make it look like it was just added
55700 // to the array, because it's not obvious that it's
55701 // safe to write to its already-initialized mValue via our
55702 // normal codegen conversions. For example, the value
55703 // could be a union and this would change its type, but
55704 // codegen assumes we won't do that.
55705 entry = recordEntries.ReconstructElementAt(idx);
55706 } else {
55707 // Safe to do an infallible append here, because we did a
55708 // SetCapacity above to the right capacity.
55709 entry = recordEntries.AppendElement();
55710 }
55711 entry->mKey = propName;
55712 Nullable<int32_t>& slot = entry->mValue;
55713 if (temp.isNullOrUndefined()) {
55714 slot.SetNull();
55715 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecordOfNullableInts", &slot.SetValue())) {
55716 aRv.Throw(NS_ERROR_UNEXPECTED);
55717 return;
55718 }
55719 }
55720 } else {
55721 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecordOfNullableInts");
55722 aRv.Throw(NS_ERROR_UNEXPECTED);
55723 return;
55724 }
55725}
55726
55727void
55728TestJSImplInterfaceJSImpl::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55729{
55730 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55731 if (aRv.Failed()) {
55732 return;
55733 }
55734 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55734); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55735 BindingCallContext& cx = s.GetCallContext();
55736
55737 JS::Rooted<JS::Value> rval(cx);
55738
55739 JS::Rooted<JS::Value> callable(cx);
55740 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55741 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55742 !InitIds(cx, atomsCache)) ||
55743 !GetCallableProperty(cx, atomsCache->receiveNullableRecordOfNullableInts_id, &callable)) {
55744 aRv.Throw(NS_ERROR_UNEXPECTED);
55745 return;
55746 }
55747 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55748 if (!JS::Call(cx, thisValue, callable,
55749 JS::HandleValueArray::empty(), &rval)) {
55750 aRv.NoteJSContextException(cx);
55751 return;
55752 }
55753 Nullable<Record<nsString, Nullable<int32_t>>>& rvalDecl(aRetVal);
55754 if (rval.isObject()) {
55755 auto& recordEntries = rvalDecl.SetValue().Entries();
55756
55757 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55758 JS::RootedVector<jsid> ids(cx);
55759 if (!js::GetPropertyKeys(cx, recordObj,
55760 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55761 aRv.Throw(NS_ERROR_UNEXPECTED);
55762 return;
55763 }
55764 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55765 JS_ReportOutOfMemory(cx);
55766 aRv.Throw(NS_ERROR_UNEXPECTED);
55767 return;
55768 }
55769 JS::Rooted<JS::Value> propNameValue(cx);
55770 JS::Rooted<JS::Value> temp(cx);
55771 JS::Rooted<jsid> curId(cx);
55772 JS::Rooted<JS::Value> idVal(cx);
55773 // Use a hashset to keep track of ids seen, to avoid
55774 // introducing nasty O(N^2) behavior scanning for them all the
55775 // time. Ideally we'd use a data structure with O(1) lookup
55776 // _and_ ordering for the MozMap, but we don't have one lying
55777 // around.
55778 nsTHashtable<nsStringHashKey> idsSeen;
55779 for (size_t i = 0; i < ids.length(); ++i) {
55780 curId = ids[i];
55781
55782 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55783 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55784 &desc)) {
55785 aRv.Throw(NS_ERROR_UNEXPECTED);
55786 return;
55787 }
55788
55789 if (desc.isNothing() || !desc->enumerable()) {
55790 continue;
55791 }
55792
55793 idVal = js::IdToValue(curId);
55794 nsString propName;
55795 // This will just throw if idVal is a Symbol, like the spec says
55796 // to do.
55797 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", propName)) {
55798 aRv.Throw(NS_ERROR_UNEXPECTED);
55799 return;
55800 }
55801
55802 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55803 aRv.Throw(NS_ERROR_UNEXPECTED);
55804 return;
55805 }
55806
55807 Record<nsString, Nullable<int32_t>>::EntryType* entry;
55808 if (!idsSeen.EnsureInserted(propName)) {
55809 // Find the existing entry.
55810 auto idx = recordEntries.IndexOf(propName);
55811 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", 55812); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55812); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55812 "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", 55812); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55812); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55813 // Now blow it away to make it look like it was just added
55814 // to the array, because it's not obvious that it's
55815 // safe to write to its already-initialized mValue via our
55816 // normal codegen conversions. For example, the value
55817 // could be a union and this would change its type, but
55818 // codegen assumes we won't do that.
55819 entry = recordEntries.ReconstructElementAt(idx);
55820 } else {
55821 // Safe to do an infallible append here, because we did a
55822 // SetCapacity above to the right capacity.
55823 entry = recordEntries.AppendElement();
55824 }
55825 entry->mKey = propName;
55826 Nullable<int32_t>& slot = entry->mValue;
55827 if (temp.isNullOrUndefined()) {
55828 slot.SetNull();
55829 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", &slot.SetValue())) {
55830 aRv.Throw(NS_ERROR_UNEXPECTED);
55831 return;
55832 }
55833 }
55834 } else if (rval.isNullOrUndefined()) {
55835 rvalDecl.SetNull();
55836 } else {
55837 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecordOfNullableInts");
55838 aRv.Throw(NS_ERROR_UNEXPECTED);
55839 return;
55840 }
55841}
55842
55843void
55844TestJSImplInterfaceJSImpl::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55845{
55846 CallSetup s(this, aRv, "TestJSImplInterface.receiveAnyRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55847 if (aRv.Failed()) {
55848 return;
55849 }
55850 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55850); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55850); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55851 BindingCallContext& cx = s.GetCallContext();
55852
55853 JS::Rooted<JS::Value> rval(cx);
55854
55855 JS::Rooted<JS::Value> callable(cx);
55856 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55857 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55858 !InitIds(cx, atomsCache)) ||
55859 !GetCallableProperty(cx, atomsCache->receiveAnyRecord_id, &callable)) {
55860 aRv.Throw(NS_ERROR_UNEXPECTED);
55861 return;
55862 }
55863 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55864 if (!JS::Call(cx, thisValue, callable,
55865 JS::HandleValueArray::empty(), &rval)) {
55866 aRv.NoteJSContextException(cx);
55867 return;
55868 }
55869 Record<nsString, JS::Value>& rvalDecl(aRetVal);
55870 if (rval.isObject()) {
55871 auto& recordEntries = rvalDecl.Entries();
55872
55873 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55874 JS::RootedVector<jsid> ids(cx);
55875 if (!js::GetPropertyKeys(cx, recordObj,
55876 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55877 aRv.Throw(NS_ERROR_UNEXPECTED);
55878 return;
55879 }
55880 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55881 JS_ReportOutOfMemory(cx);
55882 aRv.Throw(NS_ERROR_UNEXPECTED);
55883 return;
55884 }
55885 JS::Rooted<JS::Value> propNameValue(cx);
55886 JS::Rooted<JS::Value> temp(cx);
55887 JS::Rooted<jsid> curId(cx);
55888 JS::Rooted<JS::Value> idVal(cx);
55889 // Use a hashset to keep track of ids seen, to avoid
55890 // introducing nasty O(N^2) behavior scanning for them all the
55891 // time. Ideally we'd use a data structure with O(1) lookup
55892 // _and_ ordering for the MozMap, but we don't have one lying
55893 // around.
55894 nsTHashtable<nsStringHashKey> idsSeen;
55895 for (size_t i = 0; i < ids.length(); ++i) {
55896 curId = ids[i];
55897
55898 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55899 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55900 &desc)) {
55901 aRv.Throw(NS_ERROR_UNEXPECTED);
55902 return;
55903 }
55904
55905 if (desc.isNothing() || !desc->enumerable()) {
55906 continue;
55907 }
55908
55909 idVal = js::IdToValue(curId);
55910 nsString propName;
55911 // This will just throw if idVal is a Symbol, like the spec says
55912 // to do.
55913 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveAnyRecord", propName)) {
55914 aRv.Throw(NS_ERROR_UNEXPECTED);
55915 return;
55916 }
55917
55918 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55919 aRv.Throw(NS_ERROR_UNEXPECTED);
55920 return;
55921 }
55922
55923 Record<nsString, JS::Value>::EntryType* entry;
55924 if (!idsSeen.EnsureInserted(propName)) {
55925 // Find the existing entry.
55926 auto idx = recordEntries.IndexOf(propName);
55927 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", 55928); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55928); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55928 "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", 55928); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { MOZ_CrashSequence(__null, 55928); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55929 // Now blow it away to make it look like it was just added
55930 // to the array, because it's not obvious that it's
55931 // safe to write to its already-initialized mValue via our
55932 // normal codegen conversions. For example, the value
55933 // could be a union and this would change its type, but
55934 // codegen assumes we won't do that.
55935 entry = recordEntries.ReconstructElementAt(idx);
55936 } else {
55937 // Safe to do an infallible append here, because we did a
55938 // SetCapacity above to the right capacity.
55939 entry = recordEntries.AppendElement();
55940 }
55941 entry->mKey = propName;
55942 JS::Value& slot = entry->mValue;
55943#ifdef __clang__1
55944#pragma clang diagnostic push
55945#pragma clang diagnostic ignored "-Wunreachable-code"
55946#pragma clang diagnostic ignored "-Wunreachable-code-return"
55947#endif // __clang__
55948 if ((false) && !CallerSubsumes(temp)) {
55949 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in return value of TestJSImplInterface.receiveAnyRecord");
55950 aRv.Throw(NS_ERROR_UNEXPECTED);
55951 return;
55952 }
55953#ifdef __clang__1
55954#pragma clang diagnostic pop
55955#endif // __clang__
55956 slot = temp;
55957 }
55958 } else {
55959 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveAnyRecord");
55960 aRv.Throw(NS_ERROR_UNEXPECTED);
55961 return;
55962 }
55963}
55964
55965void
55966TestJSImplInterfaceJSImpl::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
55967{
55968 CallSetup s(this, aRv, "TestJSImplInterface.passArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55969 if (aRv.Failed()) {
55970 return;
55971 }
55972 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 55972); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
55973 BindingCallContext& cx = s.GetCallContext();
55974
55975 JS::Rooted<JS::Value> rval(cx);
55976 JS::RootedVector<JS::Value> argv(cx);
55977 if (!argv.resize(1)) {
55978 // That threw an exception on the JSContext, and our CallSetup will do
55979 // the right thing with that.
55980 return;
55981 }
55982 unsigned argc = 1;
55983
55984 do {
55985 argv[0].setObject(*arg.Obj());
55986 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
55987 aRv.Throw(NS_ERROR_UNEXPECTED);
55988 return;
55989 }
55990 break;
55991 } while (false);
55992
55993 JS::Rooted<JS::Value> callable(cx);
55994 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55995 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55996 !InitIds(cx, atomsCache)) ||
55997 !GetCallableProperty(cx, atomsCache->passArrayBuffer_id, &callable)) {
55998 aRv.Throw(NS_ERROR_UNEXPECTED);
55999 return;
56000 }
56001 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56002 if (!JS::Call(cx, thisValue, callable,
56003 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56004 aRv.NoteJSContextException(cx);
56005 return;
56006 }
56007}
56008
56009void
56010TestJSImplInterfaceJSImpl::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56011{
56012 CallSetup s(this, aRv, "TestJSImplInterface.passNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56013 if (aRv.Failed()) {
56014 return;
56015 }
56016 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56016); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56016); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56017 BindingCallContext& cx = s.GetCallContext();
56018
56019 JS::Rooted<JS::Value> rval(cx);
56020 JS::RootedVector<JS::Value> argv(cx);
56021 if (!argv.resize(1)) {
56022 // That threw an exception on the JSContext, and our CallSetup will do
56023 // the right thing with that.
56024 return;
56025 }
56026 unsigned argc = 1;
56027
56028 do {
56029 if (arg.IsNull()) {
56030 argv[0].setNull();
56031 break;
56032 }
56033 argv[0].setObject(*arg.Value().Obj());
56034 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56035 aRv.Throw(NS_ERROR_UNEXPECTED);
56036 return;
56037 }
56038 break;
56039 } while (false);
56040
56041 JS::Rooted<JS::Value> callable(cx);
56042 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56043 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56044 !InitIds(cx, atomsCache)) ||
56045 !GetCallableProperty(cx, atomsCache->passNullableArrayBuffer_id, &callable)) {
56046 aRv.Throw(NS_ERROR_UNEXPECTED);
56047 return;
56048 }
56049 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56050 if (!JS::Call(cx, thisValue, callable,
56051 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56052 aRv.NoteJSContextException(cx);
56053 return;
56054 }
56055}
56056
56057void
56058TestJSImplInterfaceJSImpl::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56059{
56060 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56061 if (aRv.Failed()) {
56062 return;
56063 }
56064 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56064); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56065 BindingCallContext& cx = s.GetCallContext();
56066
56067 JS::Rooted<JS::Value> rval(cx);
56068 JS::RootedVector<JS::Value> argv(cx);
56069 if (!argv.resize(1)) {
56070 // That threw an exception on the JSContext, and our CallSetup will do
56071 // the right thing with that.
56072 return;
56073 }
56074 unsigned argc = 1;
56075
56076 do {
56077 if (arg.WasPassed()) {
56078 argv[0].setObject(*arg.Value().Obj());
56079 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56080 aRv.Throw(NS_ERROR_UNEXPECTED);
56081 return;
56082 }
56083 break;
56084 } else if (argc == 1) {
56085 // This is our current trailing argument; reduce argc
56086 --argc;
56087 } else {
56088 argv[0].setUndefined();
56089 }
56090 } while (false);
56091
56092 JS::Rooted<JS::Value> callable(cx);
56093 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56094 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56095 !InitIds(cx, atomsCache)) ||
56096 !GetCallableProperty(cx, atomsCache->passOptionalArrayBuffer_id, &callable)) {
56097 aRv.Throw(NS_ERROR_UNEXPECTED);
56098 return;
56099 }
56100 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56101 if (!JS::Call(cx, thisValue, callable,
56102 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56103 aRv.NoteJSContextException(cx);
56104 return;
56105 }
56106}
56107
56108void
56109TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56110{
56111 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56112 if (aRv.Failed()) {
56113 return;
56114 }
56115 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56115); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56115); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56116 BindingCallContext& cx = s.GetCallContext();
56117
56118 JS::Rooted<JS::Value> rval(cx);
56119 JS::RootedVector<JS::Value> argv(cx);
56120 if (!argv.resize(1)) {
56121 // That threw an exception on the JSContext, and our CallSetup will do
56122 // the right thing with that.
56123 return;
56124 }
56125 unsigned argc = 1;
56126
56127 do {
56128 if (arg.WasPassed()) {
56129 if (arg.Value().IsNull()) {
56130 argv[0].setNull();
56131 break;
56132 }
56133 argv[0].setObject(*arg.Value().Value().Obj());
56134 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56135 aRv.Throw(NS_ERROR_UNEXPECTED);
56136 return;
56137 }
56138 break;
56139 } else if (argc == 1) {
56140 // This is our current trailing argument; reduce argc
56141 --argc;
56142 } else {
56143 argv[0].setUndefined();
56144 }
56145 } while (false);
56146
56147 JS::Rooted<JS::Value> callable(cx);
56148 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56149 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56150 !InitIds(cx, atomsCache)) ||
56151 !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBuffer_id, &callable)) {
56152 aRv.Throw(NS_ERROR_UNEXPECTED);
56153 return;
56154 }
56155 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56156 if (!JS::Call(cx, thisValue, callable,
56157 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56158 aRv.NoteJSContextException(cx);
56159 return;
56160 }
56161}
56162
56163void
56164TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56165{
56166 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56167 if (aRv.Failed()) {
56168 return;
56169 }
56170 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56170); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56170); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56171 BindingCallContext& cx = s.GetCallContext();
56172
56173 JS::Rooted<JS::Value> rval(cx);
56174 JS::RootedVector<JS::Value> argv(cx);
56175 if (!argv.resize(1)) {
56176 // That threw an exception on the JSContext, and our CallSetup will do
56177 // the right thing with that.
56178 return;
56179 }
56180 unsigned argc = 1;
56181
56182 do {
56183 if (arg.IsNull()) {
56184 argv[0].setNull();
56185 break;
56186 }
56187 argv[0].setObject(*arg.Value().Obj());
56188 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56189 aRv.Throw(NS_ERROR_UNEXPECTED);
56190 return;
56191 }
56192 break;
56193 } while (false);
56194
56195 JS::Rooted<JS::Value> callable(cx);
56196 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56197 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56198 !InitIds(cx, atomsCache)) ||
56199 !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id, &callable)) {
56200 aRv.Throw(NS_ERROR_UNEXPECTED);
56201 return;
56202 }
56203 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56204 if (!JS::Call(cx, thisValue, callable,
56205 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56206 aRv.NoteJSContextException(cx);
56207 return;
56208 }
56209}
56210
56211void
56212TestJSImplInterfaceJSImpl::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
56213{
56214 CallSetup s(this, aRv, "TestJSImplInterface.passArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56215 if (aRv.Failed()) {
56216 return;
56217 }
56218 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56218); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56218); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56219 BindingCallContext& cx = s.GetCallContext();
56220
56221 JS::Rooted<JS::Value> rval(cx);
56222 JS::RootedVector<JS::Value> argv(cx);
56223 if (!argv.resize(1)) {
56224 // That threw an exception on the JSContext, and our CallSetup will do
56225 // the right thing with that.
56226 return;
56227 }
56228 unsigned argc = 1;
56229
56230 do {
56231 argv[0].setObject(*arg.Obj());
56232 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56233 aRv.Throw(NS_ERROR_UNEXPECTED);
56234 return;
56235 }
56236 break;
56237 } while (false);
56238
56239 JS::Rooted<JS::Value> callable(cx);
56240 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56241 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56242 !InitIds(cx, atomsCache)) ||
56243 !GetCallableProperty(cx, atomsCache->passArrayBufferView_id, &callable)) {
56244 aRv.Throw(NS_ERROR_UNEXPECTED);
56245 return;
56246 }
56247 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56248 if (!JS::Call(cx, thisValue, callable,
56249 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56250 aRv.NoteJSContextException(cx);
56251 return;
56252 }
56253}
56254
56255void
56256TestJSImplInterfaceJSImpl::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56257{
56258 CallSetup s(this, aRv, "TestJSImplInterface.passInt8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56259 if (aRv.Failed()) {
56260 return;
56261 }
56262 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56262); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56262); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56263 BindingCallContext& cx = s.GetCallContext();
56264
56265 JS::Rooted<JS::Value> rval(cx);
56266 JS::RootedVector<JS::Value> argv(cx);
56267 if (!argv.resize(1)) {
56268 // That threw an exception on the JSContext, and our CallSetup will do
56269 // the right thing with that.
56270 return;
56271 }
56272 unsigned argc = 1;
56273
56274 do {
56275 argv[0].setObject(*arg.Obj());
56276 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56277 aRv.Throw(NS_ERROR_UNEXPECTED);
56278 return;
56279 }
56280 break;
56281 } while (false);
56282
56283 JS::Rooted<JS::Value> callable(cx);
56284 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56285 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56286 !InitIds(cx, atomsCache)) ||
56287 !GetCallableProperty(cx, atomsCache->passInt8Array_id, &callable)) {
56288 aRv.Throw(NS_ERROR_UNEXPECTED);
56289 return;
56290 }
56291 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56292 if (!JS::Call(cx, thisValue, callable,
56293 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56294 aRv.NoteJSContextException(cx);
56295 return;
56296 }
56297}
56298
56299void
56300TestJSImplInterfaceJSImpl::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56301{
56302 CallSetup s(this, aRv, "TestJSImplInterface.passInt16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56303 if (aRv.Failed()) {
56304 return;
56305 }
56306 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56306); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56306); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56307 BindingCallContext& cx = s.GetCallContext();
56308
56309 JS::Rooted<JS::Value> rval(cx);
56310 JS::RootedVector<JS::Value> argv(cx);
56311 if (!argv.resize(1)) {
56312 // That threw an exception on the JSContext, and our CallSetup will do
56313 // the right thing with that.
56314 return;
56315 }
56316 unsigned argc = 1;
56317
56318 do {
56319 argv[0].setObject(*arg.Obj());
56320 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56321 aRv.Throw(NS_ERROR_UNEXPECTED);
56322 return;
56323 }
56324 break;
56325 } while (false);
56326
56327 JS::Rooted<JS::Value> callable(cx);
56328 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56329 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56330 !InitIds(cx, atomsCache)) ||
56331 !GetCallableProperty(cx, atomsCache->passInt16Array_id, &callable)) {
56332 aRv.Throw(NS_ERROR_UNEXPECTED);
56333 return;
56334 }
56335 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56336 if (!JS::Call(cx, thisValue, callable,
56337 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56338 aRv.NoteJSContextException(cx);
56339 return;
56340 }
56341}
56342
56343void
56344TestJSImplInterfaceJSImpl::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56345{
56346 CallSetup s(this, aRv, "TestJSImplInterface.passInt32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56347 if (aRv.Failed()) {
56348 return;
56349 }
56350 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56350); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56350); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56351 BindingCallContext& cx = s.GetCallContext();
56352
56353 JS::Rooted<JS::Value> rval(cx);
56354 JS::RootedVector<JS::Value> argv(cx);
56355 if (!argv.resize(1)) {
56356 // That threw an exception on the JSContext, and our CallSetup will do
56357 // the right thing with that.
56358 return;
56359 }
56360 unsigned argc = 1;
56361
56362 do {
56363 argv[0].setObject(*arg.Obj());
56364 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56365 aRv.Throw(NS_ERROR_UNEXPECTED);
56366 return;
56367 }
56368 break;
56369 } while (false);
56370
56371 JS::Rooted<JS::Value> callable(cx);
56372 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56373 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56374 !InitIds(cx, atomsCache)) ||
56375 !GetCallableProperty(cx, atomsCache->passInt32Array_id, &callable)) {
56376 aRv.Throw(NS_ERROR_UNEXPECTED);
56377 return;
56378 }
56379 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56380 if (!JS::Call(cx, thisValue, callable,
56381 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56382 aRv.NoteJSContextException(cx);
56383 return;
56384 }
56385}
56386
56387void
56388TestJSImplInterfaceJSImpl::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56389{
56390 CallSetup s(this, aRv, "TestJSImplInterface.passUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56391 if (aRv.Failed()) {
56392 return;
56393 }
56394 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56394); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56394); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56395 BindingCallContext& cx = s.GetCallContext();
56396
56397 JS::Rooted<JS::Value> rval(cx);
56398 JS::RootedVector<JS::Value> argv(cx);
56399 if (!argv.resize(1)) {
56400 // That threw an exception on the JSContext, and our CallSetup will do
56401 // the right thing with that.
56402 return;
56403 }
56404 unsigned argc = 1;
56405
56406 do {
56407 argv[0].setObject(*arg.Obj());
56408 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56409 aRv.Throw(NS_ERROR_UNEXPECTED);
56410 return;
56411 }
56412 break;
56413 } while (false);
56414
56415 JS::Rooted<JS::Value> callable(cx);
56416 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56417 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56418 !InitIds(cx, atomsCache)) ||
56419 !GetCallableProperty(cx, atomsCache->passUint8Array_id, &callable)) {
56420 aRv.Throw(NS_ERROR_UNEXPECTED);
56421 return;
56422 }
56423 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56424 if (!JS::Call(cx, thisValue, callable,
56425 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56426 aRv.NoteJSContextException(cx);
56427 return;
56428 }
56429}
56430
56431void
56432TestJSImplInterfaceJSImpl::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56433{
56434 CallSetup s(this, aRv, "TestJSImplInterface.passUint16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56435 if (aRv.Failed()) {
56436 return;
56437 }
56438 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56438); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56438); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56439 BindingCallContext& cx = s.GetCallContext();
56440
56441 JS::Rooted<JS::Value> rval(cx);
56442 JS::RootedVector<JS::Value> argv(cx);
56443 if (!argv.resize(1)) {
56444 // That threw an exception on the JSContext, and our CallSetup will do
56445 // the right thing with that.
56446 return;
56447 }
56448 unsigned argc = 1;
56449
56450 do {
56451 argv[0].setObject(*arg.Obj());
56452 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56453 aRv.Throw(NS_ERROR_UNEXPECTED);
56454 return;
56455 }
56456 break;
56457 } while (false);
56458
56459 JS::Rooted<JS::Value> callable(cx);
56460 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56461 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56462 !InitIds(cx, atomsCache)) ||
56463 !GetCallableProperty(cx, atomsCache->passUint16Array_id, &callable)) {
56464 aRv.Throw(NS_ERROR_UNEXPECTED);
56465 return;
56466 }
56467 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56468 if (!JS::Call(cx, thisValue, callable,
56469 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56470 aRv.NoteJSContextException(cx);
56471 return;
56472 }
56473}
56474
56475void
56476TestJSImplInterfaceJSImpl::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56477{
56478 CallSetup s(this, aRv, "TestJSImplInterface.passUint32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56479 if (aRv.Failed()) {
56480 return;
56481 }
56482 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56482); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56482); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56483 BindingCallContext& cx = s.GetCallContext();
56484
56485 JS::Rooted<JS::Value> rval(cx);
56486 JS::RootedVector<JS::Value> argv(cx);
56487 if (!argv.resize(1)) {
56488 // That threw an exception on the JSContext, and our CallSetup will do
56489 // the right thing with that.
56490 return;
56491 }
56492 unsigned argc = 1;
56493
56494 do {
56495 argv[0].setObject(*arg.Obj());
56496 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56497 aRv.Throw(NS_ERROR_UNEXPECTED);
56498 return;
56499 }
56500 break;
56501 } while (false);
56502
56503 JS::Rooted<JS::Value> callable(cx);
56504 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56505 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56506 !InitIds(cx, atomsCache)) ||
56507 !GetCallableProperty(cx, atomsCache->passUint32Array_id, &callable)) {
56508 aRv.Throw(NS_ERROR_UNEXPECTED);
56509 return;
56510 }
56511 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56512 if (!JS::Call(cx, thisValue, callable,
56513 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56514 aRv.NoteJSContextException(cx);
56515 return;
56516 }
56517}
56518
56519void
56520TestJSImplInterfaceJSImpl::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm)
56521{
56522 CallSetup s(this, aRv, "TestJSImplInterface.passUint8ClampedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56523 if (aRv.Failed()) {
56524 return;
56525 }
56526 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56526); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56526); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56527 BindingCallContext& cx = s.GetCallContext();
56528
56529 JS::Rooted<JS::Value> rval(cx);
56530 JS::RootedVector<JS::Value> argv(cx);
56531 if (!argv.resize(1)) {
56532 // That threw an exception on the JSContext, and our CallSetup will do
56533 // the right thing with that.
56534 return;
56535 }
56536 unsigned argc = 1;
56537
56538 do {
56539 argv[0].setObject(*arg.Obj());
56540 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56541 aRv.Throw(NS_ERROR_UNEXPECTED);
56542 return;
56543 }
56544 break;
56545 } while (false);
56546
56547 JS::Rooted<JS::Value> callable(cx);
56548 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56549 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56550 !InitIds(cx, atomsCache)) ||
56551 !GetCallableProperty(cx, atomsCache->passUint8ClampedArray_id, &callable)) {
56552 aRv.Throw(NS_ERROR_UNEXPECTED);
56553 return;
56554 }
56555 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56556 if (!JS::Call(cx, thisValue, callable,
56557 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56558 aRv.NoteJSContextException(cx);
56559 return;
56560 }
56561}
56562
56563void
56564TestJSImplInterfaceJSImpl::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56565{
56566 CallSetup s(this, aRv, "TestJSImplInterface.passFloat32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56567 if (aRv.Failed()) {
56568 return;
56569 }
56570 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56570); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56570); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56571 BindingCallContext& cx = s.GetCallContext();
56572
56573 JS::Rooted<JS::Value> rval(cx);
56574 JS::RootedVector<JS::Value> argv(cx);
56575 if (!argv.resize(1)) {
56576 // That threw an exception on the JSContext, and our CallSetup will do
56577 // the right thing with that.
56578 return;
56579 }
56580 unsigned argc = 1;
56581
56582 do {
56583 argv[0].setObject(*arg.Obj());
56584 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56585 aRv.Throw(NS_ERROR_UNEXPECTED);
56586 return;
56587 }
56588 break;
56589 } while (false);
56590
56591 JS::Rooted<JS::Value> callable(cx);
56592 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56593 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56594 !InitIds(cx, atomsCache)) ||
56595 !GetCallableProperty(cx, atomsCache->passFloat32Array_id, &callable)) {
56596 aRv.Throw(NS_ERROR_UNEXPECTED);
56597 return;
56598 }
56599 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56600 if (!JS::Call(cx, thisValue, callable,
56601 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56602 aRv.NoteJSContextException(cx);
56603 return;
56604 }
56605}
56606
56607void
56608TestJSImplInterfaceJSImpl::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56609{
56610 CallSetup s(this, aRv, "TestJSImplInterface.passFloat64Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56611 if (aRv.Failed()) {
56612 return;
56613 }
56614 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56614); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56614); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56615 BindingCallContext& cx = s.GetCallContext();
56616
56617 JS::Rooted<JS::Value> rval(cx);
56618 JS::RootedVector<JS::Value> argv(cx);
56619 if (!argv.resize(1)) {
56620 // That threw an exception on the JSContext, and our CallSetup will do
56621 // the right thing with that.
56622 return;
56623 }
56624 unsigned argc = 1;
56625
56626 do {
56627 argv[0].setObject(*arg.Obj());
56628 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56629 aRv.Throw(NS_ERROR_UNEXPECTED);
56630 return;
56631 }
56632 break;
56633 } while (false);
56634
56635 JS::Rooted<JS::Value> callable(cx);
56636 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56637 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56638 !InitIds(cx, atomsCache)) ||
56639 !GetCallableProperty(cx, atomsCache->passFloat64Array_id, &callable)) {
56640 aRv.Throw(NS_ERROR_UNEXPECTED);
56641 return;
56642 }
56643 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56644 if (!JS::Call(cx, thisValue, callable,
56645 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56646 aRv.NoteJSContextException(cx);
56647 return;
56648 }
56649}
56650
56651void
56652TestJSImplInterfaceJSImpl::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56653{
56654 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56655 if (aRv.Failed()) {
56656 return;
56657 }
56658 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56658); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56658); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56659 BindingCallContext& cx = s.GetCallContext();
56660
56661 JS::Rooted<JS::Value> rval(cx);
56662 JS::RootedVector<JS::Value> argv(cx);
56663 if (!argv.resize(1)) {
56664 // That threw an exception on the JSContext, and our CallSetup will do
56665 // the right thing with that.
56666 return;
56667 }
56668 unsigned argc = 1;
56669
56670 do {
56671
56672 uint32_t length = arg.Length();
56673 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
56674 if (!returnArray) {
56675 aRv.Throw(NS_ERROR_UNEXPECTED);
56676 return;
56677 }
56678 // Scope for 'tmp'
56679 {
56680 JS::Rooted<JS::Value> tmp(cx);
56681 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
56682 // Control block to let us common up the JS_DefineElement calls when there
56683 // are different ways to succeed at wrapping the object.
56684 do {
56685 tmp.setObject(*arg[sequenceIdx0].Obj());
56686 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56687 aRv.Throw(NS_ERROR_UNEXPECTED);
56688 return;
56689 }
56690 break;
56691 } while (false);
56692 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
56693 JSPROP_ENUMERATE)) {
56694 aRv.Throw(NS_ERROR_UNEXPECTED);
56695 return;
56696 }
56697 }
56698 }
56699 argv[0].setObject(*returnArray);
56700 break;
56701 } while (false);
56702
56703 JS::Rooted<JS::Value> callable(cx);
56704 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56705 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56706 !InitIds(cx, atomsCache)) ||
56707 !GetCallableProperty(cx, atomsCache->passSequenceOfArrayBuffers_id, &callable)) {
56708 aRv.Throw(NS_ERROR_UNEXPECTED);
56709 return;
56710 }
56711 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56712 if (!JS::Call(cx, thisValue, callable,
56713 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56714 aRv.NoteJSContextException(cx);
56715 return;
56716 }
56717}
56718
56719void
56720TestJSImplInterfaceJSImpl::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56721{
56722 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56723 if (aRv.Failed()) {
56724 return;
56725 }
56726 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56726); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56726); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56727 BindingCallContext& cx = s.GetCallContext();
56728
56729 JS::Rooted<JS::Value> rval(cx);
56730 JS::RootedVector<JS::Value> argv(cx);
56731 if (!argv.resize(1)) {
56732 // That threw an exception on the JSContext, and our CallSetup will do
56733 // the right thing with that.
56734 return;
56735 }
56736 unsigned argc = 1;
56737
56738 do {
56739
56740 uint32_t length = arg.Length();
56741 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
56742 if (!returnArray) {
56743 aRv.Throw(NS_ERROR_UNEXPECTED);
56744 return;
56745 }
56746 // Scope for 'tmp'
56747 {
56748 JS::Rooted<JS::Value> tmp(cx);
56749 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
56750 // Control block to let us common up the JS_DefineElement calls when there
56751 // are different ways to succeed at wrapping the object.
56752 do {
56753 if (arg[sequenceIdx0].IsNull()) {
56754 tmp.setNull();
56755 break;
56756 }
56757 tmp.setObject(*arg[sequenceIdx0].Value().Obj());
56758 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56759 aRv.Throw(NS_ERROR_UNEXPECTED);
56760 return;
56761 }
56762 break;
56763 } while (false);
56764 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
56765 JSPROP_ENUMERATE)) {
56766 aRv.Throw(NS_ERROR_UNEXPECTED);
56767 return;
56768 }
56769 }
56770 }
56771 argv[0].setObject(*returnArray);
56772 break;
56773 } while (false);
56774
56775 JS::Rooted<JS::Value> callable(cx);
56776 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56777 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56778 !InitIds(cx, atomsCache)) ||
56779 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableArrayBuffers_id, &callable)) {
56780 aRv.Throw(NS_ERROR_UNEXPECTED);
56781 return;
56782 }
56783 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56784 if (!JS::Call(cx, thisValue, callable,
56785 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56786 aRv.NoteJSContextException(cx);
56787 return;
56788 }
56789}
56790
56791void
56792TestJSImplInterfaceJSImpl::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56793{
56794 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56795 if (aRv.Failed()) {
56796 return;
56797 }
56798 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56798); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56798); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56799 BindingCallContext& cx = s.GetCallContext();
56800
56801 JS::Rooted<JS::Value> rval(cx);
56802 JS::RootedVector<JS::Value> argv(cx);
56803 if (!argv.resize(1)) {
56804 // That threw an exception on the JSContext, and our CallSetup will do
56805 // the right thing with that.
56806 return;
56807 }
56808 unsigned argc = 1;
56809
56810 do {
56811
56812 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
56813 if (!returnObj) {
56814 aRv.Throw(NS_ERROR_UNEXPECTED);
56815 return;
56816 }
56817 // Scope for 'tmp'
56818 {
56819 JS::Rooted<JS::Value> tmp(cx);
56820 for (auto& entry : arg.Entries()) {
56821 auto& recordValue0 = entry.mValue;
56822 // Control block to let us common up the JS_DefineUCProperty calls when there
56823 // are different ways to succeed at wrapping the value.
56824 do {
56825 tmp.setObject(*recordValue0.Obj());
56826 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56827 aRv.Throw(NS_ERROR_UNEXPECTED);
56828 return;
56829 }
56830 break;
56831 } while (false);
56832 if (!JS_DefineUCProperty(cx, returnObj,
56833 entry.mKey.BeginReading(),
56834 entry.mKey.Length(), tmp,
56835 JSPROP_ENUMERATE)) {
56836 aRv.Throw(NS_ERROR_UNEXPECTED);
56837 return;
56838 }
56839 }
56840 }
56841 argv[0].setObject(*returnObj);
56842 break;
56843 } while (false);
56844
56845 JS::Rooted<JS::Value> callable(cx);
56846 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56847 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56848 !InitIds(cx, atomsCache)) ||
56849 !GetCallableProperty(cx, atomsCache->passRecordOfArrayBuffers_id, &callable)) {
56850 aRv.Throw(NS_ERROR_UNEXPECTED);
56851 return;
56852 }
56853 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56854 if (!JS::Call(cx, thisValue, callable,
56855 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56856 aRv.NoteJSContextException(cx);
56857 return;
56858 }
56859}
56860
56861void
56862TestJSImplInterfaceJSImpl::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56863{
56864 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56865 if (aRv.Failed()) {
56866 return;
56867 }
56868 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56868); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56868); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56869 BindingCallContext& cx = s.GetCallContext();
56870
56871 JS::Rooted<JS::Value> rval(cx);
56872 JS::RootedVector<JS::Value> argv(cx);
56873 if (!argv.resize(1)) {
56874 // That threw an exception on the JSContext, and our CallSetup will do
56875 // the right thing with that.
56876 return;
56877 }
56878 unsigned argc = 1;
56879
56880 do {
56881
56882 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
56883 if (!returnObj) {
56884 aRv.Throw(NS_ERROR_UNEXPECTED);
56885 return;
56886 }
56887 // Scope for 'tmp'
56888 {
56889 JS::Rooted<JS::Value> tmp(cx);
56890 for (auto& entry : arg.Entries()) {
56891 auto& recordValue0 = entry.mValue;
56892 // Control block to let us common up the JS_DefineUCProperty calls when there
56893 // are different ways to succeed at wrapping the value.
56894 do {
56895 if (recordValue0.IsNull()) {
56896 tmp.setNull();
56897 break;
56898 }
56899 tmp.setObject(*recordValue0.Value().Obj());
56900 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56901 aRv.Throw(NS_ERROR_UNEXPECTED);
56902 return;
56903 }
56904 break;
56905 } while (false);
56906 if (!JS_DefineUCProperty(cx, returnObj,
56907 entry.mKey.BeginReading(),
56908 entry.mKey.Length(), tmp,
56909 JSPROP_ENUMERATE)) {
56910 aRv.Throw(NS_ERROR_UNEXPECTED);
56911 return;
56912 }
56913 }
56914 }
56915 argv[0].setObject(*returnObj);
56916 break;
56917 } while (false);
56918
56919 JS::Rooted<JS::Value> callable(cx);
56920 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56921 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56922 !InitIds(cx, atomsCache)) ||
56923 !GetCallableProperty(cx, atomsCache->passRecordOfNullableArrayBuffers_id, &callable)) {
56924 aRv.Throw(NS_ERROR_UNEXPECTED);
56925 return;
56926 }
56927 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56928 if (!JS::Call(cx, thisValue, callable,
56929 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56930 aRv.NoteJSContextException(cx);
56931 return;
56932 }
56933}
56934
56935void
56936TestJSImplInterfaceJSImpl::PassVariadicTypedArray(const nsTArray<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56937{
56938 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56939 if (aRv.Failed()) {
56940 return;
56941 }
56942 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56942); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56942); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56943 BindingCallContext& cx = s.GetCallContext();
56944
56945 JS::Rooted<JS::Value> rval(cx);
56946 JS::RootedVector<JS::Value> argv(cx);
56947 if (!argv.resize((1 - 1) + arg.Length())) {
56948 // That threw an exception on the JSContext, and our CallSetup will do
56949 // the right thing with that.
56950 return;
56951 }
56952 unsigned argc = (1 - 1) + arg.Length();
56953
56954 do {
56955 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
56956 argv[0 + idx].setObject(*arg[idx].Obj());
56957 if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) {
56958 aRv.Throw(NS_ERROR_UNEXPECTED);
56959 return;
56960 }
56961 continue;
56962 }
56963 break;
56964 } while (false);
56965
56966 JS::Rooted<JS::Value> callable(cx);
56967 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56968 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56969 !InitIds(cx, atomsCache)) ||
56970 !GetCallableProperty(cx, atomsCache->passVariadicTypedArray_id, &callable)) {
56971 aRv.Throw(NS_ERROR_UNEXPECTED);
56972 return;
56973 }
56974 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56975 if (!JS::Call(cx, thisValue, callable,
56976 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56977 aRv.NoteJSContextException(cx);
56978 return;
56979 }
56980}
56981
56982void
56983TestJSImplInterfaceJSImpl::PassVariadicNullableTypedArray(const nsTArray<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56984{
56985 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56986 if (aRv.Failed()) {
56987 return;
56988 }
56989 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56989); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 56989); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
56990 BindingCallContext& cx = s.GetCallContext();
56991
56992 JS::Rooted<JS::Value> rval(cx);
56993 JS::RootedVector<JS::Value> argv(cx);
56994 if (!argv.resize((1 - 1) + arg.Length())) {
56995 // That threw an exception on the JSContext, and our CallSetup will do
56996 // the right thing with that.
56997 return;
56998 }
56999 unsigned argc = (1 - 1) + arg.Length();
57000
57001 do {
57002 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
57003 if (arg[idx].IsNull()) {
57004 argv[0 + idx].setNull();
57005 continue;
57006 }
57007 argv[0 + idx].setObject(*arg[idx].Value().Obj());
57008 if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) {
57009 aRv.Throw(NS_ERROR_UNEXPECTED);
57010 return;
57011 }
57012 continue;
57013 }
57014 break;
57015 } while (false);
57016
57017 JS::Rooted<JS::Value> callable(cx);
57018 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57019 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57020 !InitIds(cx, atomsCache)) ||
57021 !GetCallableProperty(cx, atomsCache->passVariadicNullableTypedArray_id, &callable)) {
57022 aRv.Throw(NS_ERROR_UNEXPECTED);
57023 return;
57024 }
57025 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57026 if (!JS::Call(cx, thisValue, callable,
57027 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57028 aRv.NoteJSContextException(cx);
57029 return;
57030 }
57031}
57032
57033void
57034TestJSImplInterfaceJSImpl::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
57035{
57036 CallSetup s(this, aRv, "TestJSImplInterface.receiveUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57037 if (aRv.Failed()) {
57038 return;
57039 }
57040 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57040); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57040); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57041 BindingCallContext& cx = s.GetCallContext();
57042
57043 JS::Rooted<JS::Value> rval(cx);
57044
57045 JS::Rooted<JS::Value> callable(cx);
57046 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57047 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57048 !InitIds(cx, atomsCache)) ||
57049 !GetCallableProperty(cx, atomsCache->receiveUint8Array_id, &callable)) {
57050 aRv.Throw(NS_ERROR_UNEXPECTED);
57051 return;
57052 }
57053 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57054 if (!JS::Call(cx, thisValue, callable,
57055 JS::HandleValueArray::empty(), &rval)) {
57056 aRv.NoteJSContextException(cx);
57057 return;
57058 }
57059 RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx);
57060 if (rval.isObject()) {
57061 if (!rvalDecl.Init(&rval.toObject())) {
57062 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveUint8Array", "Uint8Array");
57063 aRv.Throw(NS_ERROR_UNEXPECTED);
57064 return;
57065 }
57066 if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) {
57067 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.receiveUint8Array");
57068 aRv.Throw(NS_ERROR_UNEXPECTED);
57069 return;
57070 }
57071 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
57072 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.receiveUint8Array");
57073 aRv.Throw(NS_ERROR_UNEXPECTED);
57074 return;
57075 }
57076 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
57077 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.receiveUint8Array");
57078 aRv.Throw(NS_ERROR_UNEXPECTED);
57079 return;
57080 }
57081 if (JS::IsImmutableArrayBufferView(rvalDecl.Obj())) {
57082 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.receiveUint8Array");
57083 aRv.Throw(NS_ERROR_UNEXPECTED);
57084 return;
57085 }
57086 } else {
57087 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveUint8Array");
57088 aRv.Throw(NS_ERROR_UNEXPECTED);
57089 return;
57090 }
57091 aRetVal.set(rvalDecl.Obj());
57092}
57093
57094void
57095TestJSImplInterfaceJSImpl::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57096{
57097 CallSetup s(this, aRv, "TestJSImplInterface.passString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57098 if (aRv.Failed()) {
57099 return;
57100 }
57101 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57101); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57101); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57102 BindingCallContext& cx = s.GetCallContext();
57103
57104 JS::Rooted<JS::Value> rval(cx);
57105 JS::RootedVector<JS::Value> argv(cx);
57106 if (!argv.resize(1)) {
57107 // That threw an exception on the JSContext, and our CallSetup will do
57108 // the right thing with that.
57109 return;
57110 }
57111 unsigned argc = 1;
57112
57113 do {
57114 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
57115 aRv.Throw(NS_ERROR_UNEXPECTED);
57116 return;
57117 }
57118 break;
57119 } while (false);
57120
57121 JS::Rooted<JS::Value> callable(cx);
57122 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57123 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57124 !InitIds(cx, atomsCache)) ||
57125 !GetCallableProperty(cx, atomsCache->passString_id, &callable)) {
57126 aRv.Throw(NS_ERROR_UNEXPECTED);
57127 return;
57128 }
57129 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57130 if (!JS::Call(cx, thisValue, callable,
57131 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57132 aRv.NoteJSContextException(cx);
57133 return;
57134 }
57135}
57136
57137void
57138TestJSImplInterfaceJSImpl::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57139{
57140 CallSetup s(this, aRv, "TestJSImplInterface.passNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57141 if (aRv.Failed()) {
57142 return;
57143 }
57144 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57144); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57144); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57145 BindingCallContext& cx = s.GetCallContext();
57146
57147 JS::Rooted<JS::Value> rval(cx);
57148 JS::RootedVector<JS::Value> argv(cx);
57149 if (!argv.resize(1)) {
57150 // That threw an exception on the JSContext, and our CallSetup will do
57151 // the right thing with that.
57152 return;
57153 }
57154 unsigned argc = 1;
57155
57156 do {
57157 if (!xpc::StringToJsval(cx, arg, argv[0])) {
57158 aRv.Throw(NS_ERROR_UNEXPECTED);
57159 return;
57160 }
57161 break;
57162 } while (false);
57163
57164 JS::Rooted<JS::Value> callable(cx);
57165 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57166 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57167 !InitIds(cx, atomsCache)) ||
57168 !GetCallableProperty(cx, atomsCache->passNullableString_id, &callable)) {
57169 aRv.Throw(NS_ERROR_UNEXPECTED);
57170 return;
57171 }
57172 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57173 if (!JS::Call(cx, thisValue, callable,
57174 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57175 aRv.NoteJSContextException(cx);
57176 return;
57177 }
57178}
57179
57180void
57181TestJSImplInterfaceJSImpl::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57182{
57183 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57184 if (aRv.Failed()) {
57185 return;
57186 }
57187 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57187); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57187); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57188 BindingCallContext& cx = s.GetCallContext();
57189
57190 JS::Rooted<JS::Value> rval(cx);
57191 JS::RootedVector<JS::Value> argv(cx);
57192 if (!argv.resize(1)) {
57193 // That threw an exception on the JSContext, and our CallSetup will do
57194 // the right thing with that.
57195 return;
57196 }
57197 unsigned argc = 1;
57198
57199 do {
57200 if (arg.WasPassed()) {
57201 if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) {
57202 aRv.Throw(NS_ERROR_UNEXPECTED);
57203 return;
57204 }
57205 break;
57206 } else if (argc == 1) {
57207 // This is our current trailing argument; reduce argc
57208 --argc;
57209 } else {
57210 argv[0].setUndefined();
57211 }
57212 } while (false);
57213
57214 JS::Rooted<JS::Value> callable(cx);
57215 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57216 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57217 !InitIds(cx, atomsCache)) ||
57218 !GetCallableProperty(cx, atomsCache->passOptionalString_id, &callable)) {
57219 aRv.Throw(NS_ERROR_UNEXPECTED);
57220 return;
57221 }
57222 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57223 if (!JS::Call(cx, thisValue, callable,
57224 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57225 aRv.NoteJSContextException(cx);
57226 return;
57227 }
57228}
57229
57230void
57231TestJSImplInterfaceJSImpl::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57232{
57233 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57234 if (aRv.Failed()) {
57235 return;
57236 }
57237 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57237); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57237); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57238 BindingCallContext& cx = s.GetCallContext();
57239
57240 JS::Rooted<JS::Value> rval(cx);
57241 JS::RootedVector<JS::Value> argv(cx);
57242 if (!argv.resize(1)) {
57243 // That threw an exception on the JSContext, and our CallSetup will do
57244 // the right thing with that.
57245 return;
57246 }
57247 unsigned argc = 1;
57248
57249 do {
57250 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
57251 aRv.Throw(NS_ERROR_UNEXPECTED);
57252 return;
57253 }
57254 break;
57255 } while (false);
57256
57257 JS::Rooted<JS::Value> callable(cx);
57258 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57259 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57260 !InitIds(cx, atomsCache)) ||
57261 !GetCallableProperty(cx, atomsCache->passOptionalStringWithDefaultValue_id, &callable)) {
57262 aRv.Throw(NS_ERROR_UNEXPECTED);
57263 return;
57264 }
57265 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57266 if (!JS::Call(cx, thisValue, callable,
57267 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57268 aRv.NoteJSContextException(cx);
57269 return;
57270 }
57271}
57272
57273void
57274TestJSImplInterfaceJSImpl::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57275{
57276 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57277 if (aRv.Failed()) {
57278 return;
57279 }
57280 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57280); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57280); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57281 BindingCallContext& cx = s.GetCallContext();
57282
57283 JS::Rooted<JS::Value> rval(cx);
57284 JS::RootedVector<JS::Value> argv(cx);
57285 if (!argv.resize(1)) {
57286 // That threw an exception on the JSContext, and our CallSetup will do
57287 // the right thing with that.
57288 return;
57289 }
57290 unsigned argc = 1;
57291
57292 do {
57293 if (arg.WasPassed()) {
57294 if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) {
57295 aRv.Throw(NS_ERROR_UNEXPECTED);
57296 return;
57297 }
57298 break;
57299 } else if (argc == 1) {
57300 // This is our current trailing argument; reduce argc
57301 --argc;
57302 } else {
57303 argv[0].setUndefined();
57304 }
57305 } while (false);
57306
57307 JS::Rooted<JS::Value> callable(cx);
57308 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57309 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57310 !InitIds(cx, atomsCache)) ||
57311 !GetCallableProperty(cx, atomsCache->passOptionalNullableString_id, &callable)) {
57312 aRv.Throw(NS_ERROR_UNEXPECTED);
57313 return;
57314 }
57315 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57316 if (!JS::Call(cx, thisValue, callable,
57317 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57318 aRv.NoteJSContextException(cx);
57319 return;
57320 }
57321}
57322
57323void
57324TestJSImplInterfaceJSImpl::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57325{
57326 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57327 if (aRv.Failed()) {
57328 return;
57329 }
57330 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57330); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57330); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57331 BindingCallContext& cx = s.GetCallContext();
57332
57333 JS::Rooted<JS::Value> rval(cx);
57334 JS::RootedVector<JS::Value> argv(cx);
57335 if (!argv.resize(1)) {
57336 // That threw an exception on the JSContext, and our CallSetup will do
57337 // the right thing with that.
57338 return;
57339 }
57340 unsigned argc = 1;
57341
57342 do {
57343 if (!xpc::StringToJsval(cx, arg, argv[0])) {
57344 aRv.Throw(NS_ERROR_UNEXPECTED);
57345 return;
57346 }
57347 break;
57348 } while (false);
57349
57350 JS::Rooted<JS::Value> callable(cx);
57351 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57352 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57353 !InitIds(cx, atomsCache)) ||
57354 !GetCallableProperty(cx, atomsCache->passOptionalNullableStringWithDefaultValue_id, &callable)) {
57355 aRv.Throw(NS_ERROR_UNEXPECTED);
57356 return;
57357 }
57358 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57359 if (!JS::Call(cx, thisValue, callable,
57360 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57361 aRv.NoteJSContextException(cx);
57362 return;
57363 }
57364}
57365
57366void
57367TestJSImplInterfaceJSImpl::PassVariadicString(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57368{
57369 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57370 if (aRv.Failed()) {
57371 return;
57372 }
57373 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57373); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57373); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57374 BindingCallContext& cx = s.GetCallContext();
57375
57376 JS::Rooted<JS::Value> rval(cx);
57377 JS::RootedVector<JS::Value> argv(cx);
57378 if (!argv.resize((1 - 1) + arg.Length())) {
57379 // That threw an exception on the JSContext, and our CallSetup will do
57380 // the right thing with that.
57381 return;
57382 }
57383 unsigned argc = (1 - 1) + arg.Length();
57384
57385 do {
57386 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
57387 if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) {
57388 aRv.Throw(NS_ERROR_UNEXPECTED);
57389 return;
57390 }
57391 continue;
57392 }
57393 break;
57394 } while (false);
57395
57396 JS::Rooted<JS::Value> callable(cx);
57397 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57398 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57399 !InitIds(cx, atomsCache)) ||
57400 !GetCallableProperty(cx, atomsCache->passVariadicString_id, &callable)) {
57401 aRv.Throw(NS_ERROR_UNEXPECTED);
57402 return;
57403 }
57404 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57405 if (!JS::Call(cx, thisValue, callable,
57406 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57407 aRv.NoteJSContextException(cx);
57408 return;
57409 }
57410}
57411
57412void
57413TestJSImplInterfaceJSImpl::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57414{
57415 CallSetup s(this, aRv, "TestJSImplInterface.passByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57416 if (aRv.Failed()) {
57417 return;
57418 }
57419 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57419); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57420 BindingCallContext& cx = s.GetCallContext();
57421
57422 JS::Rooted<JS::Value> rval(cx);
57423 JS::RootedVector<JS::Value> argv(cx);
57424 if (!argv.resize(1)) {
57425 // That threw an exception on the JSContext, and our CallSetup will do
57426 // the right thing with that.
57427 return;
57428 }
57429 unsigned argc = 1;
57430
57431 do {
57432 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
57433 aRv.Throw(NS_ERROR_UNEXPECTED);
57434 return;
57435 }
57436 break;
57437 } while (false);
57438
57439 JS::Rooted<JS::Value> callable(cx);
57440 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57441 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57442 !InitIds(cx, atomsCache)) ||
57443 !GetCallableProperty(cx, atomsCache->passByteString_id, &callable)) {
57444 aRv.Throw(NS_ERROR_UNEXPECTED);
57445 return;
57446 }
57447 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57448 if (!JS::Call(cx, thisValue, callable,
57449 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57450 aRv.NoteJSContextException(cx);
57451 return;
57452 }
57453}
57454
57455void
57456TestJSImplInterfaceJSImpl::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57457{
57458 CallSetup s(this, aRv, "TestJSImplInterface.passNullableByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57459 if (aRv.Failed()) {
57460 return;
57461 }
57462 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57462); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57462); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57463 BindingCallContext& cx = s.GetCallContext();
57464
57465 JS::Rooted<JS::Value> rval(cx);
57466 JS::RootedVector<JS::Value> argv(cx);
57467 if (!argv.resize(1)) {
57468 // That threw an exception on the JSContext, and our CallSetup will do
57469 // the right thing with that.
57470 return;
57471 }
57472 unsigned argc = 1;
57473
57474 do {
57475 if (!ByteStringToJsval(cx, arg, argv[0])) {
57476 aRv.Throw(NS_ERROR_UNEXPECTED);
57477 return;
57478 }
57479 break;
57480 } while (false);
57481
57482 JS::Rooted<JS::Value> callable(cx);
57483 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57484 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57485 !InitIds(cx, atomsCache)) ||
57486 !GetCallableProperty(cx, atomsCache->passNullableByteString_id, &callable)) {
57487 aRv.Throw(NS_ERROR_UNEXPECTED);
57488 return;
57489 }
57490 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57491 if (!JS::Call(cx, thisValue, callable,
57492 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57493 aRv.NoteJSContextException(cx);
57494 return;
57495 }
57496}
57497
57498void
57499TestJSImplInterfaceJSImpl::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57500{
57501 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57502 if (aRv.Failed()) {
57503 return;
57504 }
57505 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57505); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57505); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57506 BindingCallContext& cx = s.GetCallContext();
57507
57508 JS::Rooted<JS::Value> rval(cx);
57509 JS::RootedVector<JS::Value> argv(cx);
57510 if (!argv.resize(1)) {
57511 // That threw an exception on the JSContext, and our CallSetup will do
57512 // the right thing with that.
57513 return;
57514 }
57515 unsigned argc = 1;
57516
57517 do {
57518 if (arg.WasPassed()) {
57519 if (!NonVoidByteStringToJsval(cx, arg.Value(), argv[0])) {
57520 aRv.Throw(NS_ERROR_UNEXPECTED);
57521 return;
57522 }
57523 break;
57524 } else if (argc == 1) {
57525 // This is our current trailing argument; reduce argc
57526 --argc;
57527 } else {
57528 argv[0].setUndefined();
57529 }
57530 } while (false);
57531
57532 JS::Rooted<JS::Value> callable(cx);
57533 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57534 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57535 !InitIds(cx, atomsCache)) ||
57536 !GetCallableProperty(cx, atomsCache->passOptionalByteString_id, &callable)) {
57537 aRv.Throw(NS_ERROR_UNEXPECTED);
57538 return;
57539 }
57540 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57541 if (!JS::Call(cx, thisValue, callable,
57542 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57543 aRv.NoteJSContextException(cx);
57544 return;
57545 }
57546}
57547
57548void
57549TestJSImplInterfaceJSImpl::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57550{
57551 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57552 if (aRv.Failed()) {
57553 return;
57554 }
57555 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57555); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57555); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57556 BindingCallContext& cx = s.GetCallContext();
57557
57558 JS::Rooted<JS::Value> rval(cx);
57559 JS::RootedVector<JS::Value> argv(cx);
57560 if (!argv.resize(1)) {
57561 // That threw an exception on the JSContext, and our CallSetup will do
57562 // the right thing with that.
57563 return;
57564 }
57565 unsigned argc = 1;
57566
57567 do {
57568 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
57569 aRv.Throw(NS_ERROR_UNEXPECTED);
57570 return;
57571 }
57572 break;
57573 } while (false);
57574
57575 JS::Rooted<JS::Value> callable(cx);
57576 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57577 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57578 !InitIds(cx, atomsCache)) ||
57579 !GetCallableProperty(cx, atomsCache->passOptionalByteStringWithDefaultValue_id, &callable)) {
57580 aRv.Throw(NS_ERROR_UNEXPECTED);
57581 return;
57582 }
57583 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57584 if (!JS::Call(cx, thisValue, callable,
57585 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57586 aRv.NoteJSContextException(cx);
57587 return;
57588 }
57589}
57590
57591void
57592TestJSImplInterfaceJSImpl::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57593{
57594 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57595 if (aRv.Failed()) {
57596 return;
57597 }
57598 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57598); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57598); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57599 BindingCallContext& cx = s.GetCallContext();
57600
57601 JS::Rooted<JS::Value> rval(cx);
57602 JS::RootedVector<JS::Value> argv(cx);
57603 if (!argv.resize(1)) {
57604 // That threw an exception on the JSContext, and our CallSetup will do
57605 // the right thing with that.
57606 return;
57607 }
57608 unsigned argc = 1;
57609
57610 do {
57611 if (arg.WasPassed()) {
57612 if (!ByteStringToJsval(cx, arg.Value(), argv[0])) {
57613 aRv.Throw(NS_ERROR_UNEXPECTED);
57614 return;
57615 }
57616 break;
57617 } else if (argc == 1) {
57618 // This is our current trailing argument; reduce argc
57619 --argc;
57620 } else {
57621 argv[0].setUndefined();
57622 }
57623 } while (false);
57624
57625 JS::Rooted<JS::Value> callable(cx);
57626 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57627 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57628 !InitIds(cx, atomsCache)) ||
57629 !GetCallableProperty(cx, atomsCache->passOptionalNullableByteString_id, &callable)) {
57630 aRv.Throw(NS_ERROR_UNEXPECTED);
57631 return;
57632 }
57633 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57634 if (!JS::Call(cx, thisValue, callable,
57635 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57636 aRv.NoteJSContextException(cx);
57637 return;
57638 }
57639}
57640
57641void
57642TestJSImplInterfaceJSImpl::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57643{
57644 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57645 if (aRv.Failed()) {
57646 return;
57647 }
57648 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57648); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57648); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57649 BindingCallContext& cx = s.GetCallContext();
57650
57651 JS::Rooted<JS::Value> rval(cx);
57652 JS::RootedVector<JS::Value> argv(cx);
57653 if (!argv.resize(1)) {
57654 // That threw an exception on the JSContext, and our CallSetup will do
57655 // the right thing with that.
57656 return;
57657 }
57658 unsigned argc = 1;
57659
57660 do {
57661 if (!ByteStringToJsval(cx, arg, argv[0])) {
57662 aRv.Throw(NS_ERROR_UNEXPECTED);
57663 return;
57664 }
57665 break;
57666 } while (false);
57667
57668 JS::Rooted<JS::Value> callable(cx);
57669 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57670 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57671 !InitIds(cx, atomsCache)) ||
57672 !GetCallableProperty(cx, atomsCache->passOptionalNullableByteStringWithDefaultValue_id, &callable)) {
57673 aRv.Throw(NS_ERROR_UNEXPECTED);
57674 return;
57675 }
57676 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57677 if (!JS::Call(cx, thisValue, callable,
57678 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57679 aRv.NoteJSContextException(cx);
57680 return;
57681 }
57682}
57683
57684void
57685TestJSImplInterfaceJSImpl::PassVariadicByteString(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57686{
57687 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57688 if (aRv.Failed()) {
57689 return;
57690 }
57691 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57691); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57691); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57692 BindingCallContext& cx = s.GetCallContext();
57693
57694 JS::Rooted<JS::Value> rval(cx);
57695 JS::RootedVector<JS::Value> argv(cx);
57696 if (!argv.resize((1 - 1) + arg.Length())) {
57697 // That threw an exception on the JSContext, and our CallSetup will do
57698 // the right thing with that.
57699 return;
57700 }
57701 unsigned argc = (1 - 1) + arg.Length();
57702
57703 do {
57704 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
57705 if (!NonVoidByteStringToJsval(cx, arg[idx], argv[0 + idx])) {
57706 aRv.Throw(NS_ERROR_UNEXPECTED);
57707 return;
57708 }
57709 continue;
57710 }
57711 break;
57712 } while (false);
57713
57714 JS::Rooted<JS::Value> callable(cx);
57715 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57716 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57717 !InitIds(cx, atomsCache)) ||
57718 !GetCallableProperty(cx, atomsCache->passVariadicByteString_id, &callable)) {
57719 aRv.Throw(NS_ERROR_UNEXPECTED);
57720 return;
57721 }
57722 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57723 if (!JS::Call(cx, thisValue, callable,
57724 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57725 aRv.NoteJSContextException(cx);
57726 return;
57727 }
57728}
57729
57730void
57731TestJSImplInterfaceJSImpl::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
57732{
57733 CallSetup s(this, aRv, "TestJSImplInterface.passUnionByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57734 if (aRv.Failed()) {
57735 return;
57736 }
57737 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57737); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57737); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57738 BindingCallContext& cx = s.GetCallContext();
57739
57740 JS::Rooted<JS::Value> rval(cx);
57741 JS::RootedVector<JS::Value> argv(cx);
57742 if (!argv.resize(1)) {
57743 // That threw an exception on the JSContext, and our CallSetup will do
57744 // the right thing with that.
57745 return;
57746 }
57747 unsigned argc = 1;
57748
57749 do {
57750 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57751 if (!arg.ToJSVal(cx, callbackObj, 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->passUnionByteString_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::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57776{
57777 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteString", 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 { MOZ_CrashSequence
(__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 (arg.WasPassed()) {
57795 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57796 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
57797 aRv.Throw(NS_ERROR_UNEXPECTED);
57798 return;
57799 }
57800 break;
57801 } else if (argc == 1) {
57802 // This is our current trailing argument; reduce argc
57803 --argc;
57804 } else {
57805 argv[0].setUndefined();
57806 }
57807 } while (false);
57808
57809 JS::Rooted<JS::Value> callable(cx);
57810 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57811 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57812 !InitIds(cx, atomsCache)) ||
57813 !GetCallableProperty(cx, atomsCache->passOptionalUnionByteString_id, &callable)) {
57814 aRv.Throw(NS_ERROR_UNEXPECTED);
57815 return;
57816 }
57817 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57818 if (!JS::Call(cx, thisValue, callable,
57819 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57820 aRv.NoteJSContextException(cx);
57821 return;
57822 }
57823}
57824
57825void
57826TestJSImplInterfaceJSImpl::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
57827{
57828 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57829 if (aRv.Failed()) {
57830 return;
57831 }
57832 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57832); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57832); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57833 BindingCallContext& cx = s.GetCallContext();
57834
57835 JS::Rooted<JS::Value> rval(cx);
57836 JS::RootedVector<JS::Value> argv(cx);
57837 if (!argv.resize(1)) {
57838 // That threw an exception on the JSContext, and our CallSetup will do
57839 // the right thing with that.
57840 return;
57841 }
57842 unsigned argc = 1;
57843
57844 do {
57845 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57846 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
57847 aRv.Throw(NS_ERROR_UNEXPECTED);
57848 return;
57849 }
57850 break;
57851 } while (false);
57852
57853 JS::Rooted<JS::Value> callable(cx);
57854 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57855 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57856 !InitIds(cx, atomsCache)) ||
57857 !GetCallableProperty(cx, atomsCache->passOptionalUnionByteStringWithDefaultValue_id, &callable)) {
57858 aRv.Throw(NS_ERROR_UNEXPECTED);
57859 return;
57860 }
57861 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57862 if (!JS::Call(cx, thisValue, callable,
57863 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57864 aRv.NoteJSContextException(cx);
57865 return;
57866 }
57867}
57868
57869void
57870TestJSImplInterfaceJSImpl::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57871{
57872 CallSetup s(this, aRv, "TestJSImplInterface.passUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57873 if (aRv.Failed()) {
57874 return;
57875 }
57876 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57876); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57876); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57877 BindingCallContext& cx = s.GetCallContext();
57878
57879 JS::Rooted<JS::Value> rval(cx);
57880 JS::RootedVector<JS::Value> argv(cx);
57881 if (!argv.resize(1)) {
57882 // That threw an exception on the JSContext, and our CallSetup will do
57883 // the right thing with that.
57884 return;
57885 }
57886 unsigned argc = 1;
57887
57888 do {
57889 if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) {
57890 aRv.Throw(NS_ERROR_UNEXPECTED);
57891 return;
57892 }
57893 break;
57894 } while (false);
57895
57896 JS::Rooted<JS::Value> callable(cx);
57897 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57898 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57899 !InitIds(cx, atomsCache)) ||
57900 !GetCallableProperty(cx, atomsCache->passUTF8String_id, &callable)) {
57901 aRv.Throw(NS_ERROR_UNEXPECTED);
57902 return;
57903 }
57904 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57905 if (!JS::Call(cx, thisValue, callable,
57906 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57907 aRv.NoteJSContextException(cx);
57908 return;
57909 }
57910}
57911
57912void
57913TestJSImplInterfaceJSImpl::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57914{
57915 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57916 if (aRv.Failed()) {
57917 return;
57918 }
57919 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57919); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57919); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57920 BindingCallContext& cx = s.GetCallContext();
57921
57922 JS::Rooted<JS::Value> rval(cx);
57923 JS::RootedVector<JS::Value> argv(cx);
57924 if (!argv.resize(1)) {
57925 // That threw an exception on the JSContext, and our CallSetup will do
57926 // the right thing with that.
57927 return;
57928 }
57929 unsigned argc = 1;
57930
57931 do {
57932 if (!UTF8StringToJsval(cx, arg, argv[0])) {
57933 aRv.Throw(NS_ERROR_UNEXPECTED);
57934 return;
57935 }
57936 break;
57937 } while (false);
57938
57939 JS::Rooted<JS::Value> callable(cx);
57940 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57941 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57942 !InitIds(cx, atomsCache)) ||
57943 !GetCallableProperty(cx, atomsCache->passNullableUTF8String_id, &callable)) {
57944 aRv.Throw(NS_ERROR_UNEXPECTED);
57945 return;
57946 }
57947 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57948 if (!JS::Call(cx, thisValue, callable,
57949 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57950 aRv.NoteJSContextException(cx);
57951 return;
57952 }
57953}
57954
57955void
57956TestJSImplInterfaceJSImpl::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57957{
57958 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57959 if (aRv.Failed()) {
57960 return;
57961 }
57962 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57962); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 57962); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
57963 BindingCallContext& cx = s.GetCallContext();
57964
57965 JS::Rooted<JS::Value> rval(cx);
57966 JS::RootedVector<JS::Value> argv(cx);
57967 if (!argv.resize(1)) {
57968 // That threw an exception on the JSContext, and our CallSetup will do
57969 // the right thing with that.
57970 return;
57971 }
57972 unsigned argc = 1;
57973
57974 do {
57975 if (arg.WasPassed()) {
57976 if (!NonVoidUTF8StringToJsval(cx, arg.Value(), argv[0])) {
57977 aRv.Throw(NS_ERROR_UNEXPECTED);
57978 return;
57979 }
57980 break;
57981 } else if (argc == 1) {
57982 // This is our current trailing argument; reduce argc
57983 --argc;
57984 } else {
57985 argv[0].setUndefined();
57986 }
57987 } while (false);
57988
57989 JS::Rooted<JS::Value> callable(cx);
57990 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57991 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57992 !InitIds(cx, atomsCache)) ||
57993 !GetCallableProperty(cx, atomsCache->passOptionalUTF8String_id, &callable)) {
57994 aRv.Throw(NS_ERROR_UNEXPECTED);
57995 return;
57996 }
57997 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57998 if (!JS::Call(cx, thisValue, callable,
57999 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58000 aRv.NoteJSContextException(cx);
58001 return;
58002 }
58003}
58004
58005void
58006TestJSImplInterfaceJSImpl::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58007{
58008 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58009 if (aRv.Failed()) {
58010 return;
58011 }
58012 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58012); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58012); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58013 BindingCallContext& cx = s.GetCallContext();
58014
58015 JS::Rooted<JS::Value> rval(cx);
58016 JS::RootedVector<JS::Value> argv(cx);
58017 if (!argv.resize(1)) {
58018 // That threw an exception on the JSContext, and our CallSetup will do
58019 // the right thing with that.
58020 return;
58021 }
58022 unsigned argc = 1;
58023
58024 do {
58025 if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) {
58026 aRv.Throw(NS_ERROR_UNEXPECTED);
58027 return;
58028 }
58029 break;
58030 } while (false);
58031
58032 JS::Rooted<JS::Value> callable(cx);
58033 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58034 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58035 !InitIds(cx, atomsCache)) ||
58036 !GetCallableProperty(cx, atomsCache->passOptionalUTF8StringWithDefaultValue_id, &callable)) {
58037 aRv.Throw(NS_ERROR_UNEXPECTED);
58038 return;
58039 }
58040 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58041 if (!JS::Call(cx, thisValue, callable,
58042 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58043 aRv.NoteJSContextException(cx);
58044 return;
58045 }
58046}
58047
58048void
58049TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58050{
58051 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58052 if (aRv.Failed()) {
58053 return;
58054 }
58055 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58055); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58055); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58056 BindingCallContext& cx = s.GetCallContext();
58057
58058 JS::Rooted<JS::Value> rval(cx);
58059 JS::RootedVector<JS::Value> argv(cx);
58060 if (!argv.resize(1)) {
58061 // That threw an exception on the JSContext, and our CallSetup will do
58062 // the right thing with that.
58063 return;
58064 }
58065 unsigned argc = 1;
58066
58067 do {
58068 if (arg.WasPassed()) {
58069 if (!UTF8StringToJsval(cx, arg.Value(), argv[0])) {
58070 aRv.Throw(NS_ERROR_UNEXPECTED);
58071 return;
58072 }
58073 break;
58074 } else if (argc == 1) {
58075 // This is our current trailing argument; reduce argc
58076 --argc;
58077 } else {
58078 argv[0].setUndefined();
58079 }
58080 } while (false);
58081
58082 JS::Rooted<JS::Value> callable(cx);
58083 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58084 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58085 !InitIds(cx, atomsCache)) ||
58086 !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8String_id, &callable)) {
58087 aRv.Throw(NS_ERROR_UNEXPECTED);
58088 return;
58089 }
58090 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58091 if (!JS::Call(cx, thisValue, callable,
58092 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58093 aRv.NoteJSContextException(cx);
58094 return;
58095 }
58096}
58097
58098void
58099TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58100{
58101 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58102 if (aRv.Failed()) {
58103 return;
58104 }
58105 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58105); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58105); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58106 BindingCallContext& cx = s.GetCallContext();
58107
58108 JS::Rooted<JS::Value> rval(cx);
58109 JS::RootedVector<JS::Value> argv(cx);
58110 if (!argv.resize(1)) {
58111 // That threw an exception on the JSContext, and our CallSetup will do
58112 // the right thing with that.
58113 return;
58114 }
58115 unsigned argc = 1;
58116
58117 do {
58118 if (!UTF8StringToJsval(cx, arg, argv[0])) {
58119 aRv.Throw(NS_ERROR_UNEXPECTED);
58120 return;
58121 }
58122 break;
58123 } while (false);
58124
58125 JS::Rooted<JS::Value> callable(cx);
58126 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58127 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58128 !InitIds(cx, atomsCache)) ||
58129 !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id, &callable)) {
58130 aRv.Throw(NS_ERROR_UNEXPECTED);
58131 return;
58132 }
58133 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58134 if (!JS::Call(cx, thisValue, callable,
58135 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58136 aRv.NoteJSContextException(cx);
58137 return;
58138 }
58139}
58140
58141void
58142TestJSImplInterfaceJSImpl::PassVariadicUTF8String(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58143{
58144 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58145 if (aRv.Failed()) {
58146 return;
58147 }
58148 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58148); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58148); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58149 BindingCallContext& cx = s.GetCallContext();
58150
58151 JS::Rooted<JS::Value> rval(cx);
58152 JS::RootedVector<JS::Value> argv(cx);
58153 if (!argv.resize((1 - 1) + arg.Length())) {
58154 // That threw an exception on the JSContext, and our CallSetup will do
58155 // the right thing with that.
58156 return;
58157 }
58158 unsigned argc = (1 - 1) + arg.Length();
58159
58160 do {
58161 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
58162 if (!NonVoidUTF8StringToJsval(cx, arg[idx], argv[0 + idx])) {
58163 aRv.Throw(NS_ERROR_UNEXPECTED);
58164 return;
58165 }
58166 continue;
58167 }
58168 break;
58169 } while (false);
58170
58171 JS::Rooted<JS::Value> callable(cx);
58172 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58173 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58174 !InitIds(cx, atomsCache)) ||
58175 !GetCallableProperty(cx, atomsCache->passVariadicUTF8String_id, &callable)) {
58176 aRv.Throw(NS_ERROR_UNEXPECTED);
58177 return;
58178 }
58179 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58180 if (!JS::Call(cx, thisValue, callable,
58181 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58182 aRv.NoteJSContextException(cx);
58183 return;
58184 }
58185}
58186
58187void
58188TestJSImplInterfaceJSImpl::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
58189{
58190 CallSetup s(this, aRv, "TestJSImplInterface.passUnionUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58191 if (aRv.Failed()) {
58192 return;
58193 }
58194 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58194); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58194); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58195 BindingCallContext& cx = s.GetCallContext();
58196
58197 JS::Rooted<JS::Value> rval(cx);
58198 JS::RootedVector<JS::Value> argv(cx);
58199 if (!argv.resize(1)) {
58200 // That threw an exception on the JSContext, and our CallSetup will do
58201 // the right thing with that.
58202 return;
58203 }
58204 unsigned argc = 1;
58205
58206 do {
58207 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58208 if (!arg.ToJSVal(cx, callbackObj, 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->passUnionUTF8String_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::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58233{
58234 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8String", 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 { MOZ_CrashSequence
(__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 (arg.WasPassed()) {
58252 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58253 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
58254 aRv.Throw(NS_ERROR_UNEXPECTED);
58255 return;
58256 }
58257 break;
58258 } else if (argc == 1) {
58259 // This is our current trailing argument; reduce argc
58260 --argc;
58261 } else {
58262 argv[0].setUndefined();
58263 }
58264 } while (false);
58265
58266 JS::Rooted<JS::Value> callable(cx);
58267 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58268 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58269 !InitIds(cx, atomsCache)) ||
58270 !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8String_id, &callable)) {
58271 aRv.Throw(NS_ERROR_UNEXPECTED);
58272 return;
58273 }
58274 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58275 if (!JS::Call(cx, thisValue, callable,
58276 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58277 aRv.NoteJSContextException(cx);
58278 return;
58279 }
58280}
58281
58282void
58283TestJSImplInterfaceJSImpl::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
58284{
58285 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58286 if (aRv.Failed()) {
58287 return;
58288 }
58289 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58289); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58289); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58290 BindingCallContext& cx = s.GetCallContext();
58291
58292 JS::Rooted<JS::Value> rval(cx);
58293 JS::RootedVector<JS::Value> argv(cx);
58294 if (!argv.resize(1)) {
58295 // That threw an exception on the JSContext, and our CallSetup will do
58296 // the right thing with that.
58297 return;
58298 }
58299 unsigned argc = 1;
58300
58301 do {
58302 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58303 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
58304 aRv.Throw(NS_ERROR_UNEXPECTED);
58305 return;
58306 }
58307 break;
58308 } while (false);
58309
58310 JS::Rooted<JS::Value> callable(cx);
58311 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58312 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58313 !InitIds(cx, atomsCache)) ||
58314 !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id, &callable)) {
58315 aRv.Throw(NS_ERROR_UNEXPECTED);
58316 return;
58317 }
58318 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58319 if (!JS::Call(cx, thisValue, callable,
58320 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58321 aRv.NoteJSContextException(cx);
58322 return;
58323 }
58324}
58325
58326void
58327TestJSImplInterfaceJSImpl::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58328{
58329 CallSetup s(this, aRv, "TestJSImplInterface.passSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58330 if (aRv.Failed()) {
58331 return;
58332 }
58333 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58333); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58333); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58334 BindingCallContext& cx = s.GetCallContext();
58335
58336 JS::Rooted<JS::Value> rval(cx);
58337 JS::RootedVector<JS::Value> argv(cx);
58338 if (!argv.resize(1)) {
58339 // That threw an exception on the JSContext, and our CallSetup will do
58340 // the right thing with that.
58341 return;
58342 }
58343 unsigned argc = 1;
58344
58345 do {
58346 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
58347 aRv.Throw(NS_ERROR_UNEXPECTED);
58348 return;
58349 }
58350 break;
58351 } while (false);
58352
58353 JS::Rooted<JS::Value> callable(cx);
58354 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58355 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58356 !InitIds(cx, atomsCache)) ||
58357 !GetCallableProperty(cx, atomsCache->passSVS_id, &callable)) {
58358 aRv.Throw(NS_ERROR_UNEXPECTED);
58359 return;
58360 }
58361 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58362 if (!JS::Call(cx, thisValue, callable,
58363 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58364 aRv.NoteJSContextException(cx);
58365 return;
58366 }
58367}
58368
58369void
58370TestJSImplInterfaceJSImpl::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58371{
58372 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58373 if (aRv.Failed()) {
58374 return;
58375 }
58376 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58376); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58376); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58377 BindingCallContext& cx = s.GetCallContext();
58378
58379 JS::Rooted<JS::Value> rval(cx);
58380 JS::RootedVector<JS::Value> argv(cx);
58381 if (!argv.resize(1)) {
58382 // That threw an exception on the JSContext, and our CallSetup will do
58383 // the right thing with that.
58384 return;
58385 }
58386 unsigned argc = 1;
58387
58388 do {
58389 if (!xpc::StringToJsval(cx, arg, argv[0])) {
58390 aRv.Throw(NS_ERROR_UNEXPECTED);
58391 return;
58392 }
58393 break;
58394 } while (false);
58395
58396 JS::Rooted<JS::Value> callable(cx);
58397 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58398 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58399 !InitIds(cx, atomsCache)) ||
58400 !GetCallableProperty(cx, atomsCache->passNullableSVS_id, &callable)) {
58401 aRv.Throw(NS_ERROR_UNEXPECTED);
58402 return;
58403 }
58404 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58405 if (!JS::Call(cx, thisValue, callable,
58406 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58407 aRv.NoteJSContextException(cx);
58408 return;
58409 }
58410}
58411
58412void
58413TestJSImplInterfaceJSImpl::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58414{
58415 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58416 if (aRv.Failed()) {
58417 return;
58418 }
58419 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58419); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58420 BindingCallContext& cx = s.GetCallContext();
58421
58422 JS::Rooted<JS::Value> rval(cx);
58423 JS::RootedVector<JS::Value> argv(cx);
58424 if (!argv.resize(1)) {
58425 // That threw an exception on the JSContext, and our CallSetup will do
58426 // the right thing with that.
58427 return;
58428 }
58429 unsigned argc = 1;
58430
58431 do {
58432 if (arg.WasPassed()) {
58433 if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) {
58434 aRv.Throw(NS_ERROR_UNEXPECTED);
58435 return;
58436 }
58437 break;
58438 } else if (argc == 1) {
58439 // This is our current trailing argument; reduce argc
58440 --argc;
58441 } else {
58442 argv[0].setUndefined();
58443 }
58444 } while (false);
58445
58446 JS::Rooted<JS::Value> callable(cx);
58447 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58448 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58449 !InitIds(cx, atomsCache)) ||
58450 !GetCallableProperty(cx, atomsCache->passOptionalSVS_id, &callable)) {
58451 aRv.Throw(NS_ERROR_UNEXPECTED);
58452 return;
58453 }
58454 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58455 if (!JS::Call(cx, thisValue, callable,
58456 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58457 aRv.NoteJSContextException(cx);
58458 return;
58459 }
58460}
58461
58462void
58463TestJSImplInterfaceJSImpl::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58464{
58465 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58466 if (aRv.Failed()) {
58467 return;
58468 }
58469 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58469); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58470 BindingCallContext& cx = s.GetCallContext();
58471
58472 JS::Rooted<JS::Value> rval(cx);
58473 JS::RootedVector<JS::Value> argv(cx);
58474 if (!argv.resize(1)) {
58475 // That threw an exception on the JSContext, and our CallSetup will do
58476 // the right thing with that.
58477 return;
58478 }
58479 unsigned argc = 1;
58480
58481 do {
58482 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
58483 aRv.Throw(NS_ERROR_UNEXPECTED);
58484 return;
58485 }
58486 break;
58487 } while (false);
58488
58489 JS::Rooted<JS::Value> callable(cx);
58490 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58491 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58492 !InitIds(cx, atomsCache)) ||
58493 !GetCallableProperty(cx, atomsCache->passOptionalSVSWithDefaultValue_id, &callable)) {
58494 aRv.Throw(NS_ERROR_UNEXPECTED);
58495 return;
58496 }
58497 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58498 if (!JS::Call(cx, thisValue, callable,
58499 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58500 aRv.NoteJSContextException(cx);
58501 return;
58502 }
58503}
58504
58505void
58506TestJSImplInterfaceJSImpl::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58507{
58508 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58509 if (aRv.Failed()) {
58510 return;
58511 }
58512 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58512); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58513 BindingCallContext& cx = s.GetCallContext();
58514
58515 JS::Rooted<JS::Value> rval(cx);
58516 JS::RootedVector<JS::Value> argv(cx);
58517 if (!argv.resize(1)) {
58518 // That threw an exception on the JSContext, and our CallSetup will do
58519 // the right thing with that.
58520 return;
58521 }
58522 unsigned argc = 1;
58523
58524 do {
58525 if (arg.WasPassed()) {
58526 if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) {
58527 aRv.Throw(NS_ERROR_UNEXPECTED);
58528 return;
58529 }
58530 break;
58531 } else if (argc == 1) {
58532 // This is our current trailing argument; reduce argc
58533 --argc;
58534 } else {
58535 argv[0].setUndefined();
58536 }
58537 } while (false);
58538
58539 JS::Rooted<JS::Value> callable(cx);
58540 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58541 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58542 !InitIds(cx, atomsCache)) ||
58543 !GetCallableProperty(cx, atomsCache->passOptionalNullableSVS_id, &callable)) {
58544 aRv.Throw(NS_ERROR_UNEXPECTED);
58545 return;
58546 }
58547 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58548 if (!JS::Call(cx, thisValue, callable,
58549 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58550 aRv.NoteJSContextException(cx);
58551 return;
58552 }
58553}
58554
58555void
58556TestJSImplInterfaceJSImpl::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58557{
58558 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58559 if (aRv.Failed()) {
58560 return;
58561 }
58562 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58562); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58562); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58563 BindingCallContext& cx = s.GetCallContext();
58564
58565 JS::Rooted<JS::Value> rval(cx);
58566 JS::RootedVector<JS::Value> argv(cx);
58567 if (!argv.resize(1)) {
58568 // That threw an exception on the JSContext, and our CallSetup will do
58569 // the right thing with that.
58570 return;
58571 }
58572 unsigned argc = 1;
58573
58574 do {
58575 if (!xpc::StringToJsval(cx, arg, argv[0])) {
58576 aRv.Throw(NS_ERROR_UNEXPECTED);
58577 return;
58578 }
58579 break;
58580 } while (false);
58581
58582 JS::Rooted<JS::Value> callable(cx);
58583 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58584 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58585 !InitIds(cx, atomsCache)) ||
58586 !GetCallableProperty(cx, atomsCache->passOptionalNullableSVSWithDefaultValue_id, &callable)) {
58587 aRv.Throw(NS_ERROR_UNEXPECTED);
58588 return;
58589 }
58590 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58591 if (!JS::Call(cx, thisValue, callable,
58592 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58593 aRv.NoteJSContextException(cx);
58594 return;
58595 }
58596}
58597
58598void
58599TestJSImplInterfaceJSImpl::PassVariadicSVS(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58600{
58601 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58602 if (aRv.Failed()) {
58603 return;
58604 }
58605 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58605); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58605); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58606 BindingCallContext& cx = s.GetCallContext();
58607
58608 JS::Rooted<JS::Value> rval(cx);
58609 JS::RootedVector<JS::Value> argv(cx);
58610 if (!argv.resize((1 - 1) + arg.Length())) {
58611 // That threw an exception on the JSContext, and our CallSetup will do
58612 // the right thing with that.
58613 return;
58614 }
58615 unsigned argc = (1 - 1) + arg.Length();
58616
58617 do {
58618 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
58619 if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) {
58620 aRv.Throw(NS_ERROR_UNEXPECTED);
58621 return;
58622 }
58623 continue;
58624 }
58625 break;
58626 } while (false);
58627
58628 JS::Rooted<JS::Value> callable(cx);
58629 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58630 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58631 !InitIds(cx, atomsCache)) ||
58632 !GetCallableProperty(cx, atomsCache->passVariadicSVS_id, &callable)) {
58633 aRv.Throw(NS_ERROR_UNEXPECTED);
58634 return;
58635 }
58636 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58637 if (!JS::Call(cx, thisValue, callable,
58638 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58639 aRv.NoteJSContextException(cx);
58640 return;
58641 }
58642}
58643
58644void
58645TestJSImplInterfaceJSImpl::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
58646{
58647 CallSetup s(this, aRv, "TestJSImplInterface.receiveSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58648 if (aRv.Failed()) {
58649 return;
58650 }
58651 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58651); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58652 BindingCallContext& cx = s.GetCallContext();
58653
58654 JS::Rooted<JS::Value> rval(cx);
58655
58656 JS::Rooted<JS::Value> callable(cx);
58657 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58658 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58659 !InitIds(cx, atomsCache)) ||
58660 !GetCallableProperty(cx, atomsCache->receiveSVS_id, &callable)) {
58661 aRv.Throw(NS_ERROR_UNEXPECTED);
58662 return;
58663 }
58664 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58665 if (!JS::Call(cx, thisValue, callable,
58666 JS::HandleValueArray::empty(), &rval)) {
58667 aRv.NoteJSContextException(cx);
58668 return;
58669 }
58670 binding_detail::FakeString<char16_t> rvalDecl;
58671 if (!ConvertJSValueToString(cx, rval, eStringify, eStringify, rvalDecl)) {
58672 aRv.Throw(NS_ERROR_UNEXPECTED);
58673 return;
58674 }
58675 if (!NormalizeUSVString(rvalDecl)) {
58676 JS_ReportOutOfMemory(cx);
58677 aRv.Throw(NS_ERROR_UNEXPECTED);
58678 return;
58679 }
58680 aRetVal = rvalDecl;
58681}
58682
58683void
58684TestJSImplInterfaceJSImpl::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
58685{
58686 CallSetup s(this, aRv, "TestJSImplInterface.passJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58687 if (aRv.Failed()) {
58688 return;
58689 }
58690 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58690); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58690); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58691 BindingCallContext& cx = s.GetCallContext();
58692
58693 JS::Rooted<JS::Value> rval(cx);
58694 JS::RootedVector<JS::Value> argv(cx);
58695 if (!argv.resize(1)) {
58696 // That threw an exception on the JSContext, and our CallSetup will do
58697 // the right thing with that.
58698 return;
58699 }
58700 unsigned argc = 1;
58701
58702 do {
58703 argv[0].setString(arg);
58704 if (!MaybeWrapStringValue(cx, argv[0])) {
58705 aRv.Throw(NS_ERROR_UNEXPECTED);
58706 return;
58707 }
58708 break;
58709 } while (false);
58710
58711 JS::Rooted<JS::Value> callable(cx);
58712 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58713 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58714 !InitIds(cx, atomsCache)) ||
58715 !GetCallableProperty(cx, atomsCache->passJSString_id, &callable)) {
58716 aRv.Throw(NS_ERROR_UNEXPECTED);
58717 return;
58718 }
58719 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58720 if (!JS::Call(cx, thisValue, callable,
58721 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58722 aRv.NoteJSContextException(cx);
58723 return;
58724 }
58725}
58726
58727void
58728TestJSImplInterfaceJSImpl::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
58729{
58730 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalJSStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58731 if (aRv.Failed()) {
58732 return;
58733 }
58734 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58734); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58735 BindingCallContext& cx = s.GetCallContext();
58736
58737 JS::Rooted<JS::Value> rval(cx);
58738 JS::RootedVector<JS::Value> argv(cx);
58739 if (!argv.resize(1)) {
58740 // That threw an exception on the JSContext, and our CallSetup will do
58741 // the right thing with that.
58742 return;
58743 }
58744 unsigned argc = 1;
58745
58746 do {
58747 argv[0].setString(arg);
58748 if (!MaybeWrapStringValue(cx, argv[0])) {
58749 aRv.Throw(NS_ERROR_UNEXPECTED);
58750 return;
58751 }
58752 break;
58753 } while (false);
58754
58755 JS::Rooted<JS::Value> callable(cx);
58756 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58757 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58758 !InitIds(cx, atomsCache)) ||
58759 !GetCallableProperty(cx, atomsCache->passOptionalJSStringWithDefaultValue_id, &callable)) {
58760 aRv.Throw(NS_ERROR_UNEXPECTED);
58761 return;
58762 }
58763 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58764 if (!JS::Call(cx, thisValue, callable,
58765 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58766 aRv.NoteJSContextException(cx);
58767 return;
58768 }
58769}
58770
58771void
58772TestJSImplInterfaceJSImpl::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
58773{
58774 CallSetup s(this, aRv, "TestJSImplInterface.receiveJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58775 if (aRv.Failed()) {
58776 return;
58777 }
58778 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58778); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58778); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58779 BindingCallContext& cx = s.GetCallContext();
58780
58781 JS::Rooted<JS::Value> rval(cx);
58782
58783 JS::Rooted<JS::Value> callable(cx);
58784 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58785 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58786 !InitIds(cx, atomsCache)) ||
58787 !GetCallableProperty(cx, atomsCache->receiveJSString_id, &callable)) {
58788 aRv.Throw(NS_ERROR_UNEXPECTED);
58789 return;
58790 }
58791 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58792 if (!JS::Call(cx, thisValue, callable,
58793 JS::HandleValueArray::empty(), &rval)) {
58794 aRv.NoteJSContextException(cx);
58795 return;
58796 }
58797 JS::Rooted<JSString*> rvalDecl(cx);
58798 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
58799 aRv.Throw(NS_ERROR_UNEXPECTED);
58800 return;
58801 }
58802 aRetVal.set(rvalDecl);
58803}
58804
58805void
58806TestJSImplInterfaceJSImpl::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
58807{
58808 CallSetup s(this, aRv, "TestJSImplInterface.passEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58809 if (aRv.Failed()) {
58810 return;
58811 }
58812 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58812); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58812); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58813 BindingCallContext& cx = s.GetCallContext();
58814
58815 JS::Rooted<JS::Value> rval(cx);
58816 JS::RootedVector<JS::Value> argv(cx);
58817 if (!argv.resize(1)) {
58818 // That threw an exception on the JSContext, and our CallSetup will do
58819 // the right thing with that.
58820 return;
58821 }
58822 unsigned argc = 1;
58823
58824 do {
58825 if (!ToJSValue(cx, arg, argv[0])) {
58826 aRv.Throw(NS_ERROR_UNEXPECTED);
58827 return;
58828 }
58829 break;
58830 } while (false);
58831
58832 JS::Rooted<JS::Value> callable(cx);
58833 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58834 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58835 !InitIds(cx, atomsCache)) ||
58836 !GetCallableProperty(cx, atomsCache->passEnum_id, &callable)) {
58837 aRv.Throw(NS_ERROR_UNEXPECTED);
58838 return;
58839 }
58840 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58841 if (!JS::Call(cx, thisValue, callable,
58842 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58843 aRv.NoteJSContextException(cx);
58844 return;
58845 }
58846}
58847
58848void
58849TestJSImplInterfaceJSImpl::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58850{
58851 CallSetup s(this, aRv, "TestJSImplInterface.passNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58852 if (aRv.Failed()) {
58853 return;
58854 }
58855 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58855); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58855); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58856 BindingCallContext& cx = s.GetCallContext();
58857
58858 JS::Rooted<JS::Value> rval(cx);
58859 JS::RootedVector<JS::Value> argv(cx);
58860 if (!argv.resize(1)) {
58861 // That threw an exception on the JSContext, and our CallSetup will do
58862 // the right thing with that.
58863 return;
58864 }
58865 unsigned argc = 1;
58866
58867 do {
58868 if (arg.IsNull()) {
58869 argv[0].setNull();
58870 break;
58871 } else {
58872 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58873 aRv.Throw(NS_ERROR_UNEXPECTED);
58874 return;
58875 }
58876 break;
58877 }
58878 } while (false);
58879
58880 JS::Rooted<JS::Value> callable(cx);
58881 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58882 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58883 !InitIds(cx, atomsCache)) ||
58884 !GetCallableProperty(cx, atomsCache->passNullableEnum_id, &callable)) {
58885 aRv.Throw(NS_ERROR_UNEXPECTED);
58886 return;
58887 }
58888 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58889 if (!JS::Call(cx, thisValue, callable,
58890 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58891 aRv.NoteJSContextException(cx);
58892 return;
58893 }
58894}
58895
58896void
58897TestJSImplInterfaceJSImpl::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58898{
58899 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58900 if (aRv.Failed()) {
58901 return;
58902 }
58903 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58903); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58903); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58904 BindingCallContext& cx = s.GetCallContext();
58905
58906 JS::Rooted<JS::Value> rval(cx);
58907 JS::RootedVector<JS::Value> argv(cx);
58908 if (!argv.resize(1)) {
58909 // That threw an exception on the JSContext, and our CallSetup will do
58910 // the right thing with that.
58911 return;
58912 }
58913 unsigned argc = 1;
58914
58915 do {
58916 if (arg.WasPassed()) {
58917 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58918 aRv.Throw(NS_ERROR_UNEXPECTED);
58919 return;
58920 }
58921 break;
58922 } else if (argc == 1) {
58923 // This is our current trailing argument; reduce argc
58924 --argc;
58925 } else {
58926 argv[0].setUndefined();
58927 }
58928 } while (false);
58929
58930 JS::Rooted<JS::Value> callable(cx);
58931 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58932 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58933 !InitIds(cx, atomsCache)) ||
58934 !GetCallableProperty(cx, atomsCache->passOptionalEnum_id, &callable)) {
58935 aRv.Throw(NS_ERROR_UNEXPECTED);
58936 return;
58937 }
58938 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58939 if (!JS::Call(cx, thisValue, callable,
58940 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58941 aRv.NoteJSContextException(cx);
58942 return;
58943 }
58944}
58945
58946void
58947TestJSImplInterfaceJSImpl::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
58948{
58949 CallSetup s(this, aRv, "TestJSImplInterface.passEnumWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58950 if (aRv.Failed()) {
58951 return;
58952 }
58953 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58953); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58953); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58954 BindingCallContext& cx = s.GetCallContext();
58955
58956 JS::Rooted<JS::Value> rval(cx);
58957 JS::RootedVector<JS::Value> argv(cx);
58958 if (!argv.resize(1)) {
58959 // That threw an exception on the JSContext, and our CallSetup will do
58960 // the right thing with that.
58961 return;
58962 }
58963 unsigned argc = 1;
58964
58965 do {
58966 if (!ToJSValue(cx, arg, argv[0])) {
58967 aRv.Throw(NS_ERROR_UNEXPECTED);
58968 return;
58969 }
58970 break;
58971 } while (false);
58972
58973 JS::Rooted<JS::Value> callable(cx);
58974 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58975 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58976 !InitIds(cx, atomsCache)) ||
58977 !GetCallableProperty(cx, atomsCache->passEnumWithDefault_id, &callable)) {
58978 aRv.Throw(NS_ERROR_UNEXPECTED);
58979 return;
58980 }
58981 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58982 if (!JS::Call(cx, thisValue, callable,
58983 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58984 aRv.NoteJSContextException(cx);
58985 return;
58986 }
58987}
58988
58989void
58990TestJSImplInterfaceJSImpl::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58991{
58992 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58993 if (aRv.Failed()) {
58994 return;
58995 }
58996 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58996); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 58996); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
58997 BindingCallContext& cx = s.GetCallContext();
58998
58999 JS::Rooted<JS::Value> rval(cx);
59000 JS::RootedVector<JS::Value> argv(cx);
59001 if (!argv.resize(1)) {
59002 // That threw an exception on the JSContext, and our CallSetup will do
59003 // the right thing with that.
59004 return;
59005 }
59006 unsigned argc = 1;
59007
59008 do {
59009 if (arg.WasPassed()) {
59010 if (arg.Value().IsNull()) {
59011 argv[0].setNull();
59012 break;
59013 } else {
59014 if (!ToJSValue(cx, arg.Value().Value(), argv[0])) {
59015 aRv.Throw(NS_ERROR_UNEXPECTED);
59016 return;
59017 }
59018 break;
59019 }
59020 } else if (argc == 1) {
59021 // This is our current trailing argument; reduce argc
59022 --argc;
59023 } else {
59024 argv[0].setUndefined();
59025 }
59026 } while (false);
59027
59028 JS::Rooted<JS::Value> callable(cx);
59029 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59030 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59031 !InitIds(cx, atomsCache)) ||
59032 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnum_id, &callable)) {
59033 aRv.Throw(NS_ERROR_UNEXPECTED);
59034 return;
59035 }
59036 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59037 if (!JS::Call(cx, thisValue, callable,
59038 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59039 aRv.NoteJSContextException(cx);
59040 return;
59041 }
59042}
59043
59044void
59045TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59046{
59047 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59048 if (aRv.Failed()) {
59049 return;
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 { MOZ_CrashSequence
(__null, 59051); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59052 BindingCallContext& cx = s.GetCallContext();
59053
59054 JS::Rooted<JS::Value> rval(cx);
59055 JS::RootedVector<JS::Value> argv(cx);
59056 if (!argv.resize(1)) {
59057 // That threw an exception on the JSContext, and our CallSetup will do
59058 // the right thing with that.
59059 return;
59060 }
59061 unsigned argc = 1;
59062
59063 do {
59064 if (arg.IsNull()) {
59065 argv[0].setNull();
59066 break;
59067 } else {
59068 if (!ToJSValue(cx, arg.Value(), argv[0])) {
59069 aRv.Throw(NS_ERROR_UNEXPECTED);
59070 return;
59071 }
59072 break;
59073 }
59074 } while (false);
59075
59076 JS::Rooted<JS::Value> callable(cx);
59077 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59078 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59079 !InitIds(cx, atomsCache)) ||
59080 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue_id, &callable)) {
59081 aRv.Throw(NS_ERROR_UNEXPECTED);
59082 return;
59083 }
59084 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59085 if (!JS::Call(cx, thisValue, callable,
59086 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59087 aRv.NoteJSContextException(cx);
59088 return;
59089 }
59090}
59091
59092void
59093TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59094{
59095 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59096 if (aRv.Failed()) {
59097 return;
59098 }
59099 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59099); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59100 BindingCallContext& cx = s.GetCallContext();
59101
59102 JS::Rooted<JS::Value> rval(cx);
59103 JS::RootedVector<JS::Value> argv(cx);
59104 if (!argv.resize(1)) {
59105 // That threw an exception on the JSContext, and our CallSetup will do
59106 // the right thing with that.
59107 return;
59108 }
59109 unsigned argc = 1;
59110
59111 do {
59112 if (arg.IsNull()) {
59113 argv[0].setNull();
59114 break;
59115 } else {
59116 if (!ToJSValue(cx, arg.Value(), argv[0])) {
59117 aRv.Throw(NS_ERROR_UNEXPECTED);
59118 return;
59119 }
59120 break;
59121 }
59122 } while (false);
59123
59124 JS::Rooted<JS::Value> callable(cx);
59125 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59126 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59127 !InitIds(cx, atomsCache)) ||
59128 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue2_id, &callable)) {
59129 aRv.Throw(NS_ERROR_UNEXPECTED);
59130 return;
59131 }
59132 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59133 if (!JS::Call(cx, thisValue, callable,
59134 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59135 aRv.NoteJSContextException(cx);
59136 return;
59137 }
59138}
59139
59140MyTestEnum
59141TestJSImplInterfaceJSImpl::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm)
59142{
59143 CallSetup s(this, aRv, "TestJSImplInterface.receiveEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59144 if (aRv.Failed()) {
59145 return MyTestEnum(0);
59146 }
59147 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59147); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59147); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59148 BindingCallContext& cx = s.GetCallContext();
59149
59150 JS::Rooted<JS::Value> rval(cx);
59151
59152 JS::Rooted<JS::Value> callable(cx);
59153 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59154 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59155 !InitIds(cx, atomsCache)) ||
59156 !GetCallableProperty(cx, atomsCache->receiveEnum_id, &callable)) {
59157 aRv.Throw(NS_ERROR_UNEXPECTED);
59158 return MyTestEnum(0);
59159 }
59160 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59161 if (!JS::Call(cx, thisValue, callable,
59162 JS::HandleValueArray::empty(), &rval)) {
59163 aRv.NoteJSContextException(cx);
59164 return MyTestEnum(0);
59165 }
59166 MyTestEnum rvalDecl;
59167 {
59168 int index;
59169 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
59170 binding_detail::EnumStrings<MyTestEnum>::Values,
59171 "MyTestEnum", "return value of TestJSImplInterface.receiveEnum",
59172 &index)) {
59173 aRv.Throw(NS_ERROR_UNEXPECTED);
59174 return MyTestEnum(0);
59175 }
59176 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", 59176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 59176); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59177 rvalDecl = static_cast<MyTestEnum>(index);
59178 }
59179 return rvalDecl;
59180}
59181
59182Nullable<MyTestEnum>
59183TestJSImplInterfaceJSImpl::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm)
59184{
59185 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59186 if (aRv.Failed()) {
59187 return Nullable<MyTestEnum>();
59188 }
59189 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59189); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59189); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59190 BindingCallContext& cx = s.GetCallContext();
59191
59192 JS::Rooted<JS::Value> rval(cx);
59193
59194 JS::Rooted<JS::Value> callable(cx);
59195 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59196 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59197 !InitIds(cx, atomsCache)) ||
59198 !GetCallableProperty(cx, atomsCache->receiveNullableEnum_id, &callable)) {
59199 aRv.Throw(NS_ERROR_UNEXPECTED);
59200 return Nullable<MyTestEnum>();
59201 }
59202 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59203 if (!JS::Call(cx, thisValue, callable,
59204 JS::HandleValueArray::empty(), &rval)) {
59205 aRv.NoteJSContextException(cx);
59206 return Nullable<MyTestEnum>();
59207 }
59208 Nullable<MyTestEnum> rvalDecl;
59209 if (rval.isNullOrUndefined()) {
59210 rvalDecl.SetNull();
59211 } else {
59212 {
59213 int index;
59214 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
59215 binding_detail::EnumStrings<MyTestEnum>::Values,
59216 "MyTestEnum", "return value of TestJSImplInterface.receiveNullableEnum",
59217 &index)) {
59218 aRv.Throw(NS_ERROR_UNEXPECTED);
59219 return Nullable<MyTestEnum>();
59220 }
59221 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", 59221); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 59221); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59222 rvalDecl.SetValue() = static_cast<MyTestEnum>(index);
59223 }
59224 }
59225 return rvalDecl;
59226}
59227
59228void
59229TestJSImplInterfaceJSImpl::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
59230{
59231 CallSetup s(this, aRv, "TestJSImplInterface.passCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59232 if (aRv.Failed()) {
59233 return;
59234 }
59235 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59235); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59235); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59236 BindingCallContext& cx = s.GetCallContext();
59237
59238 JS::Rooted<JS::Value> rval(cx);
59239 JS::RootedVector<JS::Value> argv(cx);
59240 if (!argv.resize(1)) {
59241 // That threw an exception on the JSContext, and our CallSetup will do
59242 // the right thing with that.
59243 return;
59244 }
59245 unsigned argc = 1;
59246
59247 do {
59248 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59249 if (!MaybeWrapObjectValue(cx, argv[0])) {
59250 aRv.Throw(NS_ERROR_UNEXPECTED);
59251 return;
59252 }
59253 break;
59254 } while (false);
59255
59256 JS::Rooted<JS::Value> callable(cx);
59257 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59258 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59259 !InitIds(cx, atomsCache)) ||
59260 !GetCallableProperty(cx, atomsCache->passCallback_id, &callable)) {
59261 aRv.Throw(NS_ERROR_UNEXPECTED);
59262 return;
59263 }
59264 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59265 if (!JS::Call(cx, thisValue, callable,
59266 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59267 aRv.NoteJSContextException(cx);
59268 return;
59269 }
59270}
59271
59272void
59273TestJSImplInterfaceJSImpl::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59274{
59275 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59276 if (aRv.Failed()) {
59277 return;
59278 }
59279 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59279); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59280 BindingCallContext& cx = s.GetCallContext();
59281
59282 JS::Rooted<JS::Value> rval(cx);
59283 JS::RootedVector<JS::Value> argv(cx);
59284 if (!argv.resize(1)) {
59285 // That threw an exception on the JSContext, and our CallSetup will do
59286 // the right thing with that.
59287 return;
59288 }
59289 unsigned argc = 1;
59290
59291 do {
59292 if (arg) {
59293 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59294 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59295 aRv.Throw(NS_ERROR_UNEXPECTED);
59296 return;
59297 }
59298 break;
59299 } else {
59300 argv[0].setNull();
59301 break;
59302 }
59303 } while (false);
59304
59305 JS::Rooted<JS::Value> callable(cx);
59306 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59307 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59308 !InitIds(cx, atomsCache)) ||
59309 !GetCallableProperty(cx, atomsCache->passNullableCallback_id, &callable)) {
59310 aRv.Throw(NS_ERROR_UNEXPECTED);
59311 return;
59312 }
59313 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59314 if (!JS::Call(cx, thisValue, callable,
59315 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59316 aRv.NoteJSContextException(cx);
59317 return;
59318 }
59319}
59320
59321void
59322TestJSImplInterfaceJSImpl::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59323{
59324 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59325 if (aRv.Failed()) {
59326 return;
59327 }
59328 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59328); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59328); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59329 BindingCallContext& cx = s.GetCallContext();
59330
59331 JS::Rooted<JS::Value> rval(cx);
59332 JS::RootedVector<JS::Value> argv(cx);
59333 if (!argv.resize(1)) {
59334 // That threw an exception on the JSContext, and our CallSetup will do
59335 // the right thing with that.
59336 return;
59337 }
59338 unsigned argc = 1;
59339
59340 do {
59341 if (arg.WasPassed()) {
59342 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
59343 if (!MaybeWrapObjectValue(cx, argv[0])) {
59344 aRv.Throw(NS_ERROR_UNEXPECTED);
59345 return;
59346 }
59347 break;
59348 } else if (argc == 1) {
59349 // This is our current trailing argument; reduce argc
59350 --argc;
59351 } else {
59352 argv[0].setUndefined();
59353 }
59354 } while (false);
59355
59356 JS::Rooted<JS::Value> callable(cx);
59357 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59358 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59359 !InitIds(cx, atomsCache)) ||
59360 !GetCallableProperty(cx, atomsCache->passOptionalCallback_id, &callable)) {
59361 aRv.Throw(NS_ERROR_UNEXPECTED);
59362 return;
59363 }
59364 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59365 if (!JS::Call(cx, thisValue, callable,
59366 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59367 aRv.NoteJSContextException(cx);
59368 return;
59369 }
59370}
59371
59372void
59373TestJSImplInterfaceJSImpl::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59374{
59375 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59376 if (aRv.Failed()) {
59377 return;
59378 }
59379 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59379); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59379); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59380 BindingCallContext& cx = s.GetCallContext();
59381
59382 JS::Rooted<JS::Value> rval(cx);
59383 JS::RootedVector<JS::Value> argv(cx);
59384 if (!argv.resize(1)) {
59385 // That threw an exception on the JSContext, and our CallSetup will do
59386 // the right thing with that.
59387 return;
59388 }
59389 unsigned argc = 1;
59390
59391 do {
59392 if (arg.WasPassed()) {
59393 if (arg.Value()) {
59394 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
59395 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59396 aRv.Throw(NS_ERROR_UNEXPECTED);
59397 return;
59398 }
59399 break;
59400 } else {
59401 argv[0].setNull();
59402 break;
59403 }
59404 } else if (argc == 1) {
59405 // This is our current trailing argument; reduce argc
59406 --argc;
59407 } else {
59408 argv[0].setUndefined();
59409 }
59410 } while (false);
59411
59412 JS::Rooted<JS::Value> callable(cx);
59413 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59414 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59415 !InitIds(cx, atomsCache)) ||
59416 !GetCallableProperty(cx, atomsCache->passOptionalNullableCallback_id, &callable)) {
59417 aRv.Throw(NS_ERROR_UNEXPECTED);
59418 return;
59419 }
59420 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59421 if (!JS::Call(cx, thisValue, callable,
59422 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59423 aRv.NoteJSContextException(cx);
59424 return;
59425 }
59426}
59427
59428void
59429TestJSImplInterfaceJSImpl::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59430{
59431 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59432 if (aRv.Failed()) {
59433 return;
59434 }
59435 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59435); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59435); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59436 BindingCallContext& cx = s.GetCallContext();
59437
59438 JS::Rooted<JS::Value> rval(cx);
59439 JS::RootedVector<JS::Value> argv(cx);
59440 if (!argv.resize(1)) {
59441 // That threw an exception on the JSContext, and our CallSetup will do
59442 // the right thing with that.
59443 return;
59444 }
59445 unsigned argc = 1;
59446
59447 do {
59448 if (arg) {
59449 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59450 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59451 aRv.Throw(NS_ERROR_UNEXPECTED);
59452 return;
59453 }
59454 break;
59455 } else {
59456 argv[0].setNull();
59457 break;
59458 }
59459 } while (false);
59460
59461 JS::Rooted<JS::Value> callable(cx);
59462 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59463 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59464 !InitIds(cx, atomsCache)) ||
59465 !GetCallableProperty(cx, atomsCache->passOptionalNullableCallbackWithDefaultValue_id, &callable)) {
59466 aRv.Throw(NS_ERROR_UNEXPECTED);
59467 return;
59468 }
59469 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59470 if (!JS::Call(cx, thisValue, callable,
59471 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59472 aRv.NoteJSContextException(cx);
59473 return;
59474 }
59475}
59476
59477already_AddRefed<MyTestCallback>
59478TestJSImplInterfaceJSImpl::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm)
59479{
59480 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59481 if (aRv.Failed()) {
59482 return nullptr;
59483 }
59484 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59484); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59484); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59485 BindingCallContext& cx = s.GetCallContext();
59486
59487 JS::Rooted<JS::Value> rval(cx);
59488
59489 JS::Rooted<JS::Value> callable(cx);
59490 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59491 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59492 !InitIds(cx, atomsCache)) ||
59493 !GetCallableProperty(cx, atomsCache->receiveCallback_id, &callable)) {
59494 aRv.Throw(NS_ERROR_UNEXPECTED);
59495 return nullptr;
59496 }
59497 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59498 if (!JS::Call(cx, thisValue, callable,
59499 JS::HandleValueArray::empty(), &rval)) {
59500 aRv.NoteJSContextException(cx);
59501 return nullptr;
59502 }
59503 RefPtr<MyTestCallback> rvalDecl;
59504 if (rval.isObject()) {
59505 if (JS::IsCallable(&rval.toObject())) {
59506 { // scope for tempRoot and tempGlobalRoot if needed
59507 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
59508 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
59509 rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
59510 }
59511 } else {
59512 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveCallback");
59513 aRv.Throw(NS_ERROR_UNEXPECTED);
59514 return nullptr;
59515 }
59516 } else {
59517 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallback");
59518 aRv.Throw(NS_ERROR_UNEXPECTED);
59519 return nullptr;
59520 }
59521 return rvalDecl.forget();
59522}
59523
59524already_AddRefed<MyTestCallback>
59525TestJSImplInterfaceJSImpl::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm)
59526{
59527 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59528 if (aRv.Failed()) {
59529 return nullptr;
59530 }
59531 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59531); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59531); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59532 BindingCallContext& cx = s.GetCallContext();
59533
59534 JS::Rooted<JS::Value> rval(cx);
59535
59536 JS::Rooted<JS::Value> callable(cx);
59537 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59538 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59539 !InitIds(cx, atomsCache)) ||
59540 !GetCallableProperty(cx, atomsCache->receiveNullableCallback_id, &callable)) {
59541 aRv.Throw(NS_ERROR_UNEXPECTED);
59542 return nullptr;
59543 }
59544 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59545 if (!JS::Call(cx, thisValue, callable,
59546 JS::HandleValueArray::empty(), &rval)) {
59547 aRv.NoteJSContextException(cx);
59548 return nullptr;
59549 }
59550 RefPtr<MyTestCallback> rvalDecl;
59551 if (rval.isObject()) {
59552 if (JS::IsCallable(&rval.toObject())) {
59553 { // scope for tempRoot and tempGlobalRoot if needed
59554 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
59555 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
59556 rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
59557 }
59558 } else {
59559 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveNullableCallback");
59560 aRv.Throw(NS_ERROR_UNEXPECTED);
59561 return nullptr;
59562 }
59563 } else if (rval.isNullOrUndefined()) {
59564 rvalDecl = nullptr;
59565 } else {
59566 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallback");
59567 aRv.Throw(NS_ERROR_UNEXPECTED);
59568 return nullptr;
59569 }
59570 return rvalDecl.forget();
59571}
59572
59573void
59574TestJSImplInterfaceJSImpl::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59575{
59576 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59577 if (aRv.Failed()) {
59578 return;
59579 }
59580 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59580); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59580); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59581 BindingCallContext& cx = s.GetCallContext();
59582
59583 JS::Rooted<JS::Value> rval(cx);
59584 JS::RootedVector<JS::Value> argv(cx);
59585 if (!argv.resize(1)) {
59586 // That threw an exception on the JSContext, and our CallSetup will do
59587 // the right thing with that.
59588 return;
59589 }
59590 unsigned argc = 1;
59591
59592 do {
59593 if (arg) {
59594 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59595 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59596 aRv.Throw(NS_ERROR_UNEXPECTED);
59597 return;
59598 }
59599 break;
59600 } else {
59601 argv[0].setNull();
59602 break;
59603 }
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->passOptionalNullableTreatAsNullCallbackWithDefaultValue_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::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59624{
59625 CallSetup s(this, aRv, "TestJSImplInterface.passAny", 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 { MOZ_CrashSequence
(__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->passAny_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::PassVariadicAny(const nsTArray<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59669{
59670 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicAny", 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 { MOZ_CrashSequence
(__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 - 1) + arg.Length())) {
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 - 1) + arg.Length();
59685
59686 do {
59687 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
59688 JS::ExposeValueToActiveJS(arg[idx]);
59689 argv[0 + idx].set(arg[idx]);
59690 if (!MaybeWrapValue(cx, argv[0 + idx])) {
59691 aRv.Throw(NS_ERROR_UNEXPECTED);
59692 return;
59693 }
59694 continue;
59695 }
59696 break;
59697 } while (false);
59698
59699 JS::Rooted<JS::Value> callable(cx);
59700 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59701 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59702 !InitIds(cx, atomsCache)) ||
59703 !GetCallableProperty(cx, atomsCache->passVariadicAny_id, &callable)) {
59704 aRv.Throw(NS_ERROR_UNEXPECTED);
59705 return;
59706 }
59707 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59708 if (!JS::Call(cx, thisValue, callable,
59709 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59710 aRv.NoteJSContextException(cx);
59711 return;
59712 }
59713}
59714
59715void
59716TestJSImplInterfaceJSImpl::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59717{
59718 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59719 if (aRv.Failed()) {
59720 return;
59721 }
59722 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59722); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59722); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59723 BindingCallContext& cx = s.GetCallContext();
59724
59725 JS::Rooted<JS::Value> rval(cx);
59726 JS::RootedVector<JS::Value> argv(cx);
59727 if (!argv.resize(1)) {
59728 // That threw an exception on the JSContext, and our CallSetup will do
59729 // the right thing with that.
59730 return;
59731 }
59732 unsigned argc = 1;
59733
59734 do {
59735 JS::ExposeValueToActiveJS(arg);
59736 argv[0].set(arg);
59737 if (!MaybeWrapValue(cx, argv[0])) {
59738 aRv.Throw(NS_ERROR_UNEXPECTED);
59739 return;
59740 }
59741 break;
59742 } while (false);
59743
59744 JS::Rooted<JS::Value> callable(cx);
59745 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59746 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59747 !InitIds(cx, atomsCache)) ||
59748 !GetCallableProperty(cx, atomsCache->passOptionalAny_id, &callable)) {
59749 aRv.Throw(NS_ERROR_UNEXPECTED);
59750 return;
59751 }
59752 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59753 if (!JS::Call(cx, thisValue, callable,
59754 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59755 aRv.NoteJSContextException(cx);
59756 return;
59757 }
59758}
59759
59760void
59761TestJSImplInterfaceJSImpl::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59762{
59763 CallSetup s(this, aRv, "TestJSImplInterface.passAnyDefaultNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59764 if (aRv.Failed()) {
59765 return;
59766 }
59767 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59767); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59767); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59768 BindingCallContext& cx = s.GetCallContext();
59769
59770 JS::Rooted<JS::Value> rval(cx);
59771 JS::RootedVector<JS::Value> argv(cx);
59772 if (!argv.resize(1)) {
59773 // That threw an exception on the JSContext, and our CallSetup will do
59774 // the right thing with that.
59775 return;
59776 }
59777 unsigned argc = 1;
59778
59779 do {
59780 JS::ExposeValueToActiveJS(arg);
59781 argv[0].set(arg);
59782 if (!MaybeWrapValue(cx, argv[0])) {
59783 aRv.Throw(NS_ERROR_UNEXPECTED);
59784 return;
59785 }
59786 break;
59787 } while (false);
59788
59789 JS::Rooted<JS::Value> callable(cx);
59790 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59791 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59792 !InitIds(cx, atomsCache)) ||
59793 !GetCallableProperty(cx, atomsCache->passAnyDefaultNull_id, &callable)) {
59794 aRv.Throw(NS_ERROR_UNEXPECTED);
59795 return;
59796 }
59797 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59798 if (!JS::Call(cx, thisValue, callable,
59799 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59800 aRv.NoteJSContextException(cx);
59801 return;
59802 }
59803}
59804
59805void
59806TestJSImplInterfaceJSImpl::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59807{
59808 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59809 if (aRv.Failed()) {
59810 return;
59811 }
59812 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59812); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59812); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59813 BindingCallContext& cx = s.GetCallContext();
59814
59815 JS::Rooted<JS::Value> rval(cx);
59816 JS::RootedVector<JS::Value> argv(cx);
59817 if (!argv.resize(1)) {
59818 // That threw an exception on the JSContext, and our CallSetup will do
59819 // the right thing with that.
59820 return;
59821 }
59822 unsigned argc = 1;
59823
59824 do {
59825
59826 uint32_t length = arg.Length();
59827 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59828 if (!returnArray) {
59829 aRv.Throw(NS_ERROR_UNEXPECTED);
59830 return;
59831 }
59832 // Scope for 'tmp'
59833 {
59834 JS::Rooted<JS::Value> tmp(cx);
59835 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59836 // Control block to let us common up the JS_DefineElement calls when there
59837 // are different ways to succeed at wrapping the object.
59838 do {
59839 JS::ExposeValueToActiveJS(arg[sequenceIdx0]);
59840 tmp.set(arg[sequenceIdx0]);
59841 if (!MaybeWrapValue(cx, &tmp)) {
59842 aRv.Throw(NS_ERROR_UNEXPECTED);
59843 return;
59844 }
59845 break;
59846 } while (false);
59847 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59848 JSPROP_ENUMERATE)) {
59849 aRv.Throw(NS_ERROR_UNEXPECTED);
59850 return;
59851 }
59852 }
59853 }
59854 argv[0].setObject(*returnArray);
59855 break;
59856 } while (false);
59857
59858 JS::Rooted<JS::Value> callable(cx);
59859 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59860 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59861 !InitIds(cx, atomsCache)) ||
59862 !GetCallableProperty(cx, atomsCache->passSequenceOfAny_id, &callable)) {
59863 aRv.Throw(NS_ERROR_UNEXPECTED);
59864 return;
59865 }
59866 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59867 if (!JS::Call(cx, thisValue, callable,
59868 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59869 aRv.NoteJSContextException(cx);
59870 return;
59871 }
59872}
59873
59874void
59875TestJSImplInterfaceJSImpl::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59876{
59877 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59878 if (aRv.Failed()) {
59879 return;
59880 }
59881 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59881); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59881); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59882 BindingCallContext& cx = s.GetCallContext();
59883
59884 JS::Rooted<JS::Value> rval(cx);
59885 JS::RootedVector<JS::Value> argv(cx);
59886 if (!argv.resize(1)) {
59887 // That threw an exception on the JSContext, and our CallSetup will do
59888 // the right thing with that.
59889 return;
59890 }
59891 unsigned argc = 1;
59892
59893 do {
59894
59895 if (arg.IsNull()) {
59896 argv[0].setNull();
59897 break;
59898 }
59899
59900 uint32_t length = arg.Value().Length();
59901 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59902 if (!returnArray) {
59903 aRv.Throw(NS_ERROR_UNEXPECTED);
59904 return;
59905 }
59906 // Scope for 'tmp'
59907 {
59908 JS::Rooted<JS::Value> tmp(cx);
59909 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59910 // Control block to let us common up the JS_DefineElement calls when there
59911 // are different ways to succeed at wrapping the object.
59912 do {
59913 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
59914 tmp.set(arg.Value()[sequenceIdx0]);
59915 if (!MaybeWrapValue(cx, &tmp)) {
59916 aRv.Throw(NS_ERROR_UNEXPECTED);
59917 return;
59918 }
59919 break;
59920 } while (false);
59921 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59922 JSPROP_ENUMERATE)) {
59923 aRv.Throw(NS_ERROR_UNEXPECTED);
59924 return;
59925 }
59926 }
59927 }
59928 argv[0].setObject(*returnArray);
59929 break;
59930 } while (false);
59931
59932 JS::Rooted<JS::Value> callable(cx);
59933 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59934 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59935 !InitIds(cx, atomsCache)) ||
59936 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfAny_id, &callable)) {
59937 aRv.Throw(NS_ERROR_UNEXPECTED);
59938 return;
59939 }
59940 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59941 if (!JS::Call(cx, thisValue, callable,
59942 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59943 aRv.NoteJSContextException(cx);
59944 return;
59945 }
59946}
59947
59948void
59949TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59950{
59951 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59952 if (aRv.Failed()) {
59953 return;
59954 }
59955 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59955); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 59955); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
59956 BindingCallContext& cx = s.GetCallContext();
59957
59958 JS::Rooted<JS::Value> rval(cx);
59959 JS::RootedVector<JS::Value> argv(cx);
59960 if (!argv.resize(1)) {
59961 // That threw an exception on the JSContext, and our CallSetup will do
59962 // the right thing with that.
59963 return;
59964 }
59965 unsigned argc = 1;
59966
59967 do {
59968 if (arg.WasPassed()) {
59969
59970 uint32_t length = arg.Value().Length();
59971 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59972 if (!returnArray) {
59973 aRv.Throw(NS_ERROR_UNEXPECTED);
59974 return;
59975 }
59976 // Scope for 'tmp'
59977 {
59978 JS::Rooted<JS::Value> tmp(cx);
59979 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59980 // Control block to let us common up the JS_DefineElement calls when there
59981 // are different ways to succeed at wrapping the object.
59982 do {
59983 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
59984 tmp.set(arg.Value()[sequenceIdx0]);
59985 if (!MaybeWrapValue(cx, &tmp)) {
59986 aRv.Throw(NS_ERROR_UNEXPECTED);
59987 return;
59988 }
59989 break;
59990 } while (false);
59991 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59992 JSPROP_ENUMERATE)) {
59993 aRv.Throw(NS_ERROR_UNEXPECTED);
59994 return;
59995 }
59996 }
59997 }
59998 argv[0].setObject(*returnArray);
59999 break;
60000 } else if (argc == 1) {
60001 // This is our current trailing argument; reduce argc
60002 --argc;
60003 } else {
60004 argv[0].setUndefined();
60005 }
60006 } while (false);
60007
60008 JS::Rooted<JS::Value> callable(cx);
60009 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60010 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60011 !InitIds(cx, atomsCache)) ||
60012 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAny_id, &callable)) {
60013 aRv.Throw(NS_ERROR_UNEXPECTED);
60014 return;
60015 }
60016 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60017 if (!JS::Call(cx, thisValue, callable,
60018 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60019 aRv.NoteJSContextException(cx);
60020 return;
60021 }
60022}
60023
60024void
60025TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60026{
60027 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60028 if (aRv.Failed()) {
60029 return;
60030 }
60031 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60031); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60032 BindingCallContext& cx = s.GetCallContext();
60033
60034 JS::Rooted<JS::Value> rval(cx);
60035 JS::RootedVector<JS::Value> argv(cx);
60036 if (!argv.resize(1)) {
60037 // That threw an exception on the JSContext, and our CallSetup will do
60038 // the right thing with that.
60039 return;
60040 }
60041 unsigned argc = 1;
60042
60043 do {
60044 if (arg.WasPassed()) {
60045
60046 if (arg.Value().IsNull()) {
60047 argv[0].setNull();
60048 break;
60049 }
60050
60051 uint32_t length = arg.Value().Value().Length();
60052 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60053 if (!returnArray) {
60054 aRv.Throw(NS_ERROR_UNEXPECTED);
60055 return;
60056 }
60057 // Scope for 'tmp'
60058 {
60059 JS::Rooted<JS::Value> tmp(cx);
60060 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60061 // Control block to let us common up the JS_DefineElement calls when there
60062 // are different ways to succeed at wrapping the object.
60063 do {
60064 JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0]);
60065 tmp.set(arg.Value().Value()[sequenceIdx0]);
60066 if (!MaybeWrapValue(cx, &tmp)) {
60067 aRv.Throw(NS_ERROR_UNEXPECTED);
60068 return;
60069 }
60070 break;
60071 } while (false);
60072 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60073 JSPROP_ENUMERATE)) {
60074 aRv.Throw(NS_ERROR_UNEXPECTED);
60075 return;
60076 }
60077 }
60078 }
60079 argv[0].setObject(*returnArray);
60080 break;
60081 } else if (argc == 1) {
60082 // This is our current trailing argument; reduce argc
60083 --argc;
60084 } else {
60085 argv[0].setUndefined();
60086 }
60087 } while (false);
60088
60089 JS::Rooted<JS::Value> callable(cx);
60090 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60091 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60092 !InitIds(cx, atomsCache)) ||
60093 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfAny_id, &callable)) {
60094 aRv.Throw(NS_ERROR_UNEXPECTED);
60095 return;
60096 }
60097 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60098 if (!JS::Call(cx, thisValue, callable,
60099 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60100 aRv.NoteJSContextException(cx);
60101 return;
60102 }
60103}
60104
60105void
60106TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60107{
60108 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60109 if (aRv.Failed()) {
60110 return;
60111 }
60112 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60112); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60112); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60113 BindingCallContext& cx = s.GetCallContext();
60114
60115 JS::Rooted<JS::Value> rval(cx);
60116 JS::RootedVector<JS::Value> argv(cx);
60117 if (!argv.resize(1)) {
60118 // That threw an exception on the JSContext, and our CallSetup will do
60119 // the right thing with that.
60120 return;
60121 }
60122 unsigned argc = 1;
60123
60124 do {
60125
60126 if (arg.IsNull()) {
60127 argv[0].setNull();
60128 break;
60129 }
60130
60131 uint32_t length = arg.Value().Length();
60132 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60133 if (!returnArray) {
60134 aRv.Throw(NS_ERROR_UNEXPECTED);
60135 return;
60136 }
60137 // Scope for 'tmp'
60138 {
60139 JS::Rooted<JS::Value> tmp(cx);
60140 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60141 // Control block to let us common up the JS_DefineElement calls when there
60142 // are different ways to succeed at wrapping the object.
60143 do {
60144 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
60145 tmp.set(arg.Value()[sequenceIdx0]);
60146 if (!MaybeWrapValue(cx, &tmp)) {
60147 aRv.Throw(NS_ERROR_UNEXPECTED);
60148 return;
60149 }
60150 break;
60151 } while (false);
60152 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60153 JSPROP_ENUMERATE)) {
60154 aRv.Throw(NS_ERROR_UNEXPECTED);
60155 return;
60156 }
60157 }
60158 }
60159 argv[0].setObject(*returnArray);
60160 break;
60161 } while (false);
60162
60163 JS::Rooted<JS::Value> callable(cx);
60164 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60165 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60166 !InitIds(cx, atomsCache)) ||
60167 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id, &callable)) {
60168 aRv.Throw(NS_ERROR_UNEXPECTED);
60169 return;
60170 }
60171 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60172 if (!JS::Call(cx, thisValue, callable,
60173 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60174 aRv.NoteJSContextException(cx);
60175 return;
60176 }
60177}
60178
60179void
60180TestJSImplInterfaceJSImpl::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60181{
60182 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60183 if (aRv.Failed()) {
60184 return;
60185 }
60186 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60186); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60186); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60187 BindingCallContext& cx = s.GetCallContext();
60188
60189 JS::Rooted<JS::Value> rval(cx);
60190 JS::RootedVector<JS::Value> argv(cx);
60191 if (!argv.resize(1)) {
60192 // That threw an exception on the JSContext, and our CallSetup will do
60193 // the right thing with that.
60194 return;
60195 }
60196 unsigned argc = 1;
60197
60198 do {
60199
60200 uint32_t length = arg.Length();
60201 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60202 if (!returnArray) {
60203 aRv.Throw(NS_ERROR_UNEXPECTED);
60204 return;
60205 }
60206 // Scope for 'tmp'
60207 {
60208 JS::Rooted<JS::Value> tmp(cx);
60209 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60210 // Control block to let us common up the JS_DefineElement calls when there
60211 // are different ways to succeed at wrapping the object.
60212 do {
60213
60214 uint32_t length = arg[sequenceIdx0].Length();
60215 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60216 if (!returnArray) {
60217 aRv.Throw(NS_ERROR_UNEXPECTED);
60218 return;
60219 }
60220 // Scope for 'tmp'
60221 {
60222 JS::Rooted<JS::Value> tmp(cx);
60223 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60224 // Control block to let us common up the JS_DefineElement calls when there
60225 // are different ways to succeed at wrapping the object.
60226 do {
60227 JS::ExposeValueToActiveJS(arg[sequenceIdx0][sequenceIdx1]);
60228 tmp.set(arg[sequenceIdx0][sequenceIdx1]);
60229 if (!MaybeWrapValue(cx, &tmp)) {
60230 aRv.Throw(NS_ERROR_UNEXPECTED);
60231 return;
60232 }
60233 break;
60234 } while (false);
60235 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60236 JSPROP_ENUMERATE)) {
60237 aRv.Throw(NS_ERROR_UNEXPECTED);
60238 return;
60239 }
60240 }
60241 }
60242 tmp.setObject(*returnArray);
60243 break;
60244 } while (false);
60245 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60246 JSPROP_ENUMERATE)) {
60247 aRv.Throw(NS_ERROR_UNEXPECTED);
60248 return;
60249 }
60250 }
60251 }
60252 argv[0].setObject(*returnArray);
60253 break;
60254 } while (false);
60255
60256 JS::Rooted<JS::Value> callable(cx);
60257 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60258 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60259 !InitIds(cx, atomsCache)) ||
60260 !GetCallableProperty(cx, atomsCache->passSequenceOfSequenceOfAny_id, &callable)) {
60261 aRv.Throw(NS_ERROR_UNEXPECTED);
60262 return;
60263 }
60264 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60265 if (!JS::Call(cx, thisValue, callable,
60266 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60267 aRv.NoteJSContextException(cx);
60268 return;
60269 }
60270}
60271
60272void
60273TestJSImplInterfaceJSImpl::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60274{
60275 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60276 if (aRv.Failed()) {
60277 return;
60278 }
60279 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60279); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60280 BindingCallContext& cx = s.GetCallContext();
60281
60282 JS::Rooted<JS::Value> rval(cx);
60283 JS::RootedVector<JS::Value> argv(cx);
60284 if (!argv.resize(1)) {
60285 // That threw an exception on the JSContext, and our CallSetup will do
60286 // the right thing with that.
60287 return;
60288 }
60289 unsigned argc = 1;
60290
60291 do {
60292
60293 uint32_t length = arg.Length();
60294 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60295 if (!returnArray) {
60296 aRv.Throw(NS_ERROR_UNEXPECTED);
60297 return;
60298 }
60299 // Scope for 'tmp'
60300 {
60301 JS::Rooted<JS::Value> tmp(cx);
60302 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60303 // Control block to let us common up the JS_DefineElement calls when there
60304 // are different ways to succeed at wrapping the object.
60305 do {
60306
60307 if (arg[sequenceIdx0].IsNull()) {
60308 tmp.setNull();
60309 break;
60310 }
60311
60312 uint32_t length = arg[sequenceIdx0].Value().Length();
60313 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60314 if (!returnArray) {
60315 aRv.Throw(NS_ERROR_UNEXPECTED);
60316 return;
60317 }
60318 // Scope for 'tmp'
60319 {
60320 JS::Rooted<JS::Value> tmp(cx);
60321 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60322 // Control block to let us common up the JS_DefineElement calls when there
60323 // are different ways to succeed at wrapping the object.
60324 do {
60325 JS::ExposeValueToActiveJS(arg[sequenceIdx0].Value()[sequenceIdx1]);
60326 tmp.set(arg[sequenceIdx0].Value()[sequenceIdx1]);
60327 if (!MaybeWrapValue(cx, &tmp)) {
60328 aRv.Throw(NS_ERROR_UNEXPECTED);
60329 return;
60330 }
60331 break;
60332 } while (false);
60333 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60334 JSPROP_ENUMERATE)) {
60335 aRv.Throw(NS_ERROR_UNEXPECTED);
60336 return;
60337 }
60338 }
60339 }
60340 tmp.setObject(*returnArray);
60341 break;
60342 } while (false);
60343 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60344 JSPROP_ENUMERATE)) {
60345 aRv.Throw(NS_ERROR_UNEXPECTED);
60346 return;
60347 }
60348 }
60349 }
60350 argv[0].setObject(*returnArray);
60351 break;
60352 } while (false);
60353
60354 JS::Rooted<JS::Value> callable(cx);
60355 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60356 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60357 !InitIds(cx, atomsCache)) ||
60358 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableSequenceOfAny_id, &callable)) {
60359 aRv.Throw(NS_ERROR_UNEXPECTED);
60360 return;
60361 }
60362 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60363 if (!JS::Call(cx, thisValue, callable,
60364 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60365 aRv.NoteJSContextException(cx);
60366 return;
60367 }
60368}
60369
60370void
60371TestJSImplInterfaceJSImpl::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60372{
60373 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60374 if (aRv.Failed()) {
60375 return;
60376 }
60377 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60377); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60377); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60378 BindingCallContext& cx = s.GetCallContext();
60379
60380 JS::Rooted<JS::Value> rval(cx);
60381 JS::RootedVector<JS::Value> argv(cx);
60382 if (!argv.resize(1)) {
60383 // That threw an exception on the JSContext, and our CallSetup will do
60384 // the right thing with that.
60385 return;
60386 }
60387 unsigned argc = 1;
60388
60389 do {
60390
60391 if (arg.IsNull()) {
60392 argv[0].setNull();
60393 break;
60394 }
60395
60396 uint32_t length = arg.Value().Length();
60397 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60398 if (!returnArray) {
60399 aRv.Throw(NS_ERROR_UNEXPECTED);
60400 return;
60401 }
60402 // Scope for 'tmp'
60403 {
60404 JS::Rooted<JS::Value> tmp(cx);
60405 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60406 // Control block to let us common up the JS_DefineElement calls when there
60407 // are different ways to succeed at wrapping the object.
60408 do {
60409
60410 if (arg.Value()[sequenceIdx0].IsNull()) {
60411 tmp.setNull();
60412 break;
60413 }
60414
60415 uint32_t length = arg.Value()[sequenceIdx0].Value().Length();
60416 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60417 if (!returnArray) {
60418 aRv.Throw(NS_ERROR_UNEXPECTED);
60419 return;
60420 }
60421 // Scope for 'tmp'
60422 {
60423 JS::Rooted<JS::Value> tmp(cx);
60424 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60425 // Control block to let us common up the JS_DefineElement calls when there
60426 // are different ways to succeed at wrapping the object.
60427 do {
60428 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]);
60429 tmp.set(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]);
60430 if (!MaybeWrapValue(cx, &tmp)) {
60431 aRv.Throw(NS_ERROR_UNEXPECTED);
60432 return;
60433 }
60434 break;
60435 } while (false);
60436 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60437 JSPROP_ENUMERATE)) {
60438 aRv.Throw(NS_ERROR_UNEXPECTED);
60439 return;
60440 }
60441 }
60442 }
60443 tmp.setObject(*returnArray);
60444 break;
60445 } while (false);
60446 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60447 JSPROP_ENUMERATE)) {
60448 aRv.Throw(NS_ERROR_UNEXPECTED);
60449 return;
60450 }
60451 }
60452 }
60453 argv[0].setObject(*returnArray);
60454 break;
60455 } while (false);
60456
60457 JS::Rooted<JS::Value> callable(cx);
60458 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60459 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60460 !InitIds(cx, atomsCache)) ||
60461 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfNullableSequenceOfAny_id, &callable)) {
60462 aRv.Throw(NS_ERROR_UNEXPECTED);
60463 return;
60464 }
60465 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60466 if (!JS::Call(cx, thisValue, callable,
60467 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60468 aRv.NoteJSContextException(cx);
60469 return;
60470 }
60471}
60472
60473void
60474TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60475{
60476 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60477 if (aRv.Failed()) {
60478 return;
60479 }
60480 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60480); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60480); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60481 BindingCallContext& cx = s.GetCallContext();
60482
60483 JS::Rooted<JS::Value> rval(cx);
60484 JS::RootedVector<JS::Value> argv(cx);
60485 if (!argv.resize(1)) {
60486 // That threw an exception on the JSContext, and our CallSetup will do
60487 // the right thing with that.
60488 return;
60489 }
60490 unsigned argc = 1;
60491
60492 do {
60493 if (arg.WasPassed()) {
60494
60495 if (arg.Value().IsNull()) {
60496 argv[0].setNull();
60497 break;
60498 }
60499
60500 uint32_t length = arg.Value().Value().Length();
60501 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60502 if (!returnArray) {
60503 aRv.Throw(NS_ERROR_UNEXPECTED);
60504 return;
60505 }
60506 // Scope for 'tmp'
60507 {
60508 JS::Rooted<JS::Value> tmp(cx);
60509 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60510 // Control block to let us common up the JS_DefineElement calls when there
60511 // are different ways to succeed at wrapping the object.
60512 do {
60513
60514 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
60515 tmp.setNull();
60516 break;
60517 }
60518
60519 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
60520 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60521 if (!returnArray) {
60522 aRv.Throw(NS_ERROR_UNEXPECTED);
60523 return;
60524 }
60525 // Scope for 'tmp'
60526 {
60527 JS::Rooted<JS::Value> tmp(cx);
60528 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60529 // Control block to let us common up the JS_DefineElement calls when there
60530 // are different ways to succeed at wrapping the object.
60531 do {
60532 JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
60533 tmp.set(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
60534 if (!MaybeWrapValue(cx, &tmp)) {
60535 aRv.Throw(NS_ERROR_UNEXPECTED);
60536 return;
60537 }
60538 break;
60539 } while (false);
60540 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60541 JSPROP_ENUMERATE)) {
60542 aRv.Throw(NS_ERROR_UNEXPECTED);
60543 return;
60544 }
60545 }
60546 }
60547 tmp.setObject(*returnArray);
60548 break;
60549 } while (false);
60550 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60551 JSPROP_ENUMERATE)) {
60552 aRv.Throw(NS_ERROR_UNEXPECTED);
60553 return;
60554 }
60555 }
60556 }
60557 argv[0].setObject(*returnArray);
60558 break;
60559 } else if (argc == 1) {
60560 // This is our current trailing argument; reduce argc
60561 --argc;
60562 } else {
60563 argv[0].setUndefined();
60564 }
60565 } while (false);
60566
60567 JS::Rooted<JS::Value> callable(cx);
60568 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60569 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60570 !InitIds(cx, atomsCache)) ||
60571 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id, &callable)) {
60572 aRv.Throw(NS_ERROR_UNEXPECTED);
60573 return;
60574 }
60575 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60576 if (!JS::Call(cx, thisValue, callable,
60577 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60578 aRv.NoteJSContextException(cx);
60579 return;
60580 }
60581}
60582
60583void
60584TestJSImplInterfaceJSImpl::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60585{
60586 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60587 if (aRv.Failed()) {
60588 return;
60589 }
60590 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60590); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60590); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60591 BindingCallContext& cx = s.GetCallContext();
60592
60593 JS::Rooted<JS::Value> rval(cx);
60594 JS::RootedVector<JS::Value> argv(cx);
60595 if (!argv.resize(1)) {
60596 // That threw an exception on the JSContext, and our CallSetup will do
60597 // the right thing with that.
60598 return;
60599 }
60600 unsigned argc = 1;
60601
60602 do {
60603
60604 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60605 if (!returnObj) {
60606 aRv.Throw(NS_ERROR_UNEXPECTED);
60607 return;
60608 }
60609 // Scope for 'tmp'
60610 {
60611 JS::Rooted<JS::Value> tmp(cx);
60612 for (auto& entry : arg.Entries()) {
60613 auto& recordValue0 = entry.mValue;
60614 // Control block to let us common up the JS_DefineUCProperty calls when there
60615 // are different ways to succeed at wrapping the value.
60616 do {
60617 JS::ExposeValueToActiveJS(recordValue0);
60618 tmp.set(recordValue0);
60619 if (!MaybeWrapValue(cx, &tmp)) {
60620 aRv.Throw(NS_ERROR_UNEXPECTED);
60621 return;
60622 }
60623 break;
60624 } while (false);
60625 if (!JS_DefineUCProperty(cx, returnObj,
60626 entry.mKey.BeginReading(),
60627 entry.mKey.Length(), tmp,
60628 JSPROP_ENUMERATE)) {
60629 aRv.Throw(NS_ERROR_UNEXPECTED);
60630 return;
60631 }
60632 }
60633 }
60634 argv[0].setObject(*returnObj);
60635 break;
60636 } while (false);
60637
60638 JS::Rooted<JS::Value> callable(cx);
60639 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60640 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60641 !InitIds(cx, atomsCache)) ||
60642 !GetCallableProperty(cx, atomsCache->passRecordOfAny_id, &callable)) {
60643 aRv.Throw(NS_ERROR_UNEXPECTED);
60644 return;
60645 }
60646 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60647 if (!JS::Call(cx, thisValue, callable,
60648 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60649 aRv.NoteJSContextException(cx);
60650 return;
60651 }
60652}
60653
60654void
60655TestJSImplInterfaceJSImpl::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60656{
60657 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60658 if (aRv.Failed()) {
60659 return;
60660 }
60661 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60661); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60661); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60662 BindingCallContext& cx = s.GetCallContext();
60663
60664 JS::Rooted<JS::Value> rval(cx);
60665 JS::RootedVector<JS::Value> argv(cx);
60666 if (!argv.resize(1)) {
60667 // That threw an exception on the JSContext, and our CallSetup will do
60668 // the right thing with that.
60669 return;
60670 }
60671 unsigned argc = 1;
60672
60673 do {
60674
60675 if (arg.IsNull()) {
60676 argv[0].setNull();
60677 break;
60678 }
60679
60680 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60681 if (!returnObj) {
60682 aRv.Throw(NS_ERROR_UNEXPECTED);
60683 return;
60684 }
60685 // Scope for 'tmp'
60686 {
60687 JS::Rooted<JS::Value> tmp(cx);
60688 for (auto& entry : arg.Value().Entries()) {
60689 auto& recordValue0 = entry.mValue;
60690 // Control block to let us common up the JS_DefineUCProperty calls when there
60691 // are different ways to succeed at wrapping the value.
60692 do {
60693 JS::ExposeValueToActiveJS(recordValue0);
60694 tmp.set(recordValue0);
60695 if (!MaybeWrapValue(cx, &tmp)) {
60696 aRv.Throw(NS_ERROR_UNEXPECTED);
60697 return;
60698 }
60699 break;
60700 } while (false);
60701 if (!JS_DefineUCProperty(cx, returnObj,
60702 entry.mKey.BeginReading(),
60703 entry.mKey.Length(), tmp,
60704 JSPROP_ENUMERATE)) {
60705 aRv.Throw(NS_ERROR_UNEXPECTED);
60706 return;
60707 }
60708 }
60709 }
60710 argv[0].setObject(*returnObj);
60711 break;
60712 } while (false);
60713
60714 JS::Rooted<JS::Value> callable(cx);
60715 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60716 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60717 !InitIds(cx, atomsCache)) ||
60718 !GetCallableProperty(cx, atomsCache->passNullableRecordOfAny_id, &callable)) {
60719 aRv.Throw(NS_ERROR_UNEXPECTED);
60720 return;
60721 }
60722 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60723 if (!JS::Call(cx, thisValue, callable,
60724 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60725 aRv.NoteJSContextException(cx);
60726 return;
60727 }
60728}
60729
60730void
60731TestJSImplInterfaceJSImpl::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60732{
60733 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60734 if (aRv.Failed()) {
60735 return;
60736 }
60737 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60737); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60737); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60738 BindingCallContext& cx = s.GetCallContext();
60739
60740 JS::Rooted<JS::Value> rval(cx);
60741 JS::RootedVector<JS::Value> argv(cx);
60742 if (!argv.resize(1)) {
60743 // That threw an exception on the JSContext, and our CallSetup will do
60744 // the right thing with that.
60745 return;
60746 }
60747 unsigned argc = 1;
60748
60749 do {
60750 if (arg.WasPassed()) {
60751
60752 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60753 if (!returnObj) {
60754 aRv.Throw(NS_ERROR_UNEXPECTED);
60755 return;
60756 }
60757 // Scope for 'tmp'
60758 {
60759 JS::Rooted<JS::Value> tmp(cx);
60760 for (auto& entry : arg.Value().Entries()) {
60761 auto& recordValue0 = entry.mValue;
60762 // Control block to let us common up the JS_DefineUCProperty calls when there
60763 // are different ways to succeed at wrapping the value.
60764 do {
60765 JS::ExposeValueToActiveJS(recordValue0);
60766 tmp.set(recordValue0);
60767 if (!MaybeWrapValue(cx, &tmp)) {
60768 aRv.Throw(NS_ERROR_UNEXPECTED);
60769 return;
60770 }
60771 break;
60772 } while (false);
60773 if (!JS_DefineUCProperty(cx, returnObj,
60774 entry.mKey.BeginReading(),
60775 entry.mKey.Length(), tmp,
60776 JSPROP_ENUMERATE)) {
60777 aRv.Throw(NS_ERROR_UNEXPECTED);
60778 return;
60779 }
60780 }
60781 }
60782 argv[0].setObject(*returnObj);
60783 break;
60784 } else if (argc == 1) {
60785 // This is our current trailing argument; reduce argc
60786 --argc;
60787 } else {
60788 argv[0].setUndefined();
60789 }
60790 } while (false);
60791
60792 JS::Rooted<JS::Value> callable(cx);
60793 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60794 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60795 !InitIds(cx, atomsCache)) ||
60796 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAny_id, &callable)) {
60797 aRv.Throw(NS_ERROR_UNEXPECTED);
60798 return;
60799 }
60800 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60801 if (!JS::Call(cx, thisValue, callable,
60802 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60803 aRv.NoteJSContextException(cx);
60804 return;
60805 }
60806}
60807
60808void
60809TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60810{
60811 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60812 if (aRv.Failed()) {
60813 return;
60814 }
60815 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60815); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60816 BindingCallContext& cx = s.GetCallContext();
60817
60818 JS::Rooted<JS::Value> rval(cx);
60819 JS::RootedVector<JS::Value> argv(cx);
60820 if (!argv.resize(1)) {
60821 // That threw an exception on the JSContext, and our CallSetup will do
60822 // the right thing with that.
60823 return;
60824 }
60825 unsigned argc = 1;
60826
60827 do {
60828 if (arg.WasPassed()) {
60829
60830 if (arg.Value().IsNull()) {
60831 argv[0].setNull();
60832 break;
60833 }
60834
60835 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60836 if (!returnObj) {
60837 aRv.Throw(NS_ERROR_UNEXPECTED);
60838 return;
60839 }
60840 // Scope for 'tmp'
60841 {
60842 JS::Rooted<JS::Value> tmp(cx);
60843 for (auto& entry : arg.Value().Value().Entries()) {
60844 auto& recordValue0 = entry.mValue;
60845 // Control block to let us common up the JS_DefineUCProperty calls when there
60846 // are different ways to succeed at wrapping the value.
60847 do {
60848 JS::ExposeValueToActiveJS(recordValue0);
60849 tmp.set(recordValue0);
60850 if (!MaybeWrapValue(cx, &tmp)) {
60851 aRv.Throw(NS_ERROR_UNEXPECTED);
60852 return;
60853 }
60854 break;
60855 } while (false);
60856 if (!JS_DefineUCProperty(cx, returnObj,
60857 entry.mKey.BeginReading(),
60858 entry.mKey.Length(), tmp,
60859 JSPROP_ENUMERATE)) {
60860 aRv.Throw(NS_ERROR_UNEXPECTED);
60861 return;
60862 }
60863 }
60864 }
60865 argv[0].setObject(*returnObj);
60866 break;
60867 } else if (argc == 1) {
60868 // This is our current trailing argument; reduce argc
60869 --argc;
60870 } else {
60871 argv[0].setUndefined();
60872 }
60873 } while (false);
60874
60875 JS::Rooted<JS::Value> callable(cx);
60876 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60877 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60878 !InitIds(cx, atomsCache)) ||
60879 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfAny_id, &callable)) {
60880 aRv.Throw(NS_ERROR_UNEXPECTED);
60881 return;
60882 }
60883 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60884 if (!JS::Call(cx, thisValue, callable,
60885 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60886 aRv.NoteJSContextException(cx);
60887 return;
60888 }
60889}
60890
60891void
60892TestJSImplInterfaceJSImpl::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60893{
60894 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60895 if (aRv.Failed()) {
60896 return;
60897 }
60898 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60898); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60898); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60899 BindingCallContext& cx = s.GetCallContext();
60900
60901 JS::Rooted<JS::Value> rval(cx);
60902 JS::RootedVector<JS::Value> argv(cx);
60903 if (!argv.resize(1)) {
60904 // That threw an exception on the JSContext, and our CallSetup will do
60905 // the right thing with that.
60906 return;
60907 }
60908 unsigned argc = 1;
60909
60910 do {
60911
60912 if (arg.IsNull()) {
60913 argv[0].setNull();
60914 break;
60915 }
60916
60917 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60918 if (!returnObj) {
60919 aRv.Throw(NS_ERROR_UNEXPECTED);
60920 return;
60921 }
60922 // Scope for 'tmp'
60923 {
60924 JS::Rooted<JS::Value> tmp(cx);
60925 for (auto& entry : arg.Value().Entries()) {
60926 auto& recordValue0 = entry.mValue;
60927 // Control block to let us common up the JS_DefineUCProperty calls when there
60928 // are different ways to succeed at wrapping the value.
60929 do {
60930 JS::ExposeValueToActiveJS(recordValue0);
60931 tmp.set(recordValue0);
60932 if (!MaybeWrapValue(cx, &tmp)) {
60933 aRv.Throw(NS_ERROR_UNEXPECTED);
60934 return;
60935 }
60936 break;
60937 } while (false);
60938 if (!JS_DefineUCProperty(cx, returnObj,
60939 entry.mKey.BeginReading(),
60940 entry.mKey.Length(), tmp,
60941 JSPROP_ENUMERATE)) {
60942 aRv.Throw(NS_ERROR_UNEXPECTED);
60943 return;
60944 }
60945 }
60946 }
60947 argv[0].setObject(*returnObj);
60948 break;
60949 } while (false);
60950
60951 JS::Rooted<JS::Value> callable(cx);
60952 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60953 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60954 !InitIds(cx, atomsCache)) ||
60955 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAnyWithDefaultValue_id, &callable)) {
60956 aRv.Throw(NS_ERROR_UNEXPECTED);
60957 return;
60958 }
60959 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60960 if (!JS::Call(cx, thisValue, callable,
60961 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60962 aRv.NoteJSContextException(cx);
60963 return;
60964 }
60965}
60966
60967void
60968TestJSImplInterfaceJSImpl::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60969{
60970 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60971 if (aRv.Failed()) {
60972 return;
60973 }
60974 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 60974); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
60975 BindingCallContext& cx = s.GetCallContext();
60976
60977 JS::Rooted<JS::Value> rval(cx);
60978 JS::RootedVector<JS::Value> argv(cx);
60979 if (!argv.resize(1)) {
60980 // That threw an exception on the JSContext, and our CallSetup will do
60981 // the right thing with that.
60982 return;
60983 }
60984 unsigned argc = 1;
60985
60986 do {
60987
60988 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60989 if (!returnObj) {
60990 aRv.Throw(NS_ERROR_UNEXPECTED);
60991 return;
60992 }
60993 // Scope for 'tmp'
60994 {
60995 JS::Rooted<JS::Value> tmp(cx);
60996 for (auto& entry : arg.Entries()) {
60997 auto& recordValue0 = entry.mValue;
60998 // Control block to let us common up the JS_DefineUCProperty calls when there
60999 // are different ways to succeed at wrapping the value.
61000 do {
61001
61002 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61003 if (!returnObj) {
61004 aRv.Throw(NS_ERROR_UNEXPECTED);
61005 return;
61006 }
61007 // Scope for 'tmp'
61008 {
61009 JS::Rooted<JS::Value> tmp(cx);
61010 for (auto& entry : recordValue0.Entries()) {
61011 auto& recordValue1 = entry.mValue;
61012 // Control block to let us common up the JS_DefineUCProperty calls when there
61013 // are different ways to succeed at wrapping the value.
61014 do {
61015 JS::ExposeValueToActiveJS(recordValue1);
61016 tmp.set(recordValue1);
61017 if (!MaybeWrapValue(cx, &tmp)) {
61018 aRv.Throw(NS_ERROR_UNEXPECTED);
61019 return;
61020 }
61021 break;
61022 } while (false);
61023 if (!JS_DefineUCProperty(cx, returnObj,
61024 entry.mKey.BeginReading(),
61025 entry.mKey.Length(), tmp,
61026 JSPROP_ENUMERATE)) {
61027 aRv.Throw(NS_ERROR_UNEXPECTED);
61028 return;
61029 }
61030 }
61031 }
61032 tmp.setObject(*returnObj);
61033 break;
61034 } while (false);
61035 if (!JS_DefineUCProperty(cx, returnObj,
61036 entry.mKey.BeginReading(),
61037 entry.mKey.Length(), tmp,
61038 JSPROP_ENUMERATE)) {
61039 aRv.Throw(NS_ERROR_UNEXPECTED);
61040 return;
61041 }
61042 }
61043 }
61044 argv[0].setObject(*returnObj);
61045 break;
61046 } while (false);
61047
61048 JS::Rooted<JS::Value> callable(cx);
61049 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61050 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61051 !InitIds(cx, atomsCache)) ||
61052 !GetCallableProperty(cx, atomsCache->passRecordOfRecordOfAny_id, &callable)) {
61053 aRv.Throw(NS_ERROR_UNEXPECTED);
61054 return;
61055 }
61056 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61057 if (!JS::Call(cx, thisValue, callable,
61058 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61059 aRv.NoteJSContextException(cx);
61060 return;
61061 }
61062}
61063
61064void
61065TestJSImplInterfaceJSImpl::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61066{
61067 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61068 if (aRv.Failed()) {
61069 return;
61070 }
61071 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61071); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61071); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61072 BindingCallContext& cx = s.GetCallContext();
61073
61074 JS::Rooted<JS::Value> rval(cx);
61075 JS::RootedVector<JS::Value> argv(cx);
61076 if (!argv.resize(1)) {
61077 // That threw an exception on the JSContext, and our CallSetup will do
61078 // the right thing with that.
61079 return;
61080 }
61081 unsigned argc = 1;
61082
61083 do {
61084
61085 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61086 if (!returnObj) {
61087 aRv.Throw(NS_ERROR_UNEXPECTED);
61088 return;
61089 }
61090 // Scope for 'tmp'
61091 {
61092 JS::Rooted<JS::Value> tmp(cx);
61093 for (auto& entry : arg.Entries()) {
61094 auto& recordValue0 = entry.mValue;
61095 // Control block to let us common up the JS_DefineUCProperty calls when there
61096 // are different ways to succeed at wrapping the value.
61097 do {
61098
61099 if (recordValue0.IsNull()) {
61100 tmp.setNull();
61101 break;
61102 }
61103
61104 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61105 if (!returnObj) {
61106 aRv.Throw(NS_ERROR_UNEXPECTED);
61107 return;
61108 }
61109 // Scope for 'tmp'
61110 {
61111 JS::Rooted<JS::Value> tmp(cx);
61112 for (auto& entry : recordValue0.Value().Entries()) {
61113 auto& recordValue1 = entry.mValue;
61114 // Control block to let us common up the JS_DefineUCProperty calls when there
61115 // are different ways to succeed at wrapping the value.
61116 do {
61117 JS::ExposeValueToActiveJS(recordValue1);
61118 tmp.set(recordValue1);
61119 if (!MaybeWrapValue(cx, &tmp)) {
61120 aRv.Throw(NS_ERROR_UNEXPECTED);
61121 return;
61122 }
61123 break;
61124 } while (false);
61125 if (!JS_DefineUCProperty(cx, returnObj,
61126 entry.mKey.BeginReading(),
61127 entry.mKey.Length(), tmp,
61128 JSPROP_ENUMERATE)) {
61129 aRv.Throw(NS_ERROR_UNEXPECTED);
61130 return;
61131 }
61132 }
61133 }
61134 tmp.setObject(*returnObj);
61135 break;
61136 } while (false);
61137 if (!JS_DefineUCProperty(cx, returnObj,
61138 entry.mKey.BeginReading(),
61139 entry.mKey.Length(), tmp,
61140 JSPROP_ENUMERATE)) {
61141 aRv.Throw(NS_ERROR_UNEXPECTED);
61142 return;
61143 }
61144 }
61145 }
61146 argv[0].setObject(*returnObj);
61147 break;
61148 } while (false);
61149
61150 JS::Rooted<JS::Value> callable(cx);
61151 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61152 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61153 !InitIds(cx, atomsCache)) ||
61154 !GetCallableProperty(cx, atomsCache->passRecordOfNullableRecordOfAny_id, &callable)) {
61155 aRv.Throw(NS_ERROR_UNEXPECTED);
61156 return;
61157 }
61158 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61159 if (!JS::Call(cx, thisValue, callable,
61160 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61161 aRv.NoteJSContextException(cx);
61162 return;
61163 }
61164}
61165
61166void
61167TestJSImplInterfaceJSImpl::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61168{
61169 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61170 if (aRv.Failed()) {
61171 return;
61172 }
61173 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61173); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61173); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61174 BindingCallContext& cx = s.GetCallContext();
61175
61176 JS::Rooted<JS::Value> rval(cx);
61177 JS::RootedVector<JS::Value> argv(cx);
61178 if (!argv.resize(1)) {
61179 // That threw an exception on the JSContext, and our CallSetup will do
61180 // the right thing with that.
61181 return;
61182 }
61183 unsigned argc = 1;
61184
61185 do {
61186
61187 if (arg.IsNull()) {
61188 argv[0].setNull();
61189 break;
61190 }
61191
61192 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61193 if (!returnObj) {
61194 aRv.Throw(NS_ERROR_UNEXPECTED);
61195 return;
61196 }
61197 // Scope for 'tmp'
61198 {
61199 JS::Rooted<JS::Value> tmp(cx);
61200 for (auto& entry : arg.Value().Entries()) {
61201 auto& recordValue0 = entry.mValue;
61202 // Control block to let us common up the JS_DefineUCProperty calls when there
61203 // are different ways to succeed at wrapping the value.
61204 do {
61205
61206 if (recordValue0.IsNull()) {
61207 tmp.setNull();
61208 break;
61209 }
61210
61211 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61212 if (!returnObj) {
61213 aRv.Throw(NS_ERROR_UNEXPECTED);
61214 return;
61215 }
61216 // Scope for 'tmp'
61217 {
61218 JS::Rooted<JS::Value> tmp(cx);
61219 for (auto& entry : recordValue0.Value().Entries()) {
61220 auto& recordValue1 = entry.mValue;
61221 // Control block to let us common up the JS_DefineUCProperty calls when there
61222 // are different ways to succeed at wrapping the value.
61223 do {
61224 JS::ExposeValueToActiveJS(recordValue1);
61225 tmp.set(recordValue1);
61226 if (!MaybeWrapValue(cx, &tmp)) {
61227 aRv.Throw(NS_ERROR_UNEXPECTED);
61228 return;
61229 }
61230 break;
61231 } while (false);
61232 if (!JS_DefineUCProperty(cx, returnObj,
61233 entry.mKey.BeginReading(),
61234 entry.mKey.Length(), tmp,
61235 JSPROP_ENUMERATE)) {
61236 aRv.Throw(NS_ERROR_UNEXPECTED);
61237 return;
61238 }
61239 }
61240 }
61241 tmp.setObject(*returnObj);
61242 break;
61243 } while (false);
61244 if (!JS_DefineUCProperty(cx, returnObj,
61245 entry.mKey.BeginReading(),
61246 entry.mKey.Length(), tmp,
61247 JSPROP_ENUMERATE)) {
61248 aRv.Throw(NS_ERROR_UNEXPECTED);
61249 return;
61250 }
61251 }
61252 }
61253 argv[0].setObject(*returnObj);
61254 break;
61255 } while (false);
61256
61257 JS::Rooted<JS::Value> callable(cx);
61258 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61259 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61260 !InitIds(cx, atomsCache)) ||
61261 !GetCallableProperty(cx, atomsCache->passNullableRecordOfNullableRecordOfAny_id, &callable)) {
61262 aRv.Throw(NS_ERROR_UNEXPECTED);
61263 return;
61264 }
61265 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61266 if (!JS::Call(cx, thisValue, callable,
61267 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61268 aRv.NoteJSContextException(cx);
61269 return;
61270 }
61271}
61272
61273void
61274TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61275{
61276 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61277 if (aRv.Failed()) {
61278 return;
61279 }
61280 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61280); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61280); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61281 BindingCallContext& cx = s.GetCallContext();
61282
61283 JS::Rooted<JS::Value> rval(cx);
61284 JS::RootedVector<JS::Value> argv(cx);
61285 if (!argv.resize(1)) {
61286 // That threw an exception on the JSContext, and our CallSetup will do
61287 // the right thing with that.
61288 return;
61289 }
61290 unsigned argc = 1;
61291
61292 do {
61293 if (arg.WasPassed()) {
61294
61295 if (arg.Value().IsNull()) {
61296 argv[0].setNull();
61297 break;
61298 }
61299
61300 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61301 if (!returnObj) {
61302 aRv.Throw(NS_ERROR_UNEXPECTED);
61303 return;
61304 }
61305 // Scope for 'tmp'
61306 {
61307 JS::Rooted<JS::Value> tmp(cx);
61308 for (auto& entry : arg.Value().Value().Entries()) {
61309 auto& recordValue0 = entry.mValue;
61310 // Control block to let us common up the JS_DefineUCProperty calls when there
61311 // are different ways to succeed at wrapping the value.
61312 do {
61313
61314 if (recordValue0.IsNull()) {
61315 tmp.setNull();
61316 break;
61317 }
61318
61319 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61320 if (!returnObj) {
61321 aRv.Throw(NS_ERROR_UNEXPECTED);
61322 return;
61323 }
61324 // Scope for 'tmp'
61325 {
61326 JS::Rooted<JS::Value> tmp(cx);
61327 for (auto& entry : recordValue0.Value().Entries()) {
61328 auto& recordValue1 = entry.mValue;
61329 // Control block to let us common up the JS_DefineUCProperty calls when there
61330 // are different ways to succeed at wrapping the value.
61331 do {
61332 JS::ExposeValueToActiveJS(recordValue1);
61333 tmp.set(recordValue1);
61334 if (!MaybeWrapValue(cx, &tmp)) {
61335 aRv.Throw(NS_ERROR_UNEXPECTED);
61336 return;
61337 }
61338 break;
61339 } while (false);
61340 if (!JS_DefineUCProperty(cx, returnObj,
61341 entry.mKey.BeginReading(),
61342 entry.mKey.Length(), tmp,
61343 JSPROP_ENUMERATE)) {
61344 aRv.Throw(NS_ERROR_UNEXPECTED);
61345 return;
61346 }
61347 }
61348 }
61349 tmp.setObject(*returnObj);
61350 break;
61351 } while (false);
61352 if (!JS_DefineUCProperty(cx, returnObj,
61353 entry.mKey.BeginReading(),
61354 entry.mKey.Length(), tmp,
61355 JSPROP_ENUMERATE)) {
61356 aRv.Throw(NS_ERROR_UNEXPECTED);
61357 return;
61358 }
61359 }
61360 }
61361 argv[0].setObject(*returnObj);
61362 break;
61363 } else if (argc == 1) {
61364 // This is our current trailing argument; reduce argc
61365 --argc;
61366 } else {
61367 argv[0].setUndefined();
61368 }
61369 } while (false);
61370
61371 JS::Rooted<JS::Value> callable(cx);
61372 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61373 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61374 !InitIds(cx, atomsCache)) ||
61375 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id, &callable)) {
61376 aRv.Throw(NS_ERROR_UNEXPECTED);
61377 return;
61378 }
61379 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61380 if (!JS::Call(cx, thisValue, callable,
61381 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61382 aRv.NoteJSContextException(cx);
61383 return;
61384 }
61385}
61386
61387void
61388TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61389{
61390 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61391 if (aRv.Failed()) {
61392 return;
61393 }
61394 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61394); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61394); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61395 BindingCallContext& cx = s.GetCallContext();
61396
61397 JS::Rooted<JS::Value> rval(cx);
61398 JS::RootedVector<JS::Value> argv(cx);
61399 if (!argv.resize(1)) {
61400 // That threw an exception on the JSContext, and our CallSetup will do
61401 // the right thing with that.
61402 return;
61403 }
61404 unsigned argc = 1;
61405
61406 do {
61407 if (arg.WasPassed()) {
61408
61409 if (arg.Value().IsNull()) {
61410 argv[0].setNull();
61411 break;
61412 }
61413
61414 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61415 if (!returnObj) {
61416 aRv.Throw(NS_ERROR_UNEXPECTED);
61417 return;
61418 }
61419 // Scope for 'tmp'
61420 {
61421 JS::Rooted<JS::Value> tmp(cx);
61422 for (auto& entry : arg.Value().Value().Entries()) {
61423 auto& recordValue0 = entry.mValue;
61424 // Control block to let us common up the JS_DefineUCProperty calls when there
61425 // are different ways to succeed at wrapping the value.
61426 do {
61427
61428 if (recordValue0.IsNull()) {
61429 tmp.setNull();
61430 break;
61431 }
61432
61433 uint32_t length = recordValue0.Value().Length();
61434 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61435 if (!returnArray) {
61436 aRv.Throw(NS_ERROR_UNEXPECTED);
61437 return;
61438 }
61439 // Scope for 'tmp'
61440 {
61441 JS::Rooted<JS::Value> tmp(cx);
61442 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61443 // Control block to let us common up the JS_DefineElement calls when there
61444 // are different ways to succeed at wrapping the object.
61445 do {
61446 JS::ExposeValueToActiveJS(recordValue0.Value()[sequenceIdx0]);
61447 tmp.set(recordValue0.Value()[sequenceIdx0]);
61448 if (!MaybeWrapValue(cx, &tmp)) {
61449 aRv.Throw(NS_ERROR_UNEXPECTED);
61450 return;
61451 }
61452 break;
61453 } while (false);
61454 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61455 JSPROP_ENUMERATE)) {
61456 aRv.Throw(NS_ERROR_UNEXPECTED);
61457 return;
61458 }
61459 }
61460 }
61461 tmp.setObject(*returnArray);
61462 break;
61463 } while (false);
61464 if (!JS_DefineUCProperty(cx, returnObj,
61465 entry.mKey.BeginReading(),
61466 entry.mKey.Length(), tmp,
61467 JSPROP_ENUMERATE)) {
61468 aRv.Throw(NS_ERROR_UNEXPECTED);
61469 return;
61470 }
61471 }
61472 }
61473 argv[0].setObject(*returnObj);
61474 break;
61475 } else if (argc == 1) {
61476 // This is our current trailing argument; reduce argc
61477 --argc;
61478 } else {
61479 argv[0].setUndefined();
61480 }
61481 } while (false);
61482
61483 JS::Rooted<JS::Value> callable(cx);
61484 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61485 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61486 !InitIds(cx, atomsCache)) ||
61487 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id, &callable)) {
61488 aRv.Throw(NS_ERROR_UNEXPECTED);
61489 return;
61490 }
61491 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61492 if (!JS::Call(cx, thisValue, callable,
61493 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61494 aRv.NoteJSContextException(cx);
61495 return;
61496 }
61497}
61498
61499void
61500TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61501{
61502 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61503 if (aRv.Failed()) {
61504 return;
61505 }
61506 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61506); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61507 BindingCallContext& cx = s.GetCallContext();
61508
61509 JS::Rooted<JS::Value> rval(cx);
61510 JS::RootedVector<JS::Value> argv(cx);
61511 if (!argv.resize(1)) {
61512 // That threw an exception on the JSContext, and our CallSetup will do
61513 // the right thing with that.
61514 return;
61515 }
61516 unsigned argc = 1;
61517
61518 do {
61519 if (arg.WasPassed()) {
61520
61521 if (arg.Value().IsNull()) {
61522 argv[0].setNull();
61523 break;
61524 }
61525
61526 uint32_t length = arg.Value().Value().Length();
61527 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61528 if (!returnArray) {
61529 aRv.Throw(NS_ERROR_UNEXPECTED);
61530 return;
61531 }
61532 // Scope for 'tmp'
61533 {
61534 JS::Rooted<JS::Value> tmp(cx);
61535 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61536 // Control block to let us common up the JS_DefineElement calls when there
61537 // are different ways to succeed at wrapping the object.
61538 do {
61539
61540 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
61541 tmp.setNull();
61542 break;
61543 }
61544
61545 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61546 if (!returnObj) {
61547 aRv.Throw(NS_ERROR_UNEXPECTED);
61548 return;
61549 }
61550 // Scope for 'tmp'
61551 {
61552 JS::Rooted<JS::Value> tmp(cx);
61553 for (auto& entry : arg.Value().Value()[sequenceIdx0].Value().Entries()) {
61554 auto& recordValue0 = entry.mValue;
61555 // Control block to let us common up the JS_DefineUCProperty calls when there
61556 // are different ways to succeed at wrapping the value.
61557 do {
61558 JS::ExposeValueToActiveJS(recordValue0);
61559 tmp.set(recordValue0);
61560 if (!MaybeWrapValue(cx, &tmp)) {
61561 aRv.Throw(NS_ERROR_UNEXPECTED);
61562 return;
61563 }
61564 break;
61565 } while (false);
61566 if (!JS_DefineUCProperty(cx, returnObj,
61567 entry.mKey.BeginReading(),
61568 entry.mKey.Length(), tmp,
61569 JSPROP_ENUMERATE)) {
61570 aRv.Throw(NS_ERROR_UNEXPECTED);
61571 return;
61572 }
61573 }
61574 }
61575 tmp.setObject(*returnObj);
61576 break;
61577 } while (false);
61578 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61579 JSPROP_ENUMERATE)) {
61580 aRv.Throw(NS_ERROR_UNEXPECTED);
61581 return;
61582 }
61583 }
61584 }
61585 argv[0].setObject(*returnArray);
61586 break;
61587 } else if (argc == 1) {
61588 // This is our current trailing argument; reduce argc
61589 --argc;
61590 } else {
61591 argv[0].setUndefined();
61592 }
61593 } while (false);
61594
61595 JS::Rooted<JS::Value> callable(cx);
61596 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61597 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61598 !InitIds(cx, atomsCache)) ||
61599 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id, &callable)) {
61600 aRv.Throw(NS_ERROR_UNEXPECTED);
61601 return;
61602 }
61603 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61604 if (!JS::Call(cx, thisValue, callable,
61605 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61606 aRv.NoteJSContextException(cx);
61607 return;
61608 }
61609}
61610
61611void
61612TestJSImplInterfaceJSImpl::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
61613{
61614 CallSetup s(this, aRv, "TestJSImplInterface.receiveAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61615 if (aRv.Failed()) {
61616 return;
61617 }
61618 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61618); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61618); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61619 BindingCallContext& cx = s.GetCallContext();
61620
61621 JS::Rooted<JS::Value> rval(cx);
61622
61623 JS::Rooted<JS::Value> callable(cx);
61624 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61625 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61626 !InitIds(cx, atomsCache)) ||
61627 !GetCallableProperty(cx, atomsCache->receiveAny_id, &callable)) {
61628 aRv.Throw(NS_ERROR_UNEXPECTED);
61629 return;
61630 }
61631 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61632 if (!JS::Call(cx, thisValue, callable,
61633 JS::HandleValueArray::empty(), &rval)) {
61634 aRv.NoteJSContextException(cx);
61635 return;
61636 }
61637 JS::Rooted<JS::Value> rvalDecl(cx);
61638#ifdef __clang__1
61639#pragma clang diagnostic push
61640#pragma clang diagnostic ignored "-Wunreachable-code"
61641#pragma clang diagnostic ignored "-Wunreachable-code-return"
61642#endif // __clang__
61643 if ((false) && !CallerSubsumes(rval)) {
61644 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveAny");
61645 aRv.Throw(NS_ERROR_UNEXPECTED);
61646 return;
61647 }
61648#ifdef __clang__1
61649#pragma clang diagnostic pop
61650#endif // __clang__
61651 rvalDecl = rval;
61652 aRetVal.set(rvalDecl);
61653}
61654
61655void
61656TestJSImplInterfaceJSImpl::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61657{
61658 CallSetup s(this, aRv, "TestJSImplInterface.passObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61659 if (aRv.Failed()) {
61660 return;
61661 }
61662 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61662); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61662); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61663 BindingCallContext& cx = s.GetCallContext();
61664
61665 JS::Rooted<JS::Value> rval(cx);
61666 JS::RootedVector<JS::Value> argv(cx);
61667 if (!argv.resize(1)) {
61668 // That threw an exception on the JSContext, and our CallSetup will do
61669 // the right thing with that.
61670 return;
61671 }
61672 unsigned argc = 1;
61673
61674 do {
61675 JS::ExposeObjectToActiveJS(arg);
61676 argv[0].setObject(*arg);
61677 if (!MaybeWrapObjectValue(cx, argv[0])) {
61678 aRv.Throw(NS_ERROR_UNEXPECTED);
61679 return;
61680 }
61681 break;
61682 } while (false);
61683
61684 JS::Rooted<JS::Value> callable(cx);
61685 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61686 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61687 !InitIds(cx, atomsCache)) ||
61688 !GetCallableProperty(cx, atomsCache->passObject_id, &callable)) {
61689 aRv.Throw(NS_ERROR_UNEXPECTED);
61690 return;
61691 }
61692 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61693 if (!JS::Call(cx, thisValue, callable,
61694 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61695 aRv.NoteJSContextException(cx);
61696 return;
61697 }
61698}
61699
61700void
61701TestJSImplInterfaceJSImpl::PassVariadicObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61702{
61703 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61704 if (aRv.Failed()) {
61705 return;
61706 }
61707 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61707); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61707); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61708 BindingCallContext& cx = s.GetCallContext();
61709
61710 JS::Rooted<JS::Value> rval(cx);
61711 JS::RootedVector<JS::Value> argv(cx);
61712 if (!argv.resize((1 - 1) + arg.Length())) {
61713 // That threw an exception on the JSContext, and our CallSetup will do
61714 // the right thing with that.
61715 return;
61716 }
61717 unsigned argc = (1 - 1) + arg.Length();
61718
61719 do {
61720 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
61721 JS::ExposeObjectToActiveJS(arg[idx]);
61722 argv[0 + idx].setObject(*arg[idx]);
61723 if (!MaybeWrapObjectValue(cx, argv[0 + idx])) {
61724 aRv.Throw(NS_ERROR_UNEXPECTED);
61725 return;
61726 }
61727 continue;
61728 }
61729 break;
61730 } while (false);
61731
61732 JS::Rooted<JS::Value> callable(cx);
61733 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61734 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61735 !InitIds(cx, atomsCache)) ||
61736 !GetCallableProperty(cx, atomsCache->passVariadicObject_id, &callable)) {
61737 aRv.Throw(NS_ERROR_UNEXPECTED);
61738 return;
61739 }
61740 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61741 if (!JS::Call(cx, thisValue, callable,
61742 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61743 aRv.NoteJSContextException(cx);
61744 return;
61745 }
61746}
61747
61748void
61749TestJSImplInterfaceJSImpl::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61750{
61751 CallSetup s(this, aRv, "TestJSImplInterface.passNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61752 if (aRv.Failed()) {
61753 return;
61754 }
61755 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61755); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61755); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61756 BindingCallContext& cx = s.GetCallContext();
61757
61758 JS::Rooted<JS::Value> rval(cx);
61759 JS::RootedVector<JS::Value> argv(cx);
61760 if (!argv.resize(1)) {
61761 // That threw an exception on the JSContext, and our CallSetup will do
61762 // the right thing with that.
61763 return;
61764 }
61765 unsigned argc = 1;
61766
61767 do {
61768 if (arg) {
61769 JS::ExposeObjectToActiveJS(arg);
61770 }
61771 argv[0].setObjectOrNull(arg);
61772 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61773 aRv.Throw(NS_ERROR_UNEXPECTED);
61774 return;
61775 }
61776 break;
61777 } while (false);
61778
61779 JS::Rooted<JS::Value> callable(cx);
61780 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61781 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61782 !InitIds(cx, atomsCache)) ||
61783 !GetCallableProperty(cx, atomsCache->passNullableObject_id, &callable)) {
61784 aRv.Throw(NS_ERROR_UNEXPECTED);
61785 return;
61786 }
61787 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61788 if (!JS::Call(cx, thisValue, callable,
61789 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61790 aRv.NoteJSContextException(cx);
61791 return;
61792 }
61793}
61794
61795void
61796TestJSImplInterfaceJSImpl::PassVariadicNullableObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61797{
61798 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61799 if (aRv.Failed()) {
61800 return;
61801 }
61802 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61802); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61802); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61803 BindingCallContext& cx = s.GetCallContext();
61804
61805 JS::Rooted<JS::Value> rval(cx);
61806 JS::RootedVector<JS::Value> argv(cx);
61807 if (!argv.resize((1 - 1) + arg.Length())) {
61808 // That threw an exception on the JSContext, and our CallSetup will do
61809 // the right thing with that.
61810 return;
61811 }
61812 unsigned argc = (1 - 1) + arg.Length();
61813
61814 do {
61815 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
61816 JS::ExposeObjectToActiveJS(arg[idx]);
61817 argv[0 + idx].setObject(*arg[idx]);
61818 if (!MaybeWrapObjectValue(cx, argv[0 + idx])) {
61819 aRv.Throw(NS_ERROR_UNEXPECTED);
61820 return;
61821 }
61822 continue;
61823 }
61824 break;
61825 } while (false);
61826
61827 JS::Rooted<JS::Value> callable(cx);
61828 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61829 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61830 !InitIds(cx, atomsCache)) ||
61831 !GetCallableProperty(cx, atomsCache->passVariadicNullableObject_id, &callable)) {
61832 aRv.Throw(NS_ERROR_UNEXPECTED);
61833 return;
61834 }
61835 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61836 if (!JS::Call(cx, thisValue, callable,
61837 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61838 aRv.NoteJSContextException(cx);
61839 return;
61840 }
61841}
61842
61843void
61844TestJSImplInterfaceJSImpl::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61845{
61846 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61847 if (aRv.Failed()) {
61848 return;
61849 }
61850 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61850); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61850); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61851 BindingCallContext& cx = s.GetCallContext();
61852
61853 JS::Rooted<JS::Value> rval(cx);
61854 JS::RootedVector<JS::Value> argv(cx);
61855 if (!argv.resize(1)) {
61856 // That threw an exception on the JSContext, and our CallSetup will do
61857 // the right thing with that.
61858 return;
61859 }
61860 unsigned argc = 1;
61861
61862 do {
61863 if (arg.WasPassed()) {
61864 JS::ExposeObjectToActiveJS(arg.Value());
61865 argv[0].setObject(*arg.Value());
61866 if (!MaybeWrapObjectValue(cx, argv[0])) {
61867 aRv.Throw(NS_ERROR_UNEXPECTED);
61868 return;
61869 }
61870 break;
61871 } else if (argc == 1) {
61872 // This is our current trailing argument; reduce argc
61873 --argc;
61874 } else {
61875 argv[0].setUndefined();
61876 }
61877 } while (false);
61878
61879 JS::Rooted<JS::Value> callable(cx);
61880 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61881 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61882 !InitIds(cx, atomsCache)) ||
61883 !GetCallableProperty(cx, atomsCache->passOptionalObject_id, &callable)) {
61884 aRv.Throw(NS_ERROR_UNEXPECTED);
61885 return;
61886 }
61887 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61888 if (!JS::Call(cx, thisValue, callable,
61889 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61890 aRv.NoteJSContextException(cx);
61891 return;
61892 }
61893}
61894
61895void
61896TestJSImplInterfaceJSImpl::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61897{
61898 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61899 if (aRv.Failed()) {
61900 return;
61901 }
61902 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61902); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61902); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61903 BindingCallContext& cx = s.GetCallContext();
61904
61905 JS::Rooted<JS::Value> rval(cx);
61906 JS::RootedVector<JS::Value> argv(cx);
61907 if (!argv.resize(1)) {
61908 // That threw an exception on the JSContext, and our CallSetup will do
61909 // the right thing with that.
61910 return;
61911 }
61912 unsigned argc = 1;
61913
61914 do {
61915 if (arg.WasPassed()) {
61916 if (arg.Value()) {
61917 JS::ExposeObjectToActiveJS(arg.Value());
61918 }
61919 argv[0].setObjectOrNull(arg.Value());
61920 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61921 aRv.Throw(NS_ERROR_UNEXPECTED);
61922 return;
61923 }
61924 break;
61925 } else if (argc == 1) {
61926 // This is our current trailing argument; reduce argc
61927 --argc;
61928 } else {
61929 argv[0].setUndefined();
61930 }
61931 } while (false);
61932
61933 JS::Rooted<JS::Value> callable(cx);
61934 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61935 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61936 !InitIds(cx, atomsCache)) ||
61937 !GetCallableProperty(cx, atomsCache->passOptionalNullableObject_id, &callable)) {
61938 aRv.Throw(NS_ERROR_UNEXPECTED);
61939 return;
61940 }
61941 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61942 if (!JS::Call(cx, thisValue, callable,
61943 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61944 aRv.NoteJSContextException(cx);
61945 return;
61946 }
61947}
61948
61949void
61950TestJSImplInterfaceJSImpl::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61951{
61952 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61953 if (aRv.Failed()) {
61954 return;
61955 }
61956 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 61956); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
61957 BindingCallContext& cx = s.GetCallContext();
61958
61959 JS::Rooted<JS::Value> rval(cx);
61960 JS::RootedVector<JS::Value> argv(cx);
61961 if (!argv.resize(1)) {
61962 // That threw an exception on the JSContext, and our CallSetup will do
61963 // the right thing with that.
61964 return;
61965 }
61966 unsigned argc = 1;
61967
61968 do {
61969 if (arg) {
61970 JS::ExposeObjectToActiveJS(arg);
61971 }
61972 argv[0].setObjectOrNull(arg);
61973 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61974 aRv.Throw(NS_ERROR_UNEXPECTED);
61975 return;
61976 }
61977 break;
61978 } while (false);
61979
61980 JS::Rooted<JS::Value> callable(cx);
61981 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61982 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61983 !InitIds(cx, atomsCache)) ||
61984 !GetCallableProperty(cx, atomsCache->passOptionalNullableObjectWithDefaultValue_id, &callable)) {
61985 aRv.Throw(NS_ERROR_UNEXPECTED);
61986 return;
61987 }
61988 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61989 if (!JS::Call(cx, thisValue, callable,
61990 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61991 aRv.NoteJSContextException(cx);
61992 return;
61993 }
61994}
61995
61996void
61997TestJSImplInterfaceJSImpl::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61998{
61999 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62000 if (aRv.Failed()) {
62001 return;
62002 }
62003 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62003); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62003); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62004 BindingCallContext& cx = s.GetCallContext();
62005
62006 JS::Rooted<JS::Value> rval(cx);
62007 JS::RootedVector<JS::Value> argv(cx);
62008 if (!argv.resize(1)) {
62009 // That threw an exception on the JSContext, and our CallSetup will do
62010 // the right thing with that.
62011 return;
62012 }
62013 unsigned argc = 1;
62014
62015 do {
62016
62017 uint32_t length = arg.Length();
62018 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62019 if (!returnArray) {
62020 aRv.Throw(NS_ERROR_UNEXPECTED);
62021 return;
62022 }
62023 // Scope for 'tmp'
62024 {
62025 JS::Rooted<JS::Value> tmp(cx);
62026 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62027 // Control block to let us common up the JS_DefineElement calls when there
62028 // are different ways to succeed at wrapping the object.
62029 do {
62030 JS::ExposeObjectToActiveJS(arg[sequenceIdx0]);
62031 tmp.setObject(*arg[sequenceIdx0]);
62032 if (!MaybeWrapObjectValue(cx, &tmp)) {
62033 aRv.Throw(NS_ERROR_UNEXPECTED);
62034 return;
62035 }
62036 break;
62037 } while (false);
62038 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62039 JSPROP_ENUMERATE)) {
62040 aRv.Throw(NS_ERROR_UNEXPECTED);
62041 return;
62042 }
62043 }
62044 }
62045 argv[0].setObject(*returnArray);
62046 break;
62047 } while (false);
62048
62049 JS::Rooted<JS::Value> callable(cx);
62050 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62051 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62052 !InitIds(cx, atomsCache)) ||
62053 !GetCallableProperty(cx, atomsCache->passSequenceOfObject_id, &callable)) {
62054 aRv.Throw(NS_ERROR_UNEXPECTED);
62055 return;
62056 }
62057 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62058 if (!JS::Call(cx, thisValue, callable,
62059 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62060 aRv.NoteJSContextException(cx);
62061 return;
62062 }
62063}
62064
62065void
62066TestJSImplInterfaceJSImpl::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62067{
62068 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62069 if (aRv.Failed()) {
62070 return;
62071 }
62072 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62072); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62072); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62073 BindingCallContext& cx = s.GetCallContext();
62074
62075 JS::Rooted<JS::Value> rval(cx);
62076 JS::RootedVector<JS::Value> argv(cx);
62077 if (!argv.resize(1)) {
62078 // That threw an exception on the JSContext, and our CallSetup will do
62079 // the right thing with that.
62080 return;
62081 }
62082 unsigned argc = 1;
62083
62084 do {
62085
62086 uint32_t length = arg.Length();
62087 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62088 if (!returnArray) {
62089 aRv.Throw(NS_ERROR_UNEXPECTED);
62090 return;
62091 }
62092 // Scope for 'tmp'
62093 {
62094 JS::Rooted<JS::Value> tmp(cx);
62095 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62096 // Control block to let us common up the JS_DefineElement calls when there
62097 // are different ways to succeed at wrapping the object.
62098 do {
62099 if (arg[sequenceIdx0]) {
62100 JS::ExposeObjectToActiveJS(arg[sequenceIdx0]);
62101 }
62102 tmp.setObjectOrNull(arg[sequenceIdx0]);
62103 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
62104 aRv.Throw(NS_ERROR_UNEXPECTED);
62105 return;
62106 }
62107 break;
62108 } while (false);
62109 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62110 JSPROP_ENUMERATE)) {
62111 aRv.Throw(NS_ERROR_UNEXPECTED);
62112 return;
62113 }
62114 }
62115 }
62116 argv[0].setObject(*returnArray);
62117 break;
62118 } while (false);
62119
62120 JS::Rooted<JS::Value> callable(cx);
62121 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62122 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62123 !InitIds(cx, atomsCache)) ||
62124 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableObject_id, &callable)) {
62125 aRv.Throw(NS_ERROR_UNEXPECTED);
62126 return;
62127 }
62128 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62129 if (!JS::Call(cx, thisValue, callable,
62130 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62131 aRv.NoteJSContextException(cx);
62132 return;
62133 }
62134}
62135
62136void
62137TestJSImplInterfaceJSImpl::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62138{
62139 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62140 if (aRv.Failed()) {
62141 return;
62142 }
62143 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62143); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62143); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62144 BindingCallContext& cx = s.GetCallContext();
62145
62146 JS::Rooted<JS::Value> rval(cx);
62147 JS::RootedVector<JS::Value> argv(cx);
62148 if (!argv.resize(1)) {
62149 // That threw an exception on the JSContext, and our CallSetup will do
62150 // the right thing with that.
62151 return;
62152 }
62153 unsigned argc = 1;
62154
62155 do {
62156
62157 if (arg.IsNull()) {
62158 argv[0].setNull();
62159 break;
62160 }
62161
62162 uint32_t length = arg.Value().Length();
62163 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62164 if (!returnArray) {
62165 aRv.Throw(NS_ERROR_UNEXPECTED);
62166 return;
62167 }
62168 // Scope for 'tmp'
62169 {
62170 JS::Rooted<JS::Value> tmp(cx);
62171 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62172 // Control block to let us common up the JS_DefineElement calls when there
62173 // are different ways to succeed at wrapping the object.
62174 do {
62175 JS::ExposeObjectToActiveJS(arg.Value()[sequenceIdx0]);
62176 tmp.setObject(*arg.Value()[sequenceIdx0]);
62177 if (!MaybeWrapObjectValue(cx, &tmp)) {
62178 aRv.Throw(NS_ERROR_UNEXPECTED);
62179 return;
62180 }
62181 break;
62182 } while (false);
62183 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62184 JSPROP_ENUMERATE)) {
62185 aRv.Throw(NS_ERROR_UNEXPECTED);
62186 return;
62187 }
62188 }
62189 }
62190 argv[0].setObject(*returnArray);
62191 break;
62192 } while (false);
62193
62194 JS::Rooted<JS::Value> callable(cx);
62195 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62196 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62197 !InitIds(cx, atomsCache)) ||
62198 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfObject_id, &callable)) {
62199 aRv.Throw(NS_ERROR_UNEXPECTED);
62200 return;
62201 }
62202 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62203 if (!JS::Call(cx, thisValue, callable,
62204 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62205 aRv.NoteJSContextException(cx);
62206 return;
62207 }
62208}
62209
62210void
62211TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62212{
62213 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62214 if (aRv.Failed()) {
62215 return;
62216 }
62217 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62217); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62217); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62218 BindingCallContext& cx = s.GetCallContext();
62219
62220 JS::Rooted<JS::Value> rval(cx);
62221 JS::RootedVector<JS::Value> argv(cx);
62222 if (!argv.resize(1)) {
62223 // That threw an exception on the JSContext, and our CallSetup will do
62224 // the right thing with that.
62225 return;
62226 }
62227 unsigned argc = 1;
62228
62229 do {
62230 if (arg.WasPassed()) {
62231
62232 if (arg.Value().IsNull()) {
62233 argv[0].setNull();
62234 break;
62235 }
62236
62237 uint32_t length = arg.Value().Value().Length();
62238 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62239 if (!returnArray) {
62240 aRv.Throw(NS_ERROR_UNEXPECTED);
62241 return;
62242 }
62243 // Scope for 'tmp'
62244 {
62245 JS::Rooted<JS::Value> tmp(cx);
62246 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62247 // Control block to let us common up the JS_DefineElement calls when there
62248 // are different ways to succeed at wrapping the object.
62249 do {
62250
62251 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
62252 tmp.setNull();
62253 break;
62254 }
62255
62256 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
62257 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62258 if (!returnArray) {
62259 aRv.Throw(NS_ERROR_UNEXPECTED);
62260 return;
62261 }
62262 // Scope for 'tmp'
62263 {
62264 JS::Rooted<JS::Value> tmp(cx);
62265 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
62266 // Control block to let us common up the JS_DefineElement calls when there
62267 // are different ways to succeed at wrapping the object.
62268 do {
62269 JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62270 tmp.setObject(*arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62271 if (!MaybeWrapObjectValue(cx, &tmp)) {
62272 aRv.Throw(NS_ERROR_UNEXPECTED);
62273 return;
62274 }
62275 break;
62276 } while (false);
62277 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
62278 JSPROP_ENUMERATE)) {
62279 aRv.Throw(NS_ERROR_UNEXPECTED);
62280 return;
62281 }
62282 }
62283 }
62284 tmp.setObject(*returnArray);
62285 break;
62286 } while (false);
62287 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62288 JSPROP_ENUMERATE)) {
62289 aRv.Throw(NS_ERROR_UNEXPECTED);
62290 return;
62291 }
62292 }
62293 }
62294 argv[0].setObject(*returnArray);
62295 break;
62296 } else if (argc == 1) {
62297 // This is our current trailing argument; reduce argc
62298 --argc;
62299 } else {
62300 argv[0].setUndefined();
62301 }
62302 } while (false);
62303
62304 JS::Rooted<JS::Value> callable(cx);
62305 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62306 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62307 !InitIds(cx, atomsCache)) ||
62308 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id, &callable)) {
62309 aRv.Throw(NS_ERROR_UNEXPECTED);
62310 return;
62311 }
62312 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62313 if (!JS::Call(cx, thisValue, callable,
62314 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62315 aRv.NoteJSContextException(cx);
62316 return;
62317 }
62318}
62319
62320void
62321TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62322{
62323 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62324 if (aRv.Failed()) {
62325 return;
62326 }
62327 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62327); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62327); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62328 BindingCallContext& cx = s.GetCallContext();
62329
62330 JS::Rooted<JS::Value> rval(cx);
62331 JS::RootedVector<JS::Value> argv(cx);
62332 if (!argv.resize(1)) {
62333 // That threw an exception on the JSContext, and our CallSetup will do
62334 // the right thing with that.
62335 return;
62336 }
62337 unsigned argc = 1;
62338
62339 do {
62340 if (arg.WasPassed()) {
62341
62342 if (arg.Value().IsNull()) {
62343 argv[0].setNull();
62344 break;
62345 }
62346
62347 uint32_t length = arg.Value().Value().Length();
62348 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62349 if (!returnArray) {
62350 aRv.Throw(NS_ERROR_UNEXPECTED);
62351 return;
62352 }
62353 // Scope for 'tmp'
62354 {
62355 JS::Rooted<JS::Value> tmp(cx);
62356 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62357 // Control block to let us common up the JS_DefineElement calls when there
62358 // are different ways to succeed at wrapping the object.
62359 do {
62360
62361 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
62362 tmp.setNull();
62363 break;
62364 }
62365
62366 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
62367 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62368 if (!returnArray) {
62369 aRv.Throw(NS_ERROR_UNEXPECTED);
62370 return;
62371 }
62372 // Scope for 'tmp'
62373 {
62374 JS::Rooted<JS::Value> tmp(cx);
62375 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
62376 // Control block to let us common up the JS_DefineElement calls when there
62377 // are different ways to succeed at wrapping the object.
62378 do {
62379 if (arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]) {
62380 JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62381 }
62382 tmp.setObjectOrNull(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62383 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
62384 aRv.Throw(NS_ERROR_UNEXPECTED);
62385 return;
62386 }
62387 break;
62388 } while (false);
62389 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
62390 JSPROP_ENUMERATE)) {
62391 aRv.Throw(NS_ERROR_UNEXPECTED);
62392 return;
62393 }
62394 }
62395 }
62396 tmp.setObject(*returnArray);
62397 break;
62398 } while (false);
62399 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62400 JSPROP_ENUMERATE)) {
62401 aRv.Throw(NS_ERROR_UNEXPECTED);
62402 return;
62403 }
62404 }
62405 }
62406 argv[0].setObject(*returnArray);
62407 break;
62408 } else if (argc == 1) {
62409 // This is our current trailing argument; reduce argc
62410 --argc;
62411 } else {
62412 argv[0].setUndefined();
62413 }
62414 } while (false);
62415
62416 JS::Rooted<JS::Value> callable(cx);
62417 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62418 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62419 !InitIds(cx, atomsCache)) ||
62420 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id, &callable)) {
62421 aRv.Throw(NS_ERROR_UNEXPECTED);
62422 return;
62423 }
62424 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62425 if (!JS::Call(cx, thisValue, callable,
62426 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62427 aRv.NoteJSContextException(cx);
62428 return;
62429 }
62430}
62431
62432void
62433TestJSImplInterfaceJSImpl::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62434{
62435 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62436 if (aRv.Failed()) {
62437 return;
62438 }
62439 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62439); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62439); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62440 BindingCallContext& cx = s.GetCallContext();
62441
62442 JS::Rooted<JS::Value> rval(cx);
62443 JS::RootedVector<JS::Value> argv(cx);
62444 if (!argv.resize(1)) {
62445 // That threw an exception on the JSContext, and our CallSetup will do
62446 // the right thing with that.
62447 return;
62448 }
62449 unsigned argc = 1;
62450
62451 do {
62452
62453 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
62454 if (!returnObj) {
62455 aRv.Throw(NS_ERROR_UNEXPECTED);
62456 return;
62457 }
62458 // Scope for 'tmp'
62459 {
62460 JS::Rooted<JS::Value> tmp(cx);
62461 for (auto& entry : arg.Entries()) {
62462 auto& recordValue0 = entry.mValue;
62463 // Control block to let us common up the JS_DefineUCProperty calls when there
62464 // are different ways to succeed at wrapping the value.
62465 do {
62466 JS::ExposeObjectToActiveJS(recordValue0);
62467 tmp.setObject(*recordValue0);
62468 if (!MaybeWrapObjectValue(cx, &tmp)) {
62469 aRv.Throw(NS_ERROR_UNEXPECTED);
62470 return;
62471 }
62472 break;
62473 } while (false);
62474 if (!JS_DefineUCProperty(cx, returnObj,
62475 entry.mKey.BeginReading(),
62476 entry.mKey.Length(), tmp,
62477 JSPROP_ENUMERATE)) {
62478 aRv.Throw(NS_ERROR_UNEXPECTED);
62479 return;
62480 }
62481 }
62482 }
62483 argv[0].setObject(*returnObj);
62484 break;
62485 } while (false);
62486
62487 JS::Rooted<JS::Value> callable(cx);
62488 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62489 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62490 !InitIds(cx, atomsCache)) ||
62491 !GetCallableProperty(cx, atomsCache->passRecordOfObject_id, &callable)) {
62492 aRv.Throw(NS_ERROR_UNEXPECTED);
62493 return;
62494 }
62495 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62496 if (!JS::Call(cx, thisValue, callable,
62497 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62498 aRv.NoteJSContextException(cx);
62499 return;
62500 }
62501}
62502
62503void
62504TestJSImplInterfaceJSImpl::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
62505{
62506 CallSetup s(this, aRv, "TestJSImplInterface.receiveObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62507 if (aRv.Failed()) {
62508 return;
62509 }
62510 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62510); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62510); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62511 BindingCallContext& cx = s.GetCallContext();
62512
62513 JS::Rooted<JS::Value> rval(cx);
62514
62515 JS::Rooted<JS::Value> callable(cx);
62516 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62517 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62518 !InitIds(cx, atomsCache)) ||
62519 !GetCallableProperty(cx, atomsCache->receiveObject_id, &callable)) {
62520 aRv.Throw(NS_ERROR_UNEXPECTED);
62521 return;
62522 }
62523 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62524 if (!JS::Call(cx, thisValue, callable,
62525 JS::HandleValueArray::empty(), &rval)) {
62526 aRv.NoteJSContextException(cx);
62527 return;
62528 }
62529 JS::Rooted<JSObject*> rvalDecl(cx);
62530 if (rval.isObject()) {
62531#ifdef __clang__1
62532#pragma clang diagnostic push
62533#pragma clang diagnostic ignored "-Wunreachable-code"
62534#pragma clang diagnostic ignored "-Wunreachable-code-return"
62535#endif // __clang__
62536 if ((false) && !CallerSubsumes(rval)) {
62537 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveObject");
62538 aRv.Throw(NS_ERROR_UNEXPECTED);
62539 return;
62540 }
62541#ifdef __clang__1
62542#pragma clang diagnostic pop
62543#endif // __clang__
62544 rvalDecl = &rval.toObject();
62545 } else {
62546 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveObject");
62547 aRv.Throw(NS_ERROR_UNEXPECTED);
62548 return;
62549 }
62550 aRetVal.set(rvalDecl);
62551}
62552
62553void
62554TestJSImplInterfaceJSImpl::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
62555{
62556 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62557 if (aRv.Failed()) {
62558 return;
62559 }
62560 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62560); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62560); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62561 BindingCallContext& cx = s.GetCallContext();
62562
62563 JS::Rooted<JS::Value> rval(cx);
62564
62565 JS::Rooted<JS::Value> callable(cx);
62566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62568 !InitIds(cx, atomsCache)) ||
62569 !GetCallableProperty(cx, atomsCache->receiveNullableObject_id, &callable)) {
62570 aRv.Throw(NS_ERROR_UNEXPECTED);
62571 return;
62572 }
62573 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62574 if (!JS::Call(cx, thisValue, callable,
62575 JS::HandleValueArray::empty(), &rval)) {
62576 aRv.NoteJSContextException(cx);
62577 return;
62578 }
62579 JS::Rooted<JSObject*> rvalDecl(cx);
62580 if (rval.isObject()) {
62581#ifdef __clang__1
62582#pragma clang diagnostic push
62583#pragma clang diagnostic ignored "-Wunreachable-code"
62584#pragma clang diagnostic ignored "-Wunreachable-code-return"
62585#endif // __clang__
62586 if ((false) && !CallerSubsumes(rval)) {
62587 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveNullableObject");
62588 aRv.Throw(NS_ERROR_UNEXPECTED);
62589 return;
62590 }
62591#ifdef __clang__1
62592#pragma clang diagnostic pop
62593#endif // __clang__
62594 rvalDecl = &rval.toObject();
62595 } else if (rval.isNullOrUndefined()) {
62596 rvalDecl = nullptr;
62597 } else {
62598 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableObject");
62599 aRv.Throw(NS_ERROR_UNEXPECTED);
62600 return;
62601 }
62602 aRetVal.set(rvalDecl);
62603}
62604
62605void
62606TestJSImplInterfaceJSImpl::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62607{
62608 CallSetup s(this, aRv, "TestJSImplInterface.passUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62609 if (aRv.Failed()) {
62610 return;
62611 }
62612 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62612); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62612); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62613 BindingCallContext& cx = s.GetCallContext();
62614
62615 JS::Rooted<JS::Value> rval(cx);
62616 JS::RootedVector<JS::Value> argv(cx);
62617 if (!argv.resize(1)) {
62618 // That threw an exception on the JSContext, and our CallSetup will do
62619 // the right thing with that.
62620 return;
62621 }
62622 unsigned argc = 1;
62623
62624 do {
62625 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62626 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62627 aRv.Throw(NS_ERROR_UNEXPECTED);
62628 return;
62629 }
62630 break;
62631 } while (false);
62632
62633 JS::Rooted<JS::Value> callable(cx);
62634 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62635 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62636 !InitIds(cx, atomsCache)) ||
62637 !GetCallableProperty(cx, atomsCache->passUnion_id, &callable)) {
62638 aRv.Throw(NS_ERROR_UNEXPECTED);
62639 return;
62640 }
62641 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62642 if (!JS::Call(cx, thisValue, callable,
62643 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62644 aRv.NoteJSContextException(cx);
62645 return;
62646 }
62647}
62648
62649void
62650TestJSImplInterfaceJSImpl::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62651{
62652 CallSetup s(this, aRv, "TestJSImplInterface.passUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62653 if (aRv.Failed()) {
62654 return;
62655 }
62656 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62656); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62656); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62657 BindingCallContext& cx = s.GetCallContext();
62658
62659 JS::Rooted<JS::Value> rval(cx);
62660 JS::RootedVector<JS::Value> argv(cx);
62661 if (!argv.resize(1)) {
62662 // That threw an exception on the JSContext, and our CallSetup will do
62663 // the right thing with that.
62664 return;
62665 }
62666 unsigned argc = 1;
62667
62668 do {
62669 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62670 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62671 aRv.Throw(NS_ERROR_UNEXPECTED);
62672 return;
62673 }
62674 break;
62675 } while (false);
62676
62677 JS::Rooted<JS::Value> callable(cx);
62678 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62679 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62680 !InitIds(cx, atomsCache)) ||
62681 !GetCallableProperty(cx, atomsCache->passUnion2_id, &callable)) {
62682 aRv.Throw(NS_ERROR_UNEXPECTED);
62683 return;
62684 }
62685 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62686 if (!JS::Call(cx, thisValue, callable,
62687 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62688 aRv.NoteJSContextException(cx);
62689 return;
62690 }
62691}
62692
62693void
62694TestJSImplInterfaceJSImpl::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62695{
62696 CallSetup s(this, aRv, "TestJSImplInterface.passUnion3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62697 if (aRv.Failed()) {
62698 return;
62699 }
62700 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62700); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62700); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62701 BindingCallContext& cx = s.GetCallContext();
62702
62703 JS::Rooted<JS::Value> rval(cx);
62704 JS::RootedVector<JS::Value> argv(cx);
62705 if (!argv.resize(1)) {
62706 // That threw an exception on the JSContext, and our CallSetup will do
62707 // the right thing with that.
62708 return;
62709 }
62710 unsigned argc = 1;
62711
62712 do {
62713 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62714 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62715 aRv.Throw(NS_ERROR_UNEXPECTED);
62716 return;
62717 }
62718 break;
62719 } while (false);
62720
62721 JS::Rooted<JS::Value> callable(cx);
62722 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62723 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62724 !InitIds(cx, atomsCache)) ||
62725 !GetCallableProperty(cx, atomsCache->passUnion3_id, &callable)) {
62726 aRv.Throw(NS_ERROR_UNEXPECTED);
62727 return;
62728 }
62729 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62730 if (!JS::Call(cx, thisValue, callable,
62731 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62732 aRv.NoteJSContextException(cx);
62733 return;
62734 }
62735}
62736
62737void
62738TestJSImplInterfaceJSImpl::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62739{
62740 CallSetup s(this, aRv, "TestJSImplInterface.passUnion4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62741 if (aRv.Failed()) {
62742 return;
62743 }
62744 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62744); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62744); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62745 BindingCallContext& cx = s.GetCallContext();
62746
62747 JS::Rooted<JS::Value> rval(cx);
62748 JS::RootedVector<JS::Value> argv(cx);
62749 if (!argv.resize(1)) {
62750 // That threw an exception on the JSContext, and our CallSetup will do
62751 // the right thing with that.
62752 return;
62753 }
62754 unsigned argc = 1;
62755
62756 do {
62757 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62758 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62759 aRv.Throw(NS_ERROR_UNEXPECTED);
62760 return;
62761 }
62762 break;
62763 } while (false);
62764
62765 JS::Rooted<JS::Value> callable(cx);
62766 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62767 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62768 !InitIds(cx, atomsCache)) ||
62769 !GetCallableProperty(cx, atomsCache->passUnion4_id, &callable)) {
62770 aRv.Throw(NS_ERROR_UNEXPECTED);
62771 return;
62772 }
62773 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62774 if (!JS::Call(cx, thisValue, callable,
62775 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62776 aRv.NoteJSContextException(cx);
62777 return;
62778 }
62779}
62780
62781void
62782TestJSImplInterfaceJSImpl::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62783{
62784 CallSetup s(this, aRv, "TestJSImplInterface.passUnion5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62785 if (aRv.Failed()) {
62786 return;
62787 }
62788 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62788); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62788); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62789 BindingCallContext& cx = s.GetCallContext();
62790
62791 JS::Rooted<JS::Value> rval(cx);
62792 JS::RootedVector<JS::Value> argv(cx);
62793 if (!argv.resize(1)) {
62794 // That threw an exception on the JSContext, and our CallSetup will do
62795 // the right thing with that.
62796 return;
62797 }
62798 unsigned argc = 1;
62799
62800 do {
62801 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62802 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62803 aRv.Throw(NS_ERROR_UNEXPECTED);
62804 return;
62805 }
62806 break;
62807 } while (false);
62808
62809 JS::Rooted<JS::Value> callable(cx);
62810 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62811 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62812 !InitIds(cx, atomsCache)) ||
62813 !GetCallableProperty(cx, atomsCache->passUnion5_id, &callable)) {
62814 aRv.Throw(NS_ERROR_UNEXPECTED);
62815 return;
62816 }
62817 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62818 if (!JS::Call(cx, thisValue, callable,
62819 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62820 aRv.NoteJSContextException(cx);
62821 return;
62822 }
62823}
62824
62825void
62826TestJSImplInterfaceJSImpl::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
62827{
62828 CallSetup s(this, aRv, "TestJSImplInterface.passUnion6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62829 if (aRv.Failed()) {
62830 return;
62831 }
62832 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62832); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62832); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62833 BindingCallContext& cx = s.GetCallContext();
62834
62835 JS::Rooted<JS::Value> rval(cx);
62836 JS::RootedVector<JS::Value> argv(cx);
62837 if (!argv.resize(1)) {
62838 // That threw an exception on the JSContext, and our CallSetup will do
62839 // the right thing with that.
62840 return;
62841 }
62842 unsigned argc = 1;
62843
62844 do {
62845 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62846 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62847 aRv.Throw(NS_ERROR_UNEXPECTED);
62848 return;
62849 }
62850 break;
62851 } while (false);
62852
62853 JS::Rooted<JS::Value> callable(cx);
62854 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62855 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62856 !InitIds(cx, atomsCache)) ||
62857 !GetCallableProperty(cx, atomsCache->passUnion6_id, &callable)) {
62858 aRv.Throw(NS_ERROR_UNEXPECTED);
62859 return;
62860 }
62861 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62862 if (!JS::Call(cx, thisValue, callable,
62863 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62864 aRv.NoteJSContextException(cx);
62865 return;
62866 }
62867}
62868
62869void
62870TestJSImplInterfaceJSImpl::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62871{
62872 CallSetup s(this, aRv, "TestJSImplInterface.passUnion7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62873 if (aRv.Failed()) {
62874 return;
62875 }
62876 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62876); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62876); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62877 BindingCallContext& cx = s.GetCallContext();
62878
62879 JS::Rooted<JS::Value> rval(cx);
62880 JS::RootedVector<JS::Value> argv(cx);
62881 if (!argv.resize(1)) {
62882 // That threw an exception on the JSContext, and our CallSetup will do
62883 // the right thing with that.
62884 return;
62885 }
62886 unsigned argc = 1;
62887
62888 do {
62889 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62890 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62891 aRv.Throw(NS_ERROR_UNEXPECTED);
62892 return;
62893 }
62894 break;
62895 } while (false);
62896
62897 JS::Rooted<JS::Value> callable(cx);
62898 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62899 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62900 !InitIds(cx, atomsCache)) ||
62901 !GetCallableProperty(cx, atomsCache->passUnion7_id, &callable)) {
62902 aRv.Throw(NS_ERROR_UNEXPECTED);
62903 return;
62904 }
62905 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62906 if (!JS::Call(cx, thisValue, callable,
62907 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62908 aRv.NoteJSContextException(cx);
62909 return;
62910 }
62911}
62912
62913void
62914TestJSImplInterfaceJSImpl::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62915{
62916 CallSetup s(this, aRv, "TestJSImplInterface.passUnion8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62917 if (aRv.Failed()) {
62918 return;
62919 }
62920 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62920); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62920); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62921 BindingCallContext& cx = s.GetCallContext();
62922
62923 JS::Rooted<JS::Value> rval(cx);
62924 JS::RootedVector<JS::Value> argv(cx);
62925 if (!argv.resize(1)) {
62926 // That threw an exception on the JSContext, and our CallSetup will do
62927 // the right thing with that.
62928 return;
62929 }
62930 unsigned argc = 1;
62931
62932 do {
62933 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62934 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62935 aRv.Throw(NS_ERROR_UNEXPECTED);
62936 return;
62937 }
62938 break;
62939 } while (false);
62940
62941 JS::Rooted<JS::Value> callable(cx);
62942 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62943 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62944 !InitIds(cx, atomsCache)) ||
62945 !GetCallableProperty(cx, atomsCache->passUnion8_id, &callable)) {
62946 aRv.Throw(NS_ERROR_UNEXPECTED);
62947 return;
62948 }
62949 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62950 if (!JS::Call(cx, thisValue, callable,
62951 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62952 aRv.NoteJSContextException(cx);
62953 return;
62954 }
62955}
62956
62957void
62958TestJSImplInterfaceJSImpl::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62959{
62960 CallSetup s(this, aRv, "TestJSImplInterface.passUnion9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62961 if (aRv.Failed()) {
62962 return;
62963 }
62964 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62964); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 62964); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
62965 BindingCallContext& cx = s.GetCallContext();
62966
62967 JS::Rooted<JS::Value> rval(cx);
62968 JS::RootedVector<JS::Value> argv(cx);
62969 if (!argv.resize(1)) {
62970 // That threw an exception on the JSContext, and our CallSetup will do
62971 // the right thing with that.
62972 return;
62973 }
62974 unsigned argc = 1;
62975
62976 do {
62977 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62978 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62979 aRv.Throw(NS_ERROR_UNEXPECTED);
62980 return;
62981 }
62982 break;
62983 } while (false);
62984
62985 JS::Rooted<JS::Value> callable(cx);
62986 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62987 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62988 !InitIds(cx, atomsCache)) ||
62989 !GetCallableProperty(cx, atomsCache->passUnion9_id, &callable)) {
62990 aRv.Throw(NS_ERROR_UNEXPECTED);
62991 return;
62992 }
62993 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62994 if (!JS::Call(cx, thisValue, callable,
62995 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62996 aRv.NoteJSContextException(cx);
62997 return;
62998 }
62999}
63000
63001void
63002TestJSImplInterfaceJSImpl::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63003{
63004 CallSetup s(this, aRv, "TestJSImplInterface.passUnion10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63005 if (aRv.Failed()) {
63006 return;
63007 }
63008 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63008); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63008); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63009 BindingCallContext& cx = s.GetCallContext();
63010
63011 JS::Rooted<JS::Value> rval(cx);
63012 JS::RootedVector<JS::Value> argv(cx);
63013 if (!argv.resize(1)) {
63014 // That threw an exception on the JSContext, and our CallSetup will do
63015 // the right thing with that.
63016 return;
63017 }
63018 unsigned argc = 1;
63019
63020 do {
63021 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63022 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63023 aRv.Throw(NS_ERROR_UNEXPECTED);
63024 return;
63025 }
63026 break;
63027 } while (false);
63028
63029 JS::Rooted<JS::Value> callable(cx);
63030 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63031 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63032 !InitIds(cx, atomsCache)) ||
63033 !GetCallableProperty(cx, atomsCache->passUnion10_id, &callable)) {
63034 aRv.Throw(NS_ERROR_UNEXPECTED);
63035 return;
63036 }
63037 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63038 if (!JS::Call(cx, thisValue, callable,
63039 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63040 aRv.NoteJSContextException(cx);
63041 return;
63042 }
63043}
63044
63045void
63046TestJSImplInterfaceJSImpl::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63047{
63048 CallSetup s(this, aRv, "TestJSImplInterface.passUnion11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63049 if (aRv.Failed()) {
63050 return;
63051 }
63052 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63052); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63052); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63053 BindingCallContext& cx = s.GetCallContext();
63054
63055 JS::Rooted<JS::Value> rval(cx);
63056 JS::RootedVector<JS::Value> argv(cx);
63057 if (!argv.resize(1)) {
63058 // That threw an exception on the JSContext, and our CallSetup will do
63059 // the right thing with that.
63060 return;
63061 }
63062 unsigned argc = 1;
63063
63064 do {
63065 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63066 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63067 aRv.Throw(NS_ERROR_UNEXPECTED);
63068 return;
63069 }
63070 break;
63071 } while (false);
63072
63073 JS::Rooted<JS::Value> callable(cx);
63074 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63075 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63076 !InitIds(cx, atomsCache)) ||
63077 !GetCallableProperty(cx, atomsCache->passUnion11_id, &callable)) {
63078 aRv.Throw(NS_ERROR_UNEXPECTED);
63079 return;
63080 }
63081 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63082 if (!JS::Call(cx, thisValue, callable,
63083 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63084 aRv.NoteJSContextException(cx);
63085 return;
63086 }
63087}
63088
63089void
63090TestJSImplInterfaceJSImpl::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63091{
63092 CallSetup s(this, aRv, "TestJSImplInterface.passUnion12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63093 if (aRv.Failed()) {
63094 return;
63095 }
63096 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63096); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63096); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63097 BindingCallContext& cx = s.GetCallContext();
63098
63099 JS::Rooted<JS::Value> rval(cx);
63100 JS::RootedVector<JS::Value> argv(cx);
63101 if (!argv.resize(1)) {
63102 // That threw an exception on the JSContext, and our CallSetup will do
63103 // the right thing with that.
63104 return;
63105 }
63106 unsigned argc = 1;
63107
63108 do {
63109 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63110 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63111 aRv.Throw(NS_ERROR_UNEXPECTED);
63112 return;
63113 }
63114 break;
63115 } while (false);
63116
63117 JS::Rooted<JS::Value> callable(cx);
63118 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63119 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63120 !InitIds(cx, atomsCache)) ||
63121 !GetCallableProperty(cx, atomsCache->passUnion12_id, &callable)) {
63122 aRv.Throw(NS_ERROR_UNEXPECTED);
63123 return;
63124 }
63125 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63126 if (!JS::Call(cx, thisValue, callable,
63127 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63128 aRv.NoteJSContextException(cx);
63129 return;
63130 }
63131}
63132
63133void
63134TestJSImplInterfaceJSImpl::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
63135{
63136 CallSetup s(this, aRv, "TestJSImplInterface.passUnion13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63137 if (aRv.Failed()) {
63138 return;
63139 }
63140 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63140); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63141 BindingCallContext& cx = s.GetCallContext();
63142
63143 JS::Rooted<JS::Value> rval(cx);
63144 JS::RootedVector<JS::Value> argv(cx);
63145 if (!argv.resize(1)) {
63146 // That threw an exception on the JSContext, and our CallSetup will do
63147 // the right thing with that.
63148 return;
63149 }
63150 unsigned argc = 1;
63151
63152 do {
63153 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63154 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63155 aRv.Throw(NS_ERROR_UNEXPECTED);
63156 return;
63157 }
63158 break;
63159 } while (false);
63160
63161 JS::Rooted<JS::Value> callable(cx);
63162 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63163 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63164 !InitIds(cx, atomsCache)) ||
63165 !GetCallableProperty(cx, atomsCache->passUnion13_id, &callable)) {
63166 aRv.Throw(NS_ERROR_UNEXPECTED);
63167 return;
63168 }
63169 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63170 if (!JS::Call(cx, thisValue, callable,
63171 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63172 aRv.NoteJSContextException(cx);
63173 return;
63174 }
63175}
63176
63177void
63178TestJSImplInterfaceJSImpl::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
63179{
63180 CallSetup s(this, aRv, "TestJSImplInterface.passUnion14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63181 if (aRv.Failed()) {
63182 return;
63183 }
63184 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63184); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63184); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63185 BindingCallContext& cx = s.GetCallContext();
63186
63187 JS::Rooted<JS::Value> rval(cx);
63188 JS::RootedVector<JS::Value> argv(cx);
63189 if (!argv.resize(1)) {
63190 // That threw an exception on the JSContext, and our CallSetup will do
63191 // the right thing with that.
63192 return;
63193 }
63194 unsigned argc = 1;
63195
63196 do {
63197 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63198 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63199 aRv.Throw(NS_ERROR_UNEXPECTED);
63200 return;
63201 }
63202 break;
63203 } while (false);
63204
63205 JS::Rooted<JS::Value> callable(cx);
63206 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63207 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63208 !InitIds(cx, atomsCache)) ||
63209 !GetCallableProperty(cx, atomsCache->passUnion14_id, &callable)) {
63210 aRv.Throw(NS_ERROR_UNEXPECTED);
63211 return;
63212 }
63213 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63214 if (!JS::Call(cx, thisValue, callable,
63215 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63216 aRv.NoteJSContextException(cx);
63217 return;
63218 }
63219}
63220
63221void
63222TestJSImplInterfaceJSImpl::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63223{
63224 CallSetup s(this, aRv, "TestJSImplInterface.passUnion15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63225 if (aRv.Failed()) {
63226 return;
63227 }
63228 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63228); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63228); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63229 BindingCallContext& cx = s.GetCallContext();
63230
63231 JS::Rooted<JS::Value> rval(cx);
63232 JS::RootedVector<JS::Value> argv(cx);
63233 if (!argv.resize(1)) {
63234 // That threw an exception on the JSContext, and our CallSetup will do
63235 // the right thing with that.
63236 return;
63237 }
63238 unsigned argc = 1;
63239
63240 do {
63241 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63242 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63243 aRv.Throw(NS_ERROR_UNEXPECTED);
63244 return;
63245 }
63246 break;
63247 } while (false);
63248
63249 JS::Rooted<JS::Value> callable(cx);
63250 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63251 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63252 !InitIds(cx, atomsCache)) ||
63253 !GetCallableProperty(cx, atomsCache->passUnion15_id, &callable)) {
63254 aRv.Throw(NS_ERROR_UNEXPECTED);
63255 return;
63256 }
63257 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63258 if (!JS::Call(cx, thisValue, callable,
63259 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63260 aRv.NoteJSContextException(cx);
63261 return;
63262 }
63263}
63264
63265void
63266TestJSImplInterfaceJSImpl::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
63267{
63268 CallSetup s(this, aRv, "TestJSImplInterface.passUnion16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63269 if (aRv.Failed()) {
63270 return;
63271 }
63272 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63272); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63272); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63273 BindingCallContext& cx = s.GetCallContext();
63274
63275 JS::Rooted<JS::Value> rval(cx);
63276 JS::RootedVector<JS::Value> argv(cx);
63277 if (!argv.resize(1)) {
63278 // That threw an exception on the JSContext, and our CallSetup will do
63279 // the right thing with that.
63280 return;
63281 }
63282 unsigned argc = 1;
63283
63284 do {
63285 if (arg.WasPassed()) {
63286 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63287 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
63288 aRv.Throw(NS_ERROR_UNEXPECTED);
63289 return;
63290 }
63291 break;
63292 } else if (argc == 1) {
63293 // This is our current trailing argument; reduce argc
63294 --argc;
63295 } else {
63296 argv[0].setUndefined();
63297 }
63298 } while (false);
63299
63300 JS::Rooted<JS::Value> callable(cx);
63301 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63302 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63303 !InitIds(cx, atomsCache)) ||
63304 !GetCallableProperty(cx, atomsCache->passUnion16_id, &callable)) {
63305 aRv.Throw(NS_ERROR_UNEXPECTED);
63306 return;
63307 }
63308 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63309 if (!JS::Call(cx, thisValue, callable,
63310 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63311 aRv.NoteJSContextException(cx);
63312 return;
63313 }
63314}
63315
63316void
63317TestJSImplInterfaceJSImpl::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63318{
63319 CallSetup s(this, aRv, "TestJSImplInterface.passUnion17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63320 if (aRv.Failed()) {
63321 return;
63322 }
63323 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63323); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63324 BindingCallContext& cx = s.GetCallContext();
63325
63326 JS::Rooted<JS::Value> rval(cx);
63327 JS::RootedVector<JS::Value> argv(cx);
63328 if (!argv.resize(1)) {
63329 // That threw an exception on the JSContext, and our CallSetup will do
63330 // the right thing with that.
63331 return;
63332 }
63333 unsigned argc = 1;
63334
63335 do {
63336 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63337 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63338 aRv.Throw(NS_ERROR_UNEXPECTED);
63339 return;
63340 }
63341 break;
63342 } while (false);
63343
63344 JS::Rooted<JS::Value> callable(cx);
63345 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63346 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63347 !InitIds(cx, atomsCache)) ||
63348 !GetCallableProperty(cx, atomsCache->passUnion17_id, &callable)) {
63349 aRv.Throw(NS_ERROR_UNEXPECTED);
63350 return;
63351 }
63352 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63353 if (!JS::Call(cx, thisValue, callable,
63354 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63355 aRv.NoteJSContextException(cx);
63356 return;
63357 }
63358}
63359
63360void
63361TestJSImplInterfaceJSImpl::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63362{
63363 CallSetup s(this, aRv, "TestJSImplInterface.passUnion18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63364 if (aRv.Failed()) {
63365 return;
63366 }
63367 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63367); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63368 BindingCallContext& cx = s.GetCallContext();
63369
63370 JS::Rooted<JS::Value> rval(cx);
63371 JS::RootedVector<JS::Value> argv(cx);
63372 if (!argv.resize(1)) {
63373 // That threw an exception on the JSContext, and our CallSetup will do
63374 // the right thing with that.
63375 return;
63376 }
63377 unsigned argc = 1;
63378
63379 do {
63380 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63381 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63382 aRv.Throw(NS_ERROR_UNEXPECTED);
63383 return;
63384 }
63385 break;
63386 } while (false);
63387
63388 JS::Rooted<JS::Value> callable(cx);
63389 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63390 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63391 !InitIds(cx, atomsCache)) ||
63392 !GetCallableProperty(cx, atomsCache->passUnion18_id, &callable)) {
63393 aRv.Throw(NS_ERROR_UNEXPECTED);
63394 return;
63395 }
63396 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63397 if (!JS::Call(cx, thisValue, callable,
63398 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63399 aRv.NoteJSContextException(cx);
63400 return;
63401 }
63402}
63403
63404void
63405TestJSImplInterfaceJSImpl::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
63406{
63407 CallSetup s(this, aRv, "TestJSImplInterface.passUnion19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63408 if (aRv.Failed()) {
63409 return;
63410 }
63411 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63411); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63411); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63412 BindingCallContext& cx = s.GetCallContext();
63413
63414 JS::Rooted<JS::Value> rval(cx);
63415 JS::RootedVector<JS::Value> argv(cx);
63416 if (!argv.resize(1)) {
63417 // That threw an exception on the JSContext, and our CallSetup will do
63418 // the right thing with that.
63419 return;
63420 }
63421 unsigned argc = 1;
63422
63423 do {
63424 if (arg.WasPassed()) {
63425 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63426 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
63427 aRv.Throw(NS_ERROR_UNEXPECTED);
63428 return;
63429 }
63430 break;
63431 } else if (argc == 1) {
63432 // This is our current trailing argument; reduce argc
63433 --argc;
63434 } else {
63435 argv[0].setUndefined();
63436 }
63437 } while (false);
63438
63439 JS::Rooted<JS::Value> callable(cx);
63440 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63441 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63442 !InitIds(cx, atomsCache)) ||
63443 !GetCallableProperty(cx, atomsCache->passUnion19_id, &callable)) {
63444 aRv.Throw(NS_ERROR_UNEXPECTED);
63445 return;
63446 }
63447 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63448 if (!JS::Call(cx, thisValue, callable,
63449 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63450 aRv.NoteJSContextException(cx);
63451 return;
63452 }
63453}
63454
63455void
63456TestJSImplInterfaceJSImpl::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63457{
63458 CallSetup s(this, aRv, "TestJSImplInterface.passUnion20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63459 if (aRv.Failed()) {
63460 return;
63461 }
63462 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63462); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63462); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63463 BindingCallContext& cx = s.GetCallContext();
63464
63465 JS::Rooted<JS::Value> rval(cx);
63466 JS::RootedVector<JS::Value> argv(cx);
63467 if (!argv.resize(1)) {
63468 // That threw an exception on the JSContext, and our CallSetup will do
63469 // the right thing with that.
63470 return;
63471 }
63472 unsigned argc = 1;
63473
63474 do {
63475 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63476 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63477 aRv.Throw(NS_ERROR_UNEXPECTED);
63478 return;
63479 }
63480 break;
63481 } while (false);
63482
63483 JS::Rooted<JS::Value> callable(cx);
63484 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63485 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63486 !InitIds(cx, atomsCache)) ||
63487 !GetCallableProperty(cx, atomsCache->passUnion20_id, &callable)) {
63488 aRv.Throw(NS_ERROR_UNEXPECTED);
63489 return;
63490 }
63491 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63492 if (!JS::Call(cx, thisValue, callable,
63493 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63494 aRv.NoteJSContextException(cx);
63495 return;
63496 }
63497}
63498
63499void
63500TestJSImplInterfaceJSImpl::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63501{
63502 CallSetup s(this, aRv, "TestJSImplInterface.passUnion21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63503 if (aRv.Failed()) {
63504 return;
63505 }
63506 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63506); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63507 BindingCallContext& cx = s.GetCallContext();
63508
63509 JS::Rooted<JS::Value> rval(cx);
63510 JS::RootedVector<JS::Value> argv(cx);
63511 if (!argv.resize(1)) {
63512 // That threw an exception on the JSContext, and our CallSetup will do
63513 // the right thing with that.
63514 return;
63515 }
63516 unsigned argc = 1;
63517
63518 do {
63519 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63520 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63521 aRv.Throw(NS_ERROR_UNEXPECTED);
63522 return;
63523 }
63524 break;
63525 } while (false);
63526
63527 JS::Rooted<JS::Value> callable(cx);
63528 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63529 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63530 !InitIds(cx, atomsCache)) ||
63531 !GetCallableProperty(cx, atomsCache->passUnion21_id, &callable)) {
63532 aRv.Throw(NS_ERROR_UNEXPECTED);
63533 return;
63534 }
63535 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63536 if (!JS::Call(cx, thisValue, callable,
63537 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63538 aRv.NoteJSContextException(cx);
63539 return;
63540 }
63541}
63542
63543void
63544TestJSImplInterfaceJSImpl::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63545{
63546 CallSetup s(this, aRv, "TestJSImplInterface.passUnion22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63547 if (aRv.Failed()) {
63548 return;
63549 }
63550 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63550); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63550); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63551 BindingCallContext& cx = s.GetCallContext();
63552
63553 JS::Rooted<JS::Value> rval(cx);
63554 JS::RootedVector<JS::Value> argv(cx);
63555 if (!argv.resize(1)) {
63556 // That threw an exception on the JSContext, and our CallSetup will do
63557 // the right thing with that.
63558 return;
63559 }
63560 unsigned argc = 1;
63561
63562 do {
63563 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63564 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63565 aRv.Throw(NS_ERROR_UNEXPECTED);
63566 return;
63567 }
63568 break;
63569 } while (false);
63570
63571 JS::Rooted<JS::Value> callable(cx);
63572 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63573 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63574 !InitIds(cx, atomsCache)) ||
63575 !GetCallableProperty(cx, atomsCache->passUnion22_id, &callable)) {
63576 aRv.Throw(NS_ERROR_UNEXPECTED);
63577 return;
63578 }
63579 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63580 if (!JS::Call(cx, thisValue, callable,
63581 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63582 aRv.NoteJSContextException(cx);
63583 return;
63584 }
63585}
63586
63587void
63588TestJSImplInterfaceJSImpl::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63589{
63590 CallSetup s(this, aRv, "TestJSImplInterface.passUnion23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63591 if (aRv.Failed()) {
63592 return;
63593 }
63594 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63594); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63594); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63595 BindingCallContext& cx = s.GetCallContext();
63596
63597 JS::Rooted<JS::Value> rval(cx);
63598 JS::RootedVector<JS::Value> argv(cx);
63599 if (!argv.resize(1)) {
63600 // That threw an exception on the JSContext, and our CallSetup will do
63601 // the right thing with that.
63602 return;
63603 }
63604 unsigned argc = 1;
63605
63606 do {
63607 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63608 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63609 aRv.Throw(NS_ERROR_UNEXPECTED);
63610 return;
63611 }
63612 break;
63613 } while (false);
63614
63615 JS::Rooted<JS::Value> callable(cx);
63616 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63617 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63618 !InitIds(cx, atomsCache)) ||
63619 !GetCallableProperty(cx, atomsCache->passUnion23_id, &callable)) {
63620 aRv.Throw(NS_ERROR_UNEXPECTED);
63621 return;
63622 }
63623 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63624 if (!JS::Call(cx, thisValue, callable,
63625 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63626 aRv.NoteJSContextException(cx);
63627 return;
63628 }
63629}
63630
63631void
63632TestJSImplInterfaceJSImpl::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63633{
63634 CallSetup s(this, aRv, "TestJSImplInterface.passUnion24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63635 if (aRv.Failed()) {
63636 return;
63637 }
63638 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63638); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63638); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63639 BindingCallContext& cx = s.GetCallContext();
63640
63641 JS::Rooted<JS::Value> rval(cx);
63642 JS::RootedVector<JS::Value> argv(cx);
63643 if (!argv.resize(1)) {
63644 // That threw an exception on the JSContext, and our CallSetup will do
63645 // the right thing with that.
63646 return;
63647 }
63648 unsigned argc = 1;
63649
63650 do {
63651 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63652 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63653 aRv.Throw(NS_ERROR_UNEXPECTED);
63654 return;
63655 }
63656 break;
63657 } while (false);
63658
63659 JS::Rooted<JS::Value> callable(cx);
63660 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63661 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63662 !InitIds(cx, atomsCache)) ||
63663 !GetCallableProperty(cx, atomsCache->passUnion24_id, &callable)) {
63664 aRv.Throw(NS_ERROR_UNEXPECTED);
63665 return;
63666 }
63667 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63668 if (!JS::Call(cx, thisValue, callable,
63669 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63670 aRv.NoteJSContextException(cx);
63671 return;
63672 }
63673}
63674
63675void
63676TestJSImplInterfaceJSImpl::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63677{
63678 CallSetup s(this, aRv, "TestJSImplInterface.passUnion25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63679 if (aRv.Failed()) {
63680 return;
63681 }
63682 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63682); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63682); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63683 BindingCallContext& cx = s.GetCallContext();
63684
63685 JS::Rooted<JS::Value> rval(cx);
63686 JS::RootedVector<JS::Value> argv(cx);
63687 if (!argv.resize(1)) {
63688 // That threw an exception on the JSContext, and our CallSetup will do
63689 // the right thing with that.
63690 return;
63691 }
63692 unsigned argc = 1;
63693
63694 do {
63695 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63696 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63697 aRv.Throw(NS_ERROR_UNEXPECTED);
63698 return;
63699 }
63700 break;
63701 } while (false);
63702
63703 JS::Rooted<JS::Value> callable(cx);
63704 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63705 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63706 !InitIds(cx, atomsCache)) ||
63707 !GetCallableProperty(cx, atomsCache->passUnion25_id, &callable)) {
63708 aRv.Throw(NS_ERROR_UNEXPECTED);
63709 return;
63710 }
63711 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63712 if (!JS::Call(cx, thisValue, callable,
63713 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63714 aRv.NoteJSContextException(cx);
63715 return;
63716 }
63717}
63718
63719void
63720TestJSImplInterfaceJSImpl::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63721{
63722 CallSetup s(this, aRv, "TestJSImplInterface.passUnion26", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63723 if (aRv.Failed()) {
63724 return;
63725 }
63726 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63726); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63726); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63727 BindingCallContext& cx = s.GetCallContext();
63728
63729 JS::Rooted<JS::Value> rval(cx);
63730 JS::RootedVector<JS::Value> argv(cx);
63731 if (!argv.resize(1)) {
63732 // That threw an exception on the JSContext, and our CallSetup will do
63733 // the right thing with that.
63734 return;
63735 }
63736 unsigned argc = 1;
63737
63738 do {
63739 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63740 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63741 aRv.Throw(NS_ERROR_UNEXPECTED);
63742 return;
63743 }
63744 break;
63745 } while (false);
63746
63747 JS::Rooted<JS::Value> callable(cx);
63748 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63749 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63750 !InitIds(cx, atomsCache)) ||
63751 !GetCallableProperty(cx, atomsCache->passUnion26_id, &callable)) {
63752 aRv.Throw(NS_ERROR_UNEXPECTED);
63753 return;
63754 }
63755 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63756 if (!JS::Call(cx, thisValue, callable,
63757 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63758 aRv.NoteJSContextException(cx);
63759 return;
63760 }
63761}
63762
63763void
63764TestJSImplInterfaceJSImpl::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm)
63765{
63766 CallSetup s(this, aRv, "TestJSImplInterface.passUnion27", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63767 if (aRv.Failed()) {
63768 return;
63769 }
63770 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63770); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63770); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63771 BindingCallContext& cx = s.GetCallContext();
63772
63773 JS::Rooted<JS::Value> rval(cx);
63774 JS::RootedVector<JS::Value> argv(cx);
63775 if (!argv.resize(1)) {
63776 // That threw an exception on the JSContext, and our CallSetup will do
63777 // the right thing with that.
63778 return;
63779 }
63780 unsigned argc = 1;
63781
63782 do {
63783 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63784 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63785 aRv.Throw(NS_ERROR_UNEXPECTED);
63786 return;
63787 }
63788 break;
63789 } while (false);
63790
63791 JS::Rooted<JS::Value> callable(cx);
63792 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63793 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63794 !InitIds(cx, atomsCache)) ||
63795 !GetCallableProperty(cx, atomsCache->passUnion27_id, &callable)) {
63796 aRv.Throw(NS_ERROR_UNEXPECTED);
63797 return;
63798 }
63799 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63800 if (!JS::Call(cx, thisValue, callable,
63801 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63802 aRv.NoteJSContextException(cx);
63803 return;
63804 }
63805}
63806
63807void
63808TestJSImplInterfaceJSImpl::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
63809{
63810 CallSetup s(this, aRv, "TestJSImplInterface.passUnion28", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63811 if (aRv.Failed()) {
63812 return;
63813 }
63814 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63814); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63814); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63815 BindingCallContext& cx = s.GetCallContext();
63816
63817 JS::Rooted<JS::Value> rval(cx);
63818 JS::RootedVector<JS::Value> argv(cx);
63819 if (!argv.resize(1)) {
63820 // That threw an exception on the JSContext, and our CallSetup will do
63821 // the right thing with that.
63822 return;
63823 }
63824 unsigned argc = 1;
63825
63826 do {
63827 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63828 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63829 aRv.Throw(NS_ERROR_UNEXPECTED);
63830 return;
63831 }
63832 break;
63833 } while (false);
63834
63835 JS::Rooted<JS::Value> callable(cx);
63836 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63837 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63838 !InitIds(cx, atomsCache)) ||
63839 !GetCallableProperty(cx, atomsCache->passUnion28_id, &callable)) {
63840 aRv.Throw(NS_ERROR_UNEXPECTED);
63841 return;
63842 }
63843 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63844 if (!JS::Call(cx, thisValue, callable,
63845 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63846 aRv.NoteJSContextException(cx);
63847 return;
63848 }
63849}
63850
63851void
63852TestJSImplInterfaceJSImpl::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63853{
63854 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63855 if (aRv.Failed()) {
63856 return;
63857 }
63858 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63858); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63858); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63859 BindingCallContext& cx = s.GetCallContext();
63860
63861 JS::Rooted<JS::Value> rval(cx);
63862 JS::RootedVector<JS::Value> argv(cx);
63863 if (!argv.resize(1)) {
63864 // That threw an exception on the JSContext, and our CallSetup will do
63865 // the right thing with that.
63866 return;
63867 }
63868 unsigned argc = 1;
63869
63870 do {
63871 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63872 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63873 aRv.Throw(NS_ERROR_UNEXPECTED);
63874 return;
63875 }
63876 break;
63877 } while (false);
63878
63879 JS::Rooted<JS::Value> callable(cx);
63880 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63881 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63882 !InitIds(cx, atomsCache)) ||
63883 !GetCallableProperty(cx, atomsCache->passUnionWithCallback_id, &callable)) {
63884 aRv.Throw(NS_ERROR_UNEXPECTED);
63885 return;
63886 }
63887 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63888 if (!JS::Call(cx, thisValue, callable,
63889 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63890 aRv.NoteJSContextException(cx);
63891 return;
63892 }
63893}
63894
63895void
63896TestJSImplInterfaceJSImpl::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63897{
63898 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63899 if (aRv.Failed()) {
63900 return;
63901 }
63902 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63902); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63902); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63903 BindingCallContext& cx = s.GetCallContext();
63904
63905 JS::Rooted<JS::Value> rval(cx);
63906 JS::RootedVector<JS::Value> argv(cx);
63907 if (!argv.resize(1)) {
63908 // That threw an exception on the JSContext, and our CallSetup will do
63909 // the right thing with that.
63910 return;
63911 }
63912 unsigned argc = 1;
63913
63914 do {
63915 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63916 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63917 aRv.Throw(NS_ERROR_UNEXPECTED);
63918 return;
63919 }
63920 break;
63921 } while (false);
63922
63923 JS::Rooted<JS::Value> callable(cx);
63924 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63925 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63926 !InitIds(cx, atomsCache)) ||
63927 !GetCallableProperty(cx, atomsCache->passUnionWithByteString_id, &callable)) {
63928 aRv.Throw(NS_ERROR_UNEXPECTED);
63929 return;
63930 }
63931 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63932 if (!JS::Call(cx, thisValue, callable,
63933 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63934 aRv.NoteJSContextException(cx);
63935 return;
63936 }
63937}
63938
63939void
63940TestJSImplInterfaceJSImpl::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63941{
63942 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63943 if (aRv.Failed()) {
63944 return;
63945 }
63946 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63946); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63946); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63947 BindingCallContext& cx = s.GetCallContext();
63948
63949 JS::Rooted<JS::Value> rval(cx);
63950 JS::RootedVector<JS::Value> argv(cx);
63951 if (!argv.resize(1)) {
63952 // That threw an exception on the JSContext, and our CallSetup will do
63953 // the right thing with that.
63954 return;
63955 }
63956 unsigned argc = 1;
63957
63958 do {
63959 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63960 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63961 aRv.Throw(NS_ERROR_UNEXPECTED);
63962 return;
63963 }
63964 break;
63965 } while (false);
63966
63967 JS::Rooted<JS::Value> callable(cx);
63968 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63969 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63970 !InitIds(cx, atomsCache)) ||
63971 !GetCallableProperty(cx, atomsCache->passUnionWithUTF8String_id, &callable)) {
63972 aRv.Throw(NS_ERROR_UNEXPECTED);
63973 return;
63974 }
63975 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63976 if (!JS::Call(cx, thisValue, callable,
63977 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63978 aRv.NoteJSContextException(cx);
63979 return;
63980 }
63981}
63982
63983void
63984TestJSImplInterfaceJSImpl::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
63985{
63986 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63987 if (aRv.Failed()) {
63988 return;
63989 }
63990 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63990); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 63990); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
63991 BindingCallContext& cx = s.GetCallContext();
63992
63993 JS::Rooted<JS::Value> rval(cx);
63994 JS::RootedVector<JS::Value> argv(cx);
63995 if (!argv.resize(1)) {
63996 // That threw an exception on the JSContext, and our CallSetup will do
63997 // the right thing with that.
63998 return;
63999 }
64000 unsigned argc = 1;
64001
64002 do {
64003 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64004 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64005 aRv.Throw(NS_ERROR_UNEXPECTED);
64006 return;
64007 }
64008 break;
64009 } while (false);
64010
64011 JS::Rooted<JS::Value> callable(cx);
64012 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64013 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64014 !InitIds(cx, atomsCache)) ||
64015 !GetCallableProperty(cx, atomsCache->passUnionWithRecord_id, &callable)) {
64016 aRv.Throw(NS_ERROR_UNEXPECTED);
64017 return;
64018 }
64019 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64020 if (!JS::Call(cx, thisValue, callable,
64021 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64022 aRv.NoteJSContextException(cx);
64023 return;
64024 }
64025}
64026
64027void
64028TestJSImplInterfaceJSImpl::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
64029{
64030 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecordAndSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64031 if (aRv.Failed()) {
64032 return;
64033 }
64034 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64034); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64034); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64035 BindingCallContext& cx = s.GetCallContext();
64036
64037 JS::Rooted<JS::Value> rval(cx);
64038 JS::RootedVector<JS::Value> argv(cx);
64039 if (!argv.resize(1)) {
64040 // That threw an exception on the JSContext, and our CallSetup will do
64041 // the right thing with that.
64042 return;
64043 }
64044 unsigned argc = 1;
64045
64046 do {
64047 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64048 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64049 aRv.Throw(NS_ERROR_UNEXPECTED);
64050 return;
64051 }
64052 break;
64053 } while (false);
64054
64055 JS::Rooted<JS::Value> callable(cx);
64056 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64057 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64058 !InitIds(cx, atomsCache)) ||
64059 !GetCallableProperty(cx, atomsCache->passUnionWithRecordAndSequence_id, &callable)) {
64060 aRv.Throw(NS_ERROR_UNEXPECTED);
64061 return;
64062 }
64063 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64064 if (!JS::Call(cx, thisValue, callable,
64065 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64066 aRv.NoteJSContextException(cx);
64067 return;
64068 }
64069}
64070
64071void
64072TestJSImplInterfaceJSImpl::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm)
64073{
64074 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSequenceAndRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64075 if (aRv.Failed()) {
64076 return;
64077 }
64078 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64078); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64078); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64079 BindingCallContext& cx = s.GetCallContext();
64080
64081 JS::Rooted<JS::Value> rval(cx);
64082 JS::RootedVector<JS::Value> argv(cx);
64083 if (!argv.resize(1)) {
64084 // That threw an exception on the JSContext, and our CallSetup will do
64085 // the right thing with that.
64086 return;
64087 }
64088 unsigned argc = 1;
64089
64090 do {
64091 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64092 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64093 aRv.Throw(NS_ERROR_UNEXPECTED);
64094 return;
64095 }
64096 break;
64097 } while (false);
64098
64099 JS::Rooted<JS::Value> callable(cx);
64100 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64101 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64102 !InitIds(cx, atomsCache)) ||
64103 !GetCallableProperty(cx, atomsCache->passUnionWithSequenceAndRecord_id, &callable)) {
64104 aRv.Throw(NS_ERROR_UNEXPECTED);
64105 return;
64106 }
64107 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64108 if (!JS::Call(cx, thisValue, callable,
64109 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64110 aRv.NoteJSContextException(cx);
64111 return;
64112 }
64113}
64114
64115void
64116TestJSImplInterfaceJSImpl::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
64117{
64118 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64119 if (aRv.Failed()) {
64120 return;
64121 }
64122 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64122); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64122); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64123 BindingCallContext& cx = s.GetCallContext();
64124
64125 JS::Rooted<JS::Value> rval(cx);
64126 JS::RootedVector<JS::Value> argv(cx);
64127 if (!argv.resize(1)) {
64128 // That threw an exception on the JSContext, and our CallSetup will do
64129 // the right thing with that.
64130 return;
64131 }
64132 unsigned argc = 1;
64133
64134 do {
64135 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64136 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64137 aRv.Throw(NS_ERROR_UNEXPECTED);
64138 return;
64139 }
64140 break;
64141 } while (false);
64142
64143 JS::Rooted<JS::Value> callable(cx);
64144 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64145 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64146 !InitIds(cx, atomsCache)) ||
64147 !GetCallableProperty(cx, atomsCache->passUnionWithSVS_id, &callable)) {
64148 aRv.Throw(NS_ERROR_UNEXPECTED);
64149 return;
64150 }
64151 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64152 if (!JS::Call(cx, thisValue, callable,
64153 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64154 aRv.NoteJSContextException(cx);
64155 return;
64156 }
64157}
64158
64159void
64160TestJSImplInterfaceJSImpl::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
64161{
64162 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64163 if (aRv.Failed()) {
64164 return;
64165 }
64166 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64166); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64166); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64167 BindingCallContext& cx = s.GetCallContext();
64168
64169 JS::Rooted<JS::Value> rval(cx);
64170 JS::RootedVector<JS::Value> argv(cx);
64171 if (!argv.resize(1)) {
64172 // That threw an exception on the JSContext, and our CallSetup will do
64173 // the right thing with that.
64174 return;
64175 }
64176 unsigned argc = 1;
64177
64178 do {
64179 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64180 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64181 aRv.Throw(NS_ERROR_UNEXPECTED);
64182 return;
64183 }
64184 break;
64185 } while (false);
64186
64187 JS::Rooted<JS::Value> callable(cx);
64188 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64189 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64190 !InitIds(cx, atomsCache)) ||
64191 !GetCallableProperty(cx, atomsCache->passUnionWithNullable_id, &callable)) {
64192 aRv.Throw(NS_ERROR_UNEXPECTED);
64193 return;
64194 }
64195 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64196 if (!JS::Call(cx, thisValue, callable,
64197 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64198 aRv.NoteJSContextException(cx);
64199 return;
64200 }
64201}
64202
64203void
64204TestJSImplInterfaceJSImpl::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64205{
64206 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64207 if (aRv.Failed()) {
64208 return;
64209 }
64210 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64210); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64210); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64211 BindingCallContext& cx = s.GetCallContext();
64212
64213 JS::Rooted<JS::Value> rval(cx);
64214 JS::RootedVector<JS::Value> argv(cx);
64215 if (!argv.resize(1)) {
64216 // That threw an exception on the JSContext, and our CallSetup will do
64217 // the right thing with that.
64218 return;
64219 }
64220 unsigned argc = 1;
64221
64222 do {
64223 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64224 if (arg.IsNull()) {
64225 argv[0].setNull();
64226 break;
64227 }
64228 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64229 aRv.Throw(NS_ERROR_UNEXPECTED);
64230 return;
64231 }
64232 break;
64233 } while (false);
64234
64235 JS::Rooted<JS::Value> callable(cx);
64236 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64237 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64238 !InitIds(cx, atomsCache)) ||
64239 !GetCallableProperty(cx, atomsCache->passNullableUnion_id, &callable)) {
64240 aRv.Throw(NS_ERROR_UNEXPECTED);
64241 return;
64242 }
64243 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64244 if (!JS::Call(cx, thisValue, callable,
64245 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64246 aRv.NoteJSContextException(cx);
64247 return;
64248 }
64249}
64250
64251void
64252TestJSImplInterfaceJSImpl::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64253{
64254 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64255 if (aRv.Failed()) {
64256 return;
64257 }
64258 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64258); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64258); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64259 BindingCallContext& cx = s.GetCallContext();
64260
64261 JS::Rooted<JS::Value> rval(cx);
64262 JS::RootedVector<JS::Value> argv(cx);
64263 if (!argv.resize(1)) {
64264 // That threw an exception on the JSContext, and our CallSetup will do
64265 // the right thing with that.
64266 return;
64267 }
64268 unsigned argc = 1;
64269
64270 do {
64271 if (arg.WasPassed()) {
64272 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64273 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64274 aRv.Throw(NS_ERROR_UNEXPECTED);
64275 return;
64276 }
64277 break;
64278 } else if (argc == 1) {
64279 // This is our current trailing argument; reduce argc
64280 --argc;
64281 } else {
64282 argv[0].setUndefined();
64283 }
64284 } while (false);
64285
64286 JS::Rooted<JS::Value> callable(cx);
64287 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64288 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64289 !InitIds(cx, atomsCache)) ||
64290 !GetCallableProperty(cx, atomsCache->passOptionalUnion_id, &callable)) {
64291 aRv.Throw(NS_ERROR_UNEXPECTED);
64292 return;
64293 }
64294 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64295 if (!JS::Call(cx, thisValue, callable,
64296 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64297 aRv.NoteJSContextException(cx);
64298 return;
64299 }
64300}
64301
64302void
64303TestJSImplInterfaceJSImpl::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64304{
64305 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64306 if (aRv.Failed()) {
64307 return;
64308 }
64309 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64309); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64310 BindingCallContext& cx = s.GetCallContext();
64311
64312 JS::Rooted<JS::Value> rval(cx);
64313 JS::RootedVector<JS::Value> argv(cx);
64314 if (!argv.resize(1)) {
64315 // That threw an exception on the JSContext, and our CallSetup will do
64316 // the right thing with that.
64317 return;
64318 }
64319 unsigned argc = 1;
64320
64321 do {
64322 if (arg.WasPassed()) {
64323 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64324 if (arg.Value().IsNull()) {
64325 argv[0].setNull();
64326 break;
64327 }
64328 if (!arg.Value().Value().ToJSVal(cx, callbackObj, argv[0])) {
64329 aRv.Throw(NS_ERROR_UNEXPECTED);
64330 return;
64331 }
64332 break;
64333 } else if (argc == 1) {
64334 // This is our current trailing argument; reduce argc
64335 --argc;
64336 } else {
64337 argv[0].setUndefined();
64338 }
64339 } while (false);
64340
64341 JS::Rooted<JS::Value> callable(cx);
64342 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64343 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64344 !InitIds(cx, atomsCache)) ||
64345 !GetCallableProperty(cx, atomsCache->passOptionalNullableUnion_id, &callable)) {
64346 aRv.Throw(NS_ERROR_UNEXPECTED);
64347 return;
64348 }
64349 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64350 if (!JS::Call(cx, thisValue, callable,
64351 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64352 aRv.NoteJSContextException(cx);
64353 return;
64354 }
64355}
64356
64357void
64358TestJSImplInterfaceJSImpl::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64359{
64360 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64361 if (aRv.Failed()) {
64362 return;
64363 }
64364 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64364); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64364); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64365 BindingCallContext& cx = s.GetCallContext();
64366
64367 JS::Rooted<JS::Value> rval(cx);
64368 JS::RootedVector<JS::Value> argv(cx);
64369 if (!argv.resize(1)) {
64370 // That threw an exception on the JSContext, and our CallSetup will do
64371 // the right thing with that.
64372 return;
64373 }
64374 unsigned argc = 1;
64375
64376 do {
64377 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64378 if (arg.IsNull()) {
64379 argv[0].setNull();
64380 break;
64381 }
64382 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64383 aRv.Throw(NS_ERROR_UNEXPECTED);
64384 return;
64385 }
64386 break;
64387 } while (false);
64388
64389 JS::Rooted<JS::Value> callable(cx);
64390 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64391 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64392 !InitIds(cx, atomsCache)) ||
64393 !GetCallableProperty(cx, atomsCache->passOptionalNullableUnionWithDefaultValue_id, &callable)) {
64394 aRv.Throw(NS_ERROR_UNEXPECTED);
64395 return;
64396 }
64397 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64398 if (!JS::Call(cx, thisValue, callable,
64399 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64400 aRv.NoteJSContextException(cx);
64401 return;
64402 }
64403}
64404
64405void
64406TestJSImplInterfaceJSImpl::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
64407{
64408 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64409 if (aRv.Failed()) {
64410 return;
64411 }
64412 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64412); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64412); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64413 BindingCallContext& cx = s.GetCallContext();
64414
64415 JS::Rooted<JS::Value> rval(cx);
64416 JS::RootedVector<JS::Value> argv(cx);
64417 if (!argv.resize(1)) {
64418 // That threw an exception on the JSContext, and our CallSetup will do
64419 // the right thing with that.
64420 return;
64421 }
64422 unsigned argc = 1;
64423
64424 do {
64425 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64426 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64427 aRv.Throw(NS_ERROR_UNEXPECTED);
64428 return;
64429 }
64430 break;
64431 } while (false);
64432
64433 JS::Rooted<JS::Value> callable(cx);
64434 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64435 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64436 !InitIds(cx, atomsCache)) ||
64437 !GetCallableProperty(cx, atomsCache->passUnionWithArrayBuffer_id, &callable)) {
64438 aRv.Throw(NS_ERROR_UNEXPECTED);
64439 return;
64440 }
64441 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64442 if (!JS::Call(cx, thisValue, callable,
64443 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64444 aRv.NoteJSContextException(cx);
64445 return;
64446 }
64447}
64448
64449void
64450TestJSImplInterfaceJSImpl::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
64451{
64452 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBufferOrNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64453 if (aRv.Failed()) {
64454 return;
64455 }
64456 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64456); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64456); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64457 BindingCallContext& cx = s.GetCallContext();
64458
64459 JS::Rooted<JS::Value> rval(cx);
64460 JS::RootedVector<JS::Value> argv(cx);
64461 if (!argv.resize(1)) {
64462 // That threw an exception on the JSContext, and our CallSetup will do
64463 // the right thing with that.
64464 return;
64465 }
64466 unsigned argc = 1;
64467
64468 do {
64469 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64470 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64471 aRv.Throw(NS_ERROR_UNEXPECTED);
64472 return;
64473 }
64474 break;
64475 } while (false);
64476
64477 JS::Rooted<JS::Value> callable(cx);
64478 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64479 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64480 !InitIds(cx, atomsCache)) ||
64481 !GetCallableProperty(cx, atomsCache->passUnionWithArrayBufferOrNull_id, &callable)) {
64482 aRv.Throw(NS_ERROR_UNEXPECTED);
64483 return;
64484 }
64485 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64486 if (!JS::Call(cx, thisValue, callable,
64487 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64488 aRv.NoteJSContextException(cx);
64489 return;
64490 }
64491}
64492
64493void
64494TestJSImplInterfaceJSImpl::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
64495{
64496 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArrays", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64497 if (aRv.Failed()) {
64498 return;
64499 }
64500 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64500); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64501 BindingCallContext& cx = s.GetCallContext();
64502
64503 JS::Rooted<JS::Value> rval(cx);
64504 JS::RootedVector<JS::Value> argv(cx);
64505 if (!argv.resize(1)) {
64506 // That threw an exception on the JSContext, and our CallSetup will do
64507 // the right thing with that.
64508 return;
64509 }
64510 unsigned argc = 1;
64511
64512 do {
64513 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64514 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64515 aRv.Throw(NS_ERROR_UNEXPECTED);
64516 return;
64517 }
64518 break;
64519 } while (false);
64520
64521 JS::Rooted<JS::Value> callable(cx);
64522 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64523 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64524 !InitIds(cx, atomsCache)) ||
64525 !GetCallableProperty(cx, atomsCache->passUnionWithTypedArrays_id, &callable)) {
64526 aRv.Throw(NS_ERROR_UNEXPECTED);
64527 return;
64528 }
64529 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64530 if (!JS::Call(cx, thisValue, callable,
64531 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64532 aRv.NoteJSContextException(cx);
64533 return;
64534 }
64535}
64536
64537void
64538TestJSImplInterfaceJSImpl::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
64539{
64540 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArraysOrNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64541 if (aRv.Failed()) {
64542 return;
64543 }
64544 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64544); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64545 BindingCallContext& cx = s.GetCallContext();
64546
64547 JS::Rooted<JS::Value> rval(cx);
64548 JS::RootedVector<JS::Value> argv(cx);
64549 if (!argv.resize(1)) {
64550 // That threw an exception on the JSContext, and our CallSetup will do
64551 // the right thing with that.
64552 return;
64553 }
64554 unsigned argc = 1;
64555
64556 do {
64557 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64558 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64559 aRv.Throw(NS_ERROR_UNEXPECTED);
64560 return;
64561 }
64562 break;
64563 } while (false);
64564
64565 JS::Rooted<JS::Value> callable(cx);
64566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64568 !InitIds(cx, atomsCache)) ||
64569 !GetCallableProperty(cx, atomsCache->passUnionWithTypedArraysOrNull_id, &callable)) {
64570 aRv.Throw(NS_ERROR_UNEXPECTED);
64571 return;
64572 }
64573 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64574 if (!JS::Call(cx, thisValue, callable,
64575 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64576 aRv.NoteJSContextException(cx);
64577 return;
64578 }
64579}
64580
64581void
64582TestJSImplInterfaceJSImpl::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
64583{
64584 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64585 if (aRv.Failed()) {
64586 return;
64587 }
64588 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64588); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64589 BindingCallContext& cx = s.GetCallContext();
64590
64591 JS::Rooted<JS::Value> rval(cx);
64592 JS::RootedVector<JS::Value> argv(cx);
64593 if (!argv.resize(1)) {
64594 // That threw an exception on the JSContext, and our CallSetup will do
64595 // the right thing with that.
64596 return;
64597 }
64598 unsigned argc = 1;
64599
64600 do {
64601 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64602 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64603 aRv.Throw(NS_ERROR_UNEXPECTED);
64604 return;
64605 }
64606 break;
64607 } while (false);
64608
64609 JS::Rooted<JS::Value> callable(cx);
64610 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64611 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64612 !InitIds(cx, atomsCache)) ||
64613 !GetCallableProperty(cx, atomsCache->passUnionWithString_id, &callable)) {
64614 aRv.Throw(NS_ERROR_UNEXPECTED);
64615 return;
64616 }
64617 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64618 if (!JS::Call(cx, thisValue, callable,
64619 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64620 aRv.NoteJSContextException(cx);
64621 return;
64622 }
64623}
64624
64625void
64626TestJSImplInterfaceJSImpl::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
64627{
64628 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64629 if (aRv.Failed()) {
64630 return;
64631 }
64632 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64632); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64632); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64633 BindingCallContext& cx = s.GetCallContext();
64634
64635 JS::Rooted<JS::Value> rval(cx);
64636 JS::RootedVector<JS::Value> argv(cx);
64637 if (!argv.resize(1)) {
64638 // That threw an exception on the JSContext, and our CallSetup will do
64639 // the right thing with that.
64640 return;
64641 }
64642 unsigned argc = 1;
64643
64644 do {
64645 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64646 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64647 aRv.Throw(NS_ERROR_UNEXPECTED);
64648 return;
64649 }
64650 break;
64651 } while (false);
64652
64653 JS::Rooted<JS::Value> callable(cx);
64654 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64655 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64656 !InitIds(cx, atomsCache)) ||
64657 !GetCallableProperty(cx, atomsCache->passUnionWithEnum_id, &callable)) {
64658 aRv.Throw(NS_ERROR_UNEXPECTED);
64659 return;
64660 }
64661 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64662 if (!JS::Call(cx, thisValue, callable,
64663 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64664 aRv.NoteJSContextException(cx);
64665 return;
64666 }
64667}
64668
64669void
64670TestJSImplInterfaceJSImpl::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
64671{
64672 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64673 if (aRv.Failed()) {
64674 return;
64675 }
64676 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64676); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64676); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64677 BindingCallContext& cx = s.GetCallContext();
64678
64679 JS::Rooted<JS::Value> rval(cx);
64680 JS::RootedVector<JS::Value> argv(cx);
64681 if (!argv.resize(1)) {
64682 // That threw an exception on the JSContext, and our CallSetup will do
64683 // the right thing with that.
64684 return;
64685 }
64686 unsigned argc = 1;
64687
64688 do {
64689 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64690 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64691 aRv.Throw(NS_ERROR_UNEXPECTED);
64692 return;
64693 }
64694 break;
64695 } while (false);
64696
64697 JS::Rooted<JS::Value> callable(cx);
64698 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64699 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64700 !InitIds(cx, atomsCache)) ||
64701 !GetCallableProperty(cx, atomsCache->passUnionWithObject_id, &callable)) {
64702 aRv.Throw(NS_ERROR_UNEXPECTED);
64703 return;
64704 }
64705 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64706 if (!JS::Call(cx, thisValue, callable,
64707 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64708 aRv.NoteJSContextException(cx);
64709 return;
64710 }
64711}
64712
64713void
64714TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64715{
64716 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64717 if (aRv.Failed()) {
64718 return;
64719 }
64720 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64720); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64720); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64721 BindingCallContext& cx = s.GetCallContext();
64722
64723 JS::Rooted<JS::Value> rval(cx);
64724 JS::RootedVector<JS::Value> argv(cx);
64725 if (!argv.resize(1)) {
64726 // That threw an exception on the JSContext, and our CallSetup will do
64727 // the right thing with that.
64728 return;
64729 }
64730 unsigned argc = 1;
64731
64732 do {
64733 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64734 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64735 aRv.Throw(NS_ERROR_UNEXPECTED);
64736 return;
64737 }
64738 break;
64739 } while (false);
64740
64741 JS::Rooted<JS::Value> callable(cx);
64742 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64743 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64744 !InitIds(cx, atomsCache)) ||
64745 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue1_id, &callable)) {
64746 aRv.Throw(NS_ERROR_UNEXPECTED);
64747 return;
64748 }
64749 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64750 if (!JS::Call(cx, thisValue, callable,
64751 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64752 aRv.NoteJSContextException(cx);
64753 return;
64754 }
64755}
64756
64757void
64758TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64759{
64760 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64761 if (aRv.Failed()) {
64762 return;
64763 }
64764 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64764); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64765 BindingCallContext& cx = s.GetCallContext();
64766
64767 JS::Rooted<JS::Value> rval(cx);
64768 JS::RootedVector<JS::Value> argv(cx);
64769 if (!argv.resize(1)) {
64770 // That threw an exception on the JSContext, and our CallSetup will do
64771 // the right thing with that.
64772 return;
64773 }
64774 unsigned argc = 1;
64775
64776 do {
64777 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64778 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64779 aRv.Throw(NS_ERROR_UNEXPECTED);
64780 return;
64781 }
64782 break;
64783 } while (false);
64784
64785 JS::Rooted<JS::Value> callable(cx);
64786 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64787 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64788 !InitIds(cx, atomsCache)) ||
64789 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue2_id, &callable)) {
64790 aRv.Throw(NS_ERROR_UNEXPECTED);
64791 return;
64792 }
64793 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64794 if (!JS::Call(cx, thisValue, callable,
64795 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64796 aRv.NoteJSContextException(cx);
64797 return;
64798 }
64799}
64800
64801void
64802TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64803{
64804 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64805 if (aRv.Failed()) {
64806 return;
64807 }
64808 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64808); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64808); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64809 BindingCallContext& cx = s.GetCallContext();
64810
64811 JS::Rooted<JS::Value> rval(cx);
64812 JS::RootedVector<JS::Value> argv(cx);
64813 if (!argv.resize(1)) {
64814 // That threw an exception on the JSContext, and our CallSetup will do
64815 // the right thing with that.
64816 return;
64817 }
64818 unsigned argc = 1;
64819
64820 do {
64821 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64822 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64823 aRv.Throw(NS_ERROR_UNEXPECTED);
64824 return;
64825 }
64826 break;
64827 } while (false);
64828
64829 JS::Rooted<JS::Value> callable(cx);
64830 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64831 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64832 !InitIds(cx, atomsCache)) ||
64833 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue3_id, &callable)) {
64834 aRv.Throw(NS_ERROR_UNEXPECTED);
64835 return;
64836 }
64837 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64838 if (!JS::Call(cx, thisValue, callable,
64839 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64840 aRv.NoteJSContextException(cx);
64841 return;
64842 }
64843}
64844
64845void
64846TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64847{
64848 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64849 if (aRv.Failed()) {
64850 return;
64851 }
64852 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64852); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64852); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64853 BindingCallContext& cx = s.GetCallContext();
64854
64855 JS::Rooted<JS::Value> rval(cx);
64856 JS::RootedVector<JS::Value> argv(cx);
64857 if (!argv.resize(1)) {
64858 // That threw an exception on the JSContext, and our CallSetup will do
64859 // the right thing with that.
64860 return;
64861 }
64862 unsigned argc = 1;
64863
64864 do {
64865 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64866 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64867 aRv.Throw(NS_ERROR_UNEXPECTED);
64868 return;
64869 }
64870 break;
64871 } while (false);
64872
64873 JS::Rooted<JS::Value> callable(cx);
64874 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64875 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64876 !InitIds(cx, atomsCache)) ||
64877 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue4_id, &callable)) {
64878 aRv.Throw(NS_ERROR_UNEXPECTED);
64879 return;
64880 }
64881 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64882 if (!JS::Call(cx, thisValue, callable,
64883 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64884 aRv.NoteJSContextException(cx);
64885 return;
64886 }
64887}
64888
64889void
64890TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64891{
64892 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64893 if (aRv.Failed()) {
64894 return;
64895 }
64896 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64896); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64896); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64897 BindingCallContext& cx = s.GetCallContext();
64898
64899 JS::Rooted<JS::Value> rval(cx);
64900 JS::RootedVector<JS::Value> argv(cx);
64901 if (!argv.resize(1)) {
64902 // That threw an exception on the JSContext, and our CallSetup will do
64903 // the right thing with that.
64904 return;
64905 }
64906 unsigned argc = 1;
64907
64908 do {
64909 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64910 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64911 aRv.Throw(NS_ERROR_UNEXPECTED);
64912 return;
64913 }
64914 break;
64915 } while (false);
64916
64917 JS::Rooted<JS::Value> callable(cx);
64918 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64919 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64920 !InitIds(cx, atomsCache)) ||
64921 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue5_id, &callable)) {
64922 aRv.Throw(NS_ERROR_UNEXPECTED);
64923 return;
64924 }
64925 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64926 if (!JS::Call(cx, thisValue, callable,
64927 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64928 aRv.NoteJSContextException(cx);
64929 return;
64930 }
64931}
64932
64933void
64934TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64935{
64936 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64937 if (aRv.Failed()) {
64938 return;
64939 }
64940 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64940); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64941 BindingCallContext& cx = s.GetCallContext();
64942
64943 JS::Rooted<JS::Value> rval(cx);
64944 JS::RootedVector<JS::Value> argv(cx);
64945 if (!argv.resize(1)) {
64946 // That threw an exception on the JSContext, and our CallSetup will do
64947 // the right thing with that.
64948 return;
64949 }
64950 unsigned argc = 1;
64951
64952 do {
64953 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64954 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64955 aRv.Throw(NS_ERROR_UNEXPECTED);
64956 return;
64957 }
64958 break;
64959 } while (false);
64960
64961 JS::Rooted<JS::Value> callable(cx);
64962 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64963 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64964 !InitIds(cx, atomsCache)) ||
64965 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue6_id, &callable)) {
64966 aRv.Throw(NS_ERROR_UNEXPECTED);
64967 return;
64968 }
64969 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64970 if (!JS::Call(cx, thisValue, callable,
64971 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64972 aRv.NoteJSContextException(cx);
64973 return;
64974 }
64975}
64976
64977void
64978TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64979{
64980 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64981 if (aRv.Failed()) {
64982 return;
64983 }
64984 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64984); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 64984); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
64985 BindingCallContext& cx = s.GetCallContext();
64986
64987 JS::Rooted<JS::Value> rval(cx);
64988 JS::RootedVector<JS::Value> argv(cx);
64989 if (!argv.resize(1)) {
64990 // That threw an exception on the JSContext, and our CallSetup will do
64991 // the right thing with that.
64992 return;
64993 }
64994 unsigned argc = 1;
64995
64996 do {
64997 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64998 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64999 aRv.Throw(NS_ERROR_UNEXPECTED);
65000 return;
65001 }
65002 break;
65003 } while (false);
65004
65005 JS::Rooted<JS::Value> callable(cx);
65006 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65007 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65008 !InitIds(cx, atomsCache)) ||
65009 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue7_id, &callable)) {
65010 aRv.Throw(NS_ERROR_UNEXPECTED);
65011 return;
65012 }
65013 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65014 if (!JS::Call(cx, thisValue, callable,
65015 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65016 aRv.NoteJSContextException(cx);
65017 return;
65018 }
65019}
65020
65021void
65022TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65023{
65024 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65025 if (aRv.Failed()) {
65026 return;
65027 }
65028 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65028); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65028); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65029 BindingCallContext& cx = s.GetCallContext();
65030
65031 JS::Rooted<JS::Value> rval(cx);
65032 JS::RootedVector<JS::Value> argv(cx);
65033 if (!argv.resize(1)) {
65034 // That threw an exception on the JSContext, and our CallSetup will do
65035 // the right thing with that.
65036 return;
65037 }
65038 unsigned argc = 1;
65039
65040 do {
65041 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65042 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65043 aRv.Throw(NS_ERROR_UNEXPECTED);
65044 return;
65045 }
65046 break;
65047 } while (false);
65048
65049 JS::Rooted<JS::Value> callable(cx);
65050 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65051 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65052 !InitIds(cx, atomsCache)) ||
65053 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue8_id, &callable)) {
65054 aRv.Throw(NS_ERROR_UNEXPECTED);
65055 return;
65056 }
65057 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65058 if (!JS::Call(cx, thisValue, callable,
65059 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65060 aRv.NoteJSContextException(cx);
65061 return;
65062 }
65063}
65064
65065void
65066TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65067{
65068 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65069 if (aRv.Failed()) {
65070 return;
65071 }
65072 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65072); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65072); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65073 BindingCallContext& cx = s.GetCallContext();
65074
65075 JS::Rooted<JS::Value> rval(cx);
65076 JS::RootedVector<JS::Value> argv(cx);
65077 if (!argv.resize(1)) {
65078 // That threw an exception on the JSContext, and our CallSetup will do
65079 // the right thing with that.
65080 return;
65081 }
65082 unsigned argc = 1;
65083
65084 do {
65085 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65086 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65087 aRv.Throw(NS_ERROR_UNEXPECTED);
65088 return;
65089 }
65090 break;
65091 } while (false);
65092
65093 JS::Rooted<JS::Value> callable(cx);
65094 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65095 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65096 !InitIds(cx, atomsCache)) ||
65097 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue9_id, &callable)) {
65098 aRv.Throw(NS_ERROR_UNEXPECTED);
65099 return;
65100 }
65101 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65102 if (!JS::Call(cx, thisValue, callable,
65103 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65104 aRv.NoteJSContextException(cx);
65105 return;
65106 }
65107}
65108
65109void
65110TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65111{
65112 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65113 if (aRv.Failed()) {
65114 return;
65115 }
65116 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65116); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65116); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65117 BindingCallContext& cx = s.GetCallContext();
65118
65119 JS::Rooted<JS::Value> rval(cx);
65120 JS::RootedVector<JS::Value> argv(cx);
65121 if (!argv.resize(1)) {
65122 // That threw an exception on the JSContext, and our CallSetup will do
65123 // the right thing with that.
65124 return;
65125 }
65126 unsigned argc = 1;
65127
65128 do {
65129 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65130 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65131 aRv.Throw(NS_ERROR_UNEXPECTED);
65132 return;
65133 }
65134 break;
65135 } while (false);
65136
65137 JS::Rooted<JS::Value> callable(cx);
65138 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65139 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65140 !InitIds(cx, atomsCache)) ||
65141 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue10_id, &callable)) {
65142 aRv.Throw(NS_ERROR_UNEXPECTED);
65143 return;
65144 }
65145 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65146 if (!JS::Call(cx, thisValue, callable,
65147 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65148 aRv.NoteJSContextException(cx);
65149 return;
65150 }
65151}
65152
65153void
65154TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65155{
65156 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65157 if (aRv.Failed()) {
65158 return;
65159 }
65160 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65160); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65161 BindingCallContext& cx = s.GetCallContext();
65162
65163 JS::Rooted<JS::Value> rval(cx);
65164 JS::RootedVector<JS::Value> argv(cx);
65165 if (!argv.resize(1)) {
65166 // That threw an exception on the JSContext, and our CallSetup will do
65167 // the right thing with that.
65168 return;
65169 }
65170 unsigned argc = 1;
65171
65172 do {
65173 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65174 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65175 aRv.Throw(NS_ERROR_UNEXPECTED);
65176 return;
65177 }
65178 break;
65179 } while (false);
65180
65181 JS::Rooted<JS::Value> callable(cx);
65182 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65183 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65184 !InitIds(cx, atomsCache)) ||
65185 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue11_id, &callable)) {
65186 aRv.Throw(NS_ERROR_UNEXPECTED);
65187 return;
65188 }
65189 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65190 if (!JS::Call(cx, thisValue, callable,
65191 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65192 aRv.NoteJSContextException(cx);
65193 return;
65194 }
65195}
65196
65197void
65198TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65199{
65200 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65201 if (aRv.Failed()) {
65202 return;
65203 }
65204 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65204); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65204); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65205 BindingCallContext& cx = s.GetCallContext();
65206
65207 JS::Rooted<JS::Value> rval(cx);
65208 JS::RootedVector<JS::Value> argv(cx);
65209 if (!argv.resize(1)) {
65210 // That threw an exception on the JSContext, and our CallSetup will do
65211 // the right thing with that.
65212 return;
65213 }
65214 unsigned argc = 1;
65215
65216 do {
65217 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65218 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65219 aRv.Throw(NS_ERROR_UNEXPECTED);
65220 return;
65221 }
65222 break;
65223 } while (false);
65224
65225 JS::Rooted<JS::Value> callable(cx);
65226 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65227 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65228 !InitIds(cx, atomsCache)) ||
65229 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue12_id, &callable)) {
65230 aRv.Throw(NS_ERROR_UNEXPECTED);
65231 return;
65232 }
65233 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65234 if (!JS::Call(cx, thisValue, callable,
65235 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65236 aRv.NoteJSContextException(cx);
65237 return;
65238 }
65239}
65240
65241void
65242TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65243{
65244 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65245 if (aRv.Failed()) {
65246 return;
65247 }
65248 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65248); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65249 BindingCallContext& cx = s.GetCallContext();
65250
65251 JS::Rooted<JS::Value> rval(cx);
65252 JS::RootedVector<JS::Value> argv(cx);
65253 if (!argv.resize(1)) {
65254 // That threw an exception on the JSContext, and our CallSetup will do
65255 // the right thing with that.
65256 return;
65257 }
65258 unsigned argc = 1;
65259
65260 do {
65261 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65262 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65263 aRv.Throw(NS_ERROR_UNEXPECTED);
65264 return;
65265 }
65266 break;
65267 } while (false);
65268
65269 JS::Rooted<JS::Value> callable(cx);
65270 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65271 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65272 !InitIds(cx, atomsCache)) ||
65273 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue13_id, &callable)) {
65274 aRv.Throw(NS_ERROR_UNEXPECTED);
65275 return;
65276 }
65277 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65278 if (!JS::Call(cx, thisValue, callable,
65279 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65280 aRv.NoteJSContextException(cx);
65281 return;
65282 }
65283}
65284
65285void
65286TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65287{
65288 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65289 if (aRv.Failed()) {
65290 return;
65291 }
65292 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65292); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65292); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65293 BindingCallContext& cx = s.GetCallContext();
65294
65295 JS::Rooted<JS::Value> rval(cx);
65296 JS::RootedVector<JS::Value> argv(cx);
65297 if (!argv.resize(1)) {
65298 // That threw an exception on the JSContext, and our CallSetup will do
65299 // the right thing with that.
65300 return;
65301 }
65302 unsigned argc = 1;
65303
65304 do {
65305 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65306 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65307 aRv.Throw(NS_ERROR_UNEXPECTED);
65308 return;
65309 }
65310 break;
65311 } while (false);
65312
65313 JS::Rooted<JS::Value> callable(cx);
65314 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65315 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65316 !InitIds(cx, atomsCache)) ||
65317 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue14_id, &callable)) {
65318 aRv.Throw(NS_ERROR_UNEXPECTED);
65319 return;
65320 }
65321 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65322 if (!JS::Call(cx, thisValue, callable,
65323 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65324 aRv.NoteJSContextException(cx);
65325 return;
65326 }
65327}
65328
65329void
65330TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65331{
65332 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65333 if (aRv.Failed()) {
65334 return;
65335 }
65336 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65336); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65336); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65337 BindingCallContext& cx = s.GetCallContext();
65338
65339 JS::Rooted<JS::Value> rval(cx);
65340 JS::RootedVector<JS::Value> argv(cx);
65341 if (!argv.resize(1)) {
65342 // That threw an exception on the JSContext, and our CallSetup will do
65343 // the right thing with that.
65344 return;
65345 }
65346 unsigned argc = 1;
65347
65348 do {
65349 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65350 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65351 aRv.Throw(NS_ERROR_UNEXPECTED);
65352 return;
65353 }
65354 break;
65355 } while (false);
65356
65357 JS::Rooted<JS::Value> callable(cx);
65358 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65359 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65360 !InitIds(cx, atomsCache)) ||
65361 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue15_id, &callable)) {
65362 aRv.Throw(NS_ERROR_UNEXPECTED);
65363 return;
65364 }
65365 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65366 if (!JS::Call(cx, thisValue, callable,
65367 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65368 aRv.NoteJSContextException(cx);
65369 return;
65370 }
65371}
65372
65373void
65374TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65375{
65376 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65377 if (aRv.Failed()) {
65378 return;
65379 }
65380 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65380); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65380); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65381 BindingCallContext& cx = s.GetCallContext();
65382
65383 JS::Rooted<JS::Value> rval(cx);
65384 JS::RootedVector<JS::Value> argv(cx);
65385 if (!argv.resize(1)) {
65386 // That threw an exception on the JSContext, and our CallSetup will do
65387 // the right thing with that.
65388 return;
65389 }
65390 unsigned argc = 1;
65391
65392 do {
65393 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65394 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65395 aRv.Throw(NS_ERROR_UNEXPECTED);
65396 return;
65397 }
65398 break;
65399 } while (false);
65400
65401 JS::Rooted<JS::Value> callable(cx);
65402 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65403 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65404 !InitIds(cx, atomsCache)) ||
65405 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue16_id, &callable)) {
65406 aRv.Throw(NS_ERROR_UNEXPECTED);
65407 return;
65408 }
65409 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65410 if (!JS::Call(cx, thisValue, callable,
65411 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65412 aRv.NoteJSContextException(cx);
65413 return;
65414 }
65415}
65416
65417void
65418TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65419{
65420 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65421 if (aRv.Failed()) {
65422 return;
65423 }
65424 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65424); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65424); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65425 BindingCallContext& cx = s.GetCallContext();
65426
65427 JS::Rooted<JS::Value> rval(cx);
65428 JS::RootedVector<JS::Value> argv(cx);
65429 if (!argv.resize(1)) {
65430 // That threw an exception on the JSContext, and our CallSetup will do
65431 // the right thing with that.
65432 return;
65433 }
65434 unsigned argc = 1;
65435
65436 do {
65437 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65438 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65439 aRv.Throw(NS_ERROR_UNEXPECTED);
65440 return;
65441 }
65442 break;
65443 } while (false);
65444
65445 JS::Rooted<JS::Value> callable(cx);
65446 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65447 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65448 !InitIds(cx, atomsCache)) ||
65449 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue17_id, &callable)) {
65450 aRv.Throw(NS_ERROR_UNEXPECTED);
65451 return;
65452 }
65453 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65454 if (!JS::Call(cx, thisValue, callable,
65455 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65456 aRv.NoteJSContextException(cx);
65457 return;
65458 }
65459}
65460
65461void
65462TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65463{
65464 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65465 if (aRv.Failed()) {
65466 return;
65467 }
65468 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65468); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65468); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65469 BindingCallContext& cx = s.GetCallContext();
65470
65471 JS::Rooted<JS::Value> rval(cx);
65472 JS::RootedVector<JS::Value> argv(cx);
65473 if (!argv.resize(1)) {
65474 // That threw an exception on the JSContext, and our CallSetup will do
65475 // the right thing with that.
65476 return;
65477 }
65478 unsigned argc = 1;
65479
65480 do {
65481 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65482 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65483 aRv.Throw(NS_ERROR_UNEXPECTED);
65484 return;
65485 }
65486 break;
65487 } while (false);
65488
65489 JS::Rooted<JS::Value> callable(cx);
65490 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65491 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65492 !InitIds(cx, atomsCache)) ||
65493 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue18_id, &callable)) {
65494 aRv.Throw(NS_ERROR_UNEXPECTED);
65495 return;
65496 }
65497 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65498 if (!JS::Call(cx, thisValue, callable,
65499 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65500 aRv.NoteJSContextException(cx);
65501 return;
65502 }
65503}
65504
65505void
65506TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65507{
65508 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65509 if (aRv.Failed()) {
65510 return;
65511 }
65512 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65512); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65513 BindingCallContext& cx = s.GetCallContext();
65514
65515 JS::Rooted<JS::Value> rval(cx);
65516 JS::RootedVector<JS::Value> argv(cx);
65517 if (!argv.resize(1)) {
65518 // That threw an exception on the JSContext, and our CallSetup will do
65519 // the right thing with that.
65520 return;
65521 }
65522 unsigned argc = 1;
65523
65524 do {
65525 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65526 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65527 aRv.Throw(NS_ERROR_UNEXPECTED);
65528 return;
65529 }
65530 break;
65531 } while (false);
65532
65533 JS::Rooted<JS::Value> callable(cx);
65534 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65535 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65536 !InitIds(cx, atomsCache)) ||
65537 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue19_id, &callable)) {
65538 aRv.Throw(NS_ERROR_UNEXPECTED);
65539 return;
65540 }
65541 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65542 if (!JS::Call(cx, thisValue, callable,
65543 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65544 aRv.NoteJSContextException(cx);
65545 return;
65546 }
65547}
65548
65549void
65550TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65551{
65552 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65553 if (aRv.Failed()) {
65554 return;
65555 }
65556 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65556); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65556); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65557 BindingCallContext& cx = s.GetCallContext();
65558
65559 JS::Rooted<JS::Value> rval(cx);
65560 JS::RootedVector<JS::Value> argv(cx);
65561 if (!argv.resize(1)) {
65562 // That threw an exception on the JSContext, and our CallSetup will do
65563 // the right thing with that.
65564 return;
65565 }
65566 unsigned argc = 1;
65567
65568 do {
65569 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65570 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65571 aRv.Throw(NS_ERROR_UNEXPECTED);
65572 return;
65573 }
65574 break;
65575 } while (false);
65576
65577 JS::Rooted<JS::Value> callable(cx);
65578 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65579 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65580 !InitIds(cx, atomsCache)) ||
65581 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue20_id, &callable)) {
65582 aRv.Throw(NS_ERROR_UNEXPECTED);
65583 return;
65584 }
65585 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65586 if (!JS::Call(cx, thisValue, callable,
65587 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65588 aRv.NoteJSContextException(cx);
65589 return;
65590 }
65591}
65592
65593void
65594TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65595{
65596 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65597 if (aRv.Failed()) {
65598 return;
65599 }
65600 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65600); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65600); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65601 BindingCallContext& cx = s.GetCallContext();
65602
65603 JS::Rooted<JS::Value> rval(cx);
65604 JS::RootedVector<JS::Value> argv(cx);
65605 if (!argv.resize(1)) {
65606 // That threw an exception on the JSContext, and our CallSetup will do
65607 // the right thing with that.
65608 return;
65609 }
65610 unsigned argc = 1;
65611
65612 do {
65613 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65614 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65615 aRv.Throw(NS_ERROR_UNEXPECTED);
65616 return;
65617 }
65618 break;
65619 } while (false);
65620
65621 JS::Rooted<JS::Value> callable(cx);
65622 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65623 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65624 !InitIds(cx, atomsCache)) ||
65625 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue21_id, &callable)) {
65626 aRv.Throw(NS_ERROR_UNEXPECTED);
65627 return;
65628 }
65629 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65630 if (!JS::Call(cx, thisValue, callable,
65631 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65632 aRv.NoteJSContextException(cx);
65633 return;
65634 }
65635}
65636
65637void
65638TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65639{
65640 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65641 if (aRv.Failed()) {
65642 return;
65643 }
65644 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65644); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65644); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65645 BindingCallContext& cx = s.GetCallContext();
65646
65647 JS::Rooted<JS::Value> rval(cx);
65648 JS::RootedVector<JS::Value> argv(cx);
65649 if (!argv.resize(1)) {
65650 // That threw an exception on the JSContext, and our CallSetup will do
65651 // the right thing with that.
65652 return;
65653 }
65654 unsigned argc = 1;
65655
65656 do {
65657 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65658 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65659 aRv.Throw(NS_ERROR_UNEXPECTED);
65660 return;
65661 }
65662 break;
65663 } while (false);
65664
65665 JS::Rooted<JS::Value> callable(cx);
65666 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65667 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65668 !InitIds(cx, atomsCache)) ||
65669 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue22_id, &callable)) {
65670 aRv.Throw(NS_ERROR_UNEXPECTED);
65671 return;
65672 }
65673 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65674 if (!JS::Call(cx, thisValue, callable,
65675 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65676 aRv.NoteJSContextException(cx);
65677 return;
65678 }
65679}
65680
65681void
65682TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65683{
65684 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65685 if (aRv.Failed()) {
65686 return;
65687 }
65688 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65688); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65689 BindingCallContext& cx = s.GetCallContext();
65690
65691 JS::Rooted<JS::Value> rval(cx);
65692 JS::RootedVector<JS::Value> argv(cx);
65693 if (!argv.resize(1)) {
65694 // That threw an exception on the JSContext, and our CallSetup will do
65695 // the right thing with that.
65696 return;
65697 }
65698 unsigned argc = 1;
65699
65700 do {
65701 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65702 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65703 aRv.Throw(NS_ERROR_UNEXPECTED);
65704 return;
65705 }
65706 break;
65707 } while (false);
65708
65709 JS::Rooted<JS::Value> callable(cx);
65710 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65711 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65712 !InitIds(cx, atomsCache)) ||
65713 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue23_id, &callable)) {
65714 aRv.Throw(NS_ERROR_UNEXPECTED);
65715 return;
65716 }
65717 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65718 if (!JS::Call(cx, thisValue, callable,
65719 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65720 aRv.NoteJSContextException(cx);
65721 return;
65722 }
65723}
65724
65725void
65726TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65727{
65728 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65729 if (aRv.Failed()) {
65730 return;
65731 }
65732 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65732); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65732); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65733 BindingCallContext& cx = s.GetCallContext();
65734
65735 JS::Rooted<JS::Value> rval(cx);
65736 JS::RootedVector<JS::Value> argv(cx);
65737 if (!argv.resize(1)) {
65738 // That threw an exception on the JSContext, and our CallSetup will do
65739 // the right thing with that.
65740 return;
65741 }
65742 unsigned argc = 1;
65743
65744 do {
65745 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65746 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65747 aRv.Throw(NS_ERROR_UNEXPECTED);
65748 return;
65749 }
65750 break;
65751 } while (false);
65752
65753 JS::Rooted<JS::Value> callable(cx);
65754 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65755 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65756 !InitIds(cx, atomsCache)) ||
65757 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue24_id, &callable)) {
65758 aRv.Throw(NS_ERROR_UNEXPECTED);
65759 return;
65760 }
65761 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65762 if (!JS::Call(cx, thisValue, callable,
65763 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65764 aRv.NoteJSContextException(cx);
65765 return;
65766 }
65767}
65768
65769void
65770TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65771{
65772 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65773 if (aRv.Failed()) {
65774 return;
65775 }
65776 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65776); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65776); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65777 BindingCallContext& cx = s.GetCallContext();
65778
65779 JS::Rooted<JS::Value> rval(cx);
65780 JS::RootedVector<JS::Value> argv(cx);
65781 if (!argv.resize(1)) {
65782 // That threw an exception on the JSContext, and our CallSetup will do
65783 // the right thing with that.
65784 return;
65785 }
65786 unsigned argc = 1;
65787
65788 do {
65789 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65790 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65791 aRv.Throw(NS_ERROR_UNEXPECTED);
65792 return;
65793 }
65794 break;
65795 } while (false);
65796
65797 JS::Rooted<JS::Value> callable(cx);
65798 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65799 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65800 !InitIds(cx, atomsCache)) ||
65801 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue25_id, &callable)) {
65802 aRv.Throw(NS_ERROR_UNEXPECTED);
65803 return;
65804 }
65805 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65806 if (!JS::Call(cx, thisValue, callable,
65807 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65808 aRv.NoteJSContextException(cx);
65809 return;
65810 }
65811}
65812
65813void
65814TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65815{
65816 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65817 if (aRv.Failed()) {
65818 return;
65819 }
65820 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65820); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65820); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65821 BindingCallContext& cx = s.GetCallContext();
65822
65823 JS::Rooted<JS::Value> rval(cx);
65824 JS::RootedVector<JS::Value> argv(cx);
65825 if (!argv.resize(1)) {
65826 // That threw an exception on the JSContext, and our CallSetup will do
65827 // the right thing with that.
65828 return;
65829 }
65830 unsigned argc = 1;
65831
65832 do {
65833 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65834 if (arg.IsNull()) {
65835 argv[0].setNull();
65836 break;
65837 }
65838 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65839 aRv.Throw(NS_ERROR_UNEXPECTED);
65840 return;
65841 }
65842 break;
65843 } while (false);
65844
65845 JS::Rooted<JS::Value> callable(cx);
65846 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65847 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65848 !InitIds(cx, atomsCache)) ||
65849 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue1_id, &callable)) {
65850 aRv.Throw(NS_ERROR_UNEXPECTED);
65851 return;
65852 }
65853 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65854 if (!JS::Call(cx, thisValue, callable,
65855 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65856 aRv.NoteJSContextException(cx);
65857 return;
65858 }
65859}
65860
65861void
65862TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65863{
65864 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65865 if (aRv.Failed()) {
65866 return;
65867 }
65868 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65868); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65868); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65869 BindingCallContext& cx = s.GetCallContext();
65870
65871 JS::Rooted<JS::Value> rval(cx);
65872 JS::RootedVector<JS::Value> argv(cx);
65873 if (!argv.resize(1)) {
65874 // That threw an exception on the JSContext, and our CallSetup will do
65875 // the right thing with that.
65876 return;
65877 }
65878 unsigned argc = 1;
65879
65880 do {
65881 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65882 if (arg.IsNull()) {
65883 argv[0].setNull();
65884 break;
65885 }
65886 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65887 aRv.Throw(NS_ERROR_UNEXPECTED);
65888 return;
65889 }
65890 break;
65891 } while (false);
65892
65893 JS::Rooted<JS::Value> callable(cx);
65894 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65895 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65896 !InitIds(cx, atomsCache)) ||
65897 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue2_id, &callable)) {
65898 aRv.Throw(NS_ERROR_UNEXPECTED);
65899 return;
65900 }
65901 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65902 if (!JS::Call(cx, thisValue, callable,
65903 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65904 aRv.NoteJSContextException(cx);
65905 return;
65906 }
65907}
65908
65909void
65910TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65911{
65912 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65913 if (aRv.Failed()) {
65914 return;
65915 }
65916 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65916); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65916); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65917 BindingCallContext& cx = s.GetCallContext();
65918
65919 JS::Rooted<JS::Value> rval(cx);
65920 JS::RootedVector<JS::Value> argv(cx);
65921 if (!argv.resize(1)) {
65922 // That threw an exception on the JSContext, and our CallSetup will do
65923 // the right thing with that.
65924 return;
65925 }
65926 unsigned argc = 1;
65927
65928 do {
65929 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65930 if (arg.IsNull()) {
65931 argv[0].setNull();
65932 break;
65933 }
65934 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65935 aRv.Throw(NS_ERROR_UNEXPECTED);
65936 return;
65937 }
65938 break;
65939 } while (false);
65940
65941 JS::Rooted<JS::Value> callable(cx);
65942 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65943 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65944 !InitIds(cx, atomsCache)) ||
65945 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue3_id, &callable)) {
65946 aRv.Throw(NS_ERROR_UNEXPECTED);
65947 return;
65948 }
65949 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65950 if (!JS::Call(cx, thisValue, callable,
65951 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65952 aRv.NoteJSContextException(cx);
65953 return;
65954 }
65955}
65956
65957void
65958TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65959{
65960 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65961 if (aRv.Failed()) {
65962 return;
65963 }
65964 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65964); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 65964); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
65965 BindingCallContext& cx = s.GetCallContext();
65966
65967 JS::Rooted<JS::Value> rval(cx);
65968 JS::RootedVector<JS::Value> argv(cx);
65969 if (!argv.resize(1)) {
65970 // That threw an exception on the JSContext, and our CallSetup will do
65971 // the right thing with that.
65972 return;
65973 }
65974 unsigned argc = 1;
65975
65976 do {
65977 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65978 if (arg.IsNull()) {
65979 argv[0].setNull();
65980 break;
65981 }
65982 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65983 aRv.Throw(NS_ERROR_UNEXPECTED);
65984 return;
65985 }
65986 break;
65987 } while (false);
65988
65989 JS::Rooted<JS::Value> callable(cx);
65990 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65991 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65992 !InitIds(cx, atomsCache)) ||
65993 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue4_id, &callable)) {
65994 aRv.Throw(NS_ERROR_UNEXPECTED);
65995 return;
65996 }
65997 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65998 if (!JS::Call(cx, thisValue, callable,
65999 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66000 aRv.NoteJSContextException(cx);
66001 return;
66002 }
66003}
66004
66005void
66006TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66007{
66008 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66009 if (aRv.Failed()) {
66010 return;
66011 }
66012 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66012); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66012); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66013 BindingCallContext& cx = s.GetCallContext();
66014
66015 JS::Rooted<JS::Value> rval(cx);
66016 JS::RootedVector<JS::Value> argv(cx);
66017 if (!argv.resize(1)) {
66018 // That threw an exception on the JSContext, and our CallSetup will do
66019 // the right thing with that.
66020 return;
66021 }
66022 unsigned argc = 1;
66023
66024 do {
66025 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66026 if (arg.IsNull()) {
66027 argv[0].setNull();
66028 break;
66029 }
66030 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66031 aRv.Throw(NS_ERROR_UNEXPECTED);
66032 return;
66033 }
66034 break;
66035 } while (false);
66036
66037 JS::Rooted<JS::Value> callable(cx);
66038 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66039 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66040 !InitIds(cx, atomsCache)) ||
66041 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue5_id, &callable)) {
66042 aRv.Throw(NS_ERROR_UNEXPECTED);
66043 return;
66044 }
66045 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66046 if (!JS::Call(cx, thisValue, callable,
66047 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66048 aRv.NoteJSContextException(cx);
66049 return;
66050 }
66051}
66052
66053void
66054TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66055{
66056 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66057 if (aRv.Failed()) {
66058 return;
66059 }
66060 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66060); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66060); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66061 BindingCallContext& cx = s.GetCallContext();
66062
66063 JS::Rooted<JS::Value> rval(cx);
66064 JS::RootedVector<JS::Value> argv(cx);
66065 if (!argv.resize(1)) {
66066 // That threw an exception on the JSContext, and our CallSetup will do
66067 // the right thing with that.
66068 return;
66069 }
66070 unsigned argc = 1;
66071
66072 do {
66073 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66074 if (arg.IsNull()) {
66075 argv[0].setNull();
66076 break;
66077 }
66078 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66079 aRv.Throw(NS_ERROR_UNEXPECTED);
66080 return;
66081 }
66082 break;
66083 } while (false);
66084
66085 JS::Rooted<JS::Value> callable(cx);
66086 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66087 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66088 !InitIds(cx, atomsCache)) ||
66089 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue6_id, &callable)) {
66090 aRv.Throw(NS_ERROR_UNEXPECTED);
66091 return;
66092 }
66093 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66094 if (!JS::Call(cx, thisValue, callable,
66095 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66096 aRv.NoteJSContextException(cx);
66097 return;
66098 }
66099}
66100
66101void
66102TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66103{
66104 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66105 if (aRv.Failed()) {
66106 return;
66107 }
66108 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66108); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66108); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66109 BindingCallContext& cx = s.GetCallContext();
66110
66111 JS::Rooted<JS::Value> rval(cx);
66112 JS::RootedVector<JS::Value> argv(cx);
66113 if (!argv.resize(1)) {
66114 // That threw an exception on the JSContext, and our CallSetup will do
66115 // the right thing with that.
66116 return;
66117 }
66118 unsigned argc = 1;
66119
66120 do {
66121 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66122 if (arg.IsNull()) {
66123 argv[0].setNull();
66124 break;
66125 }
66126 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66127 aRv.Throw(NS_ERROR_UNEXPECTED);
66128 return;
66129 }
66130 break;
66131 } while (false);
66132
66133 JS::Rooted<JS::Value> callable(cx);
66134 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66135 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66136 !InitIds(cx, atomsCache)) ||
66137 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue7_id, &callable)) {
66138 aRv.Throw(NS_ERROR_UNEXPECTED);
66139 return;
66140 }
66141 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66142 if (!JS::Call(cx, thisValue, callable,
66143 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66144 aRv.NoteJSContextException(cx);
66145 return;
66146 }
66147}
66148
66149void
66150TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66151{
66152 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66153 if (aRv.Failed()) {
66154 return;
66155 }
66156 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66156); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66157 BindingCallContext& cx = s.GetCallContext();
66158
66159 JS::Rooted<JS::Value> rval(cx);
66160 JS::RootedVector<JS::Value> argv(cx);
66161 if (!argv.resize(1)) {
66162 // That threw an exception on the JSContext, and our CallSetup will do
66163 // the right thing with that.
66164 return;
66165 }
66166 unsigned argc = 1;
66167
66168 do {
66169 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66170 if (arg.IsNull()) {
66171 argv[0].setNull();
66172 break;
66173 }
66174 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66175 aRv.Throw(NS_ERROR_UNEXPECTED);
66176 return;
66177 }
66178 break;
66179 } while (false);
66180
66181 JS::Rooted<JS::Value> callable(cx);
66182 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66183 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66184 !InitIds(cx, atomsCache)) ||
66185 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue8_id, &callable)) {
66186 aRv.Throw(NS_ERROR_UNEXPECTED);
66187 return;
66188 }
66189 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66190 if (!JS::Call(cx, thisValue, callable,
66191 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66192 aRv.NoteJSContextException(cx);
66193 return;
66194 }
66195}
66196
66197void
66198TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66199{
66200 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66201 if (aRv.Failed()) {
66202 return;
66203 }
66204 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66204); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66204); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66205 BindingCallContext& cx = s.GetCallContext();
66206
66207 JS::Rooted<JS::Value> rval(cx);
66208 JS::RootedVector<JS::Value> argv(cx);
66209 if (!argv.resize(1)) {
66210 // That threw an exception on the JSContext, and our CallSetup will do
66211 // the right thing with that.
66212 return;
66213 }
66214 unsigned argc = 1;
66215
66216 do {
66217 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66218 if (arg.IsNull()) {
66219 argv[0].setNull();
66220 break;
66221 }
66222 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66223 aRv.Throw(NS_ERROR_UNEXPECTED);
66224 return;
66225 }
66226 break;
66227 } while (false);
66228
66229 JS::Rooted<JS::Value> callable(cx);
66230 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66231 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66232 !InitIds(cx, atomsCache)) ||
66233 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue9_id, &callable)) {
66234 aRv.Throw(NS_ERROR_UNEXPECTED);
66235 return;
66236 }
66237 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66238 if (!JS::Call(cx, thisValue, callable,
66239 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66240 aRv.NoteJSContextException(cx);
66241 return;
66242 }
66243}
66244
66245void
66246TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66247{
66248 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66249 if (aRv.Failed()) {
66250 return;
66251 }
66252 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66252); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66252); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66253 BindingCallContext& cx = s.GetCallContext();
66254
66255 JS::Rooted<JS::Value> rval(cx);
66256 JS::RootedVector<JS::Value> argv(cx);
66257 if (!argv.resize(1)) {
66258 // That threw an exception on the JSContext, and our CallSetup will do
66259 // the right thing with that.
66260 return;
66261 }
66262 unsigned argc = 1;
66263
66264 do {
66265 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66266 if (arg.IsNull()) {
66267 argv[0].setNull();
66268 break;
66269 }
66270 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66271 aRv.Throw(NS_ERROR_UNEXPECTED);
66272 return;
66273 }
66274 break;
66275 } while (false);
66276
66277 JS::Rooted<JS::Value> callable(cx);
66278 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66279 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66280 !InitIds(cx, atomsCache)) ||
66281 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue10_id, &callable)) {
66282 aRv.Throw(NS_ERROR_UNEXPECTED);
66283 return;
66284 }
66285 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66286 if (!JS::Call(cx, thisValue, callable,
66287 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66288 aRv.NoteJSContextException(cx);
66289 return;
66290 }
66291}
66292
66293void
66294TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66295{
66296 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66297 if (aRv.Failed()) {
66298 return;
66299 }
66300 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66300); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66300); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66301 BindingCallContext& cx = s.GetCallContext();
66302
66303 JS::Rooted<JS::Value> rval(cx);
66304 JS::RootedVector<JS::Value> argv(cx);
66305 if (!argv.resize(1)) {
66306 // That threw an exception on the JSContext, and our CallSetup will do
66307 // the right thing with that.
66308 return;
66309 }
66310 unsigned argc = 1;
66311
66312 do {
66313 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66314 if (arg.IsNull()) {
66315 argv[0].setNull();
66316 break;
66317 }
66318 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66319 aRv.Throw(NS_ERROR_UNEXPECTED);
66320 return;
66321 }
66322 break;
66323 } while (false);
66324
66325 JS::Rooted<JS::Value> callable(cx);
66326 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66327 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66328 !InitIds(cx, atomsCache)) ||
66329 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue11_id, &callable)) {
66330 aRv.Throw(NS_ERROR_UNEXPECTED);
66331 return;
66332 }
66333 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66334 if (!JS::Call(cx, thisValue, callable,
66335 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66336 aRv.NoteJSContextException(cx);
66337 return;
66338 }
66339}
66340
66341void
66342TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66343{
66344 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66345 if (aRv.Failed()) {
66346 return;
66347 }
66348 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66348); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66348); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66349 BindingCallContext& cx = s.GetCallContext();
66350
66351 JS::Rooted<JS::Value> rval(cx);
66352 JS::RootedVector<JS::Value> argv(cx);
66353 if (!argv.resize(1)) {
66354 // That threw an exception on the JSContext, and our CallSetup will do
66355 // the right thing with that.
66356 return;
66357 }
66358 unsigned argc = 1;
66359
66360 do {
66361 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66362 if (arg.IsNull()) {
66363 argv[0].setNull();
66364 break;
66365 }
66366 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66367 aRv.Throw(NS_ERROR_UNEXPECTED);
66368 return;
66369 }
66370 break;
66371 } while (false);
66372
66373 JS::Rooted<JS::Value> callable(cx);
66374 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66375 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66376 !InitIds(cx, atomsCache)) ||
66377 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue12_id, &callable)) {
66378 aRv.Throw(NS_ERROR_UNEXPECTED);
66379 return;
66380 }
66381 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66382 if (!JS::Call(cx, thisValue, callable,
66383 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66384 aRv.NoteJSContextException(cx);
66385 return;
66386 }
66387}
66388
66389void
66390TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66391{
66392 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66393 if (aRv.Failed()) {
66394 return;
66395 }
66396 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66396); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66396); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66397 BindingCallContext& cx = s.GetCallContext();
66398
66399 JS::Rooted<JS::Value> rval(cx);
66400 JS::RootedVector<JS::Value> argv(cx);
66401 if (!argv.resize(1)) {
66402 // That threw an exception on the JSContext, and our CallSetup will do
66403 // the right thing with that.
66404 return;
66405 }
66406 unsigned argc = 1;
66407
66408 do {
66409 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66410 if (arg.IsNull()) {
66411 argv[0].setNull();
66412 break;
66413 }
66414 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66415 aRv.Throw(NS_ERROR_UNEXPECTED);
66416 return;
66417 }
66418 break;
66419 } while (false);
66420
66421 JS::Rooted<JS::Value> callable(cx);
66422 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66423 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66424 !InitIds(cx, atomsCache)) ||
66425 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue13_id, &callable)) {
66426 aRv.Throw(NS_ERROR_UNEXPECTED);
66427 return;
66428 }
66429 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66430 if (!JS::Call(cx, thisValue, callable,
66431 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66432 aRv.NoteJSContextException(cx);
66433 return;
66434 }
66435}
66436
66437void
66438TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66439{
66440 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66441 if (aRv.Failed()) {
66442 return;
66443 }
66444 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66444); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66444); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66445 BindingCallContext& cx = s.GetCallContext();
66446
66447 JS::Rooted<JS::Value> rval(cx);
66448 JS::RootedVector<JS::Value> argv(cx);
66449 if (!argv.resize(1)) {
66450 // That threw an exception on the JSContext, and our CallSetup will do
66451 // the right thing with that.
66452 return;
66453 }
66454 unsigned argc = 1;
66455
66456 do {
66457 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66458 if (arg.IsNull()) {
66459 argv[0].setNull();
66460 break;
66461 }
66462 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66463 aRv.Throw(NS_ERROR_UNEXPECTED);
66464 return;
66465 }
66466 break;
66467 } while (false);
66468
66469 JS::Rooted<JS::Value> callable(cx);
66470 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66471 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66472 !InitIds(cx, atomsCache)) ||
66473 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue14_id, &callable)) {
66474 aRv.Throw(NS_ERROR_UNEXPECTED);
66475 return;
66476 }
66477 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66478 if (!JS::Call(cx, thisValue, callable,
66479 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66480 aRv.NoteJSContextException(cx);
66481 return;
66482 }
66483}
66484
66485void
66486TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66487{
66488 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66489 if (aRv.Failed()) {
66490 return;
66491 }
66492 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66492); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66492); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66493 BindingCallContext& cx = s.GetCallContext();
66494
66495 JS::Rooted<JS::Value> rval(cx);
66496 JS::RootedVector<JS::Value> argv(cx);
66497 if (!argv.resize(1)) {
66498 // That threw an exception on the JSContext, and our CallSetup will do
66499 // the right thing with that.
66500 return;
66501 }
66502 unsigned argc = 1;
66503
66504 do {
66505 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66506 if (arg.IsNull()) {
66507 argv[0].setNull();
66508 break;
66509 }
66510 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66511 aRv.Throw(NS_ERROR_UNEXPECTED);
66512 return;
66513 }
66514 break;
66515 } while (false);
66516
66517 JS::Rooted<JS::Value> callable(cx);
66518 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66519 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66520 !InitIds(cx, atomsCache)) ||
66521 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue15_id, &callable)) {
66522 aRv.Throw(NS_ERROR_UNEXPECTED);
66523 return;
66524 }
66525 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66526 if (!JS::Call(cx, thisValue, callable,
66527 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66528 aRv.NoteJSContextException(cx);
66529 return;
66530 }
66531}
66532
66533void
66534TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66535{
66536 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66537 if (aRv.Failed()) {
66538 return;
66539 }
66540 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66540); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66540); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66541 BindingCallContext& cx = s.GetCallContext();
66542
66543 JS::Rooted<JS::Value> rval(cx);
66544 JS::RootedVector<JS::Value> argv(cx);
66545 if (!argv.resize(1)) {
66546 // That threw an exception on the JSContext, and our CallSetup will do
66547 // the right thing with that.
66548 return;
66549 }
66550 unsigned argc = 1;
66551
66552 do {
66553 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66554 if (arg.IsNull()) {
66555 argv[0].setNull();
66556 break;
66557 }
66558 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66559 aRv.Throw(NS_ERROR_UNEXPECTED);
66560 return;
66561 }
66562 break;
66563 } while (false);
66564
66565 JS::Rooted<JS::Value> callable(cx);
66566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66568 !InitIds(cx, atomsCache)) ||
66569 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue16_id, &callable)) {
66570 aRv.Throw(NS_ERROR_UNEXPECTED);
66571 return;
66572 }
66573 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66574 if (!JS::Call(cx, thisValue, callable,
66575 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66576 aRv.NoteJSContextException(cx);
66577 return;
66578 }
66579}
66580
66581void
66582TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66583{
66584 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66585 if (aRv.Failed()) {
66586 return;
66587 }
66588 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66588); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66589 BindingCallContext& cx = s.GetCallContext();
66590
66591 JS::Rooted<JS::Value> rval(cx);
66592 JS::RootedVector<JS::Value> argv(cx);
66593 if (!argv.resize(1)) {
66594 // That threw an exception on the JSContext, and our CallSetup will do
66595 // the right thing with that.
66596 return;
66597 }
66598 unsigned argc = 1;
66599
66600 do {
66601 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66602 if (arg.IsNull()) {
66603 argv[0].setNull();
66604 break;
66605 }
66606 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66607 aRv.Throw(NS_ERROR_UNEXPECTED);
66608 return;
66609 }
66610 break;
66611 } while (false);
66612
66613 JS::Rooted<JS::Value> callable(cx);
66614 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66615 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66616 !InitIds(cx, atomsCache)) ||
66617 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue17_id, &callable)) {
66618 aRv.Throw(NS_ERROR_UNEXPECTED);
66619 return;
66620 }
66621 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66622 if (!JS::Call(cx, thisValue, callable,
66623 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66624 aRv.NoteJSContextException(cx);
66625 return;
66626 }
66627}
66628
66629void
66630TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66631{
66632 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66633 if (aRv.Failed()) {
66634 return;
66635 }
66636 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66636); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66636); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66637 BindingCallContext& cx = s.GetCallContext();
66638
66639 JS::Rooted<JS::Value> rval(cx);
66640 JS::RootedVector<JS::Value> argv(cx);
66641 if (!argv.resize(1)) {
66642 // That threw an exception on the JSContext, and our CallSetup will do
66643 // the right thing with that.
66644 return;
66645 }
66646 unsigned argc = 1;
66647
66648 do {
66649 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66650 if (arg.IsNull()) {
66651 argv[0].setNull();
66652 break;
66653 }
66654 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66655 aRv.Throw(NS_ERROR_UNEXPECTED);
66656 return;
66657 }
66658 break;
66659 } while (false);
66660
66661 JS::Rooted<JS::Value> callable(cx);
66662 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66663 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66664 !InitIds(cx, atomsCache)) ||
66665 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue18_id, &callable)) {
66666 aRv.Throw(NS_ERROR_UNEXPECTED);
66667 return;
66668 }
66669 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66670 if (!JS::Call(cx, thisValue, callable,
66671 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66672 aRv.NoteJSContextException(cx);
66673 return;
66674 }
66675}
66676
66677void
66678TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66679{
66680 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66681 if (aRv.Failed()) {
66682 return;
66683 }
66684 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66684); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66684); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66685 BindingCallContext& cx = s.GetCallContext();
66686
66687 JS::Rooted<JS::Value> rval(cx);
66688 JS::RootedVector<JS::Value> argv(cx);
66689 if (!argv.resize(1)) {
66690 // That threw an exception on the JSContext, and our CallSetup will do
66691 // the right thing with that.
66692 return;
66693 }
66694 unsigned argc = 1;
66695
66696 do {
66697 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66698 if (arg.IsNull()) {
66699 argv[0].setNull();
66700 break;
66701 }
66702 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66703 aRv.Throw(NS_ERROR_UNEXPECTED);
66704 return;
66705 }
66706 break;
66707 } while (false);
66708
66709 JS::Rooted<JS::Value> callable(cx);
66710 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66711 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66712 !InitIds(cx, atomsCache)) ||
66713 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue19_id, &callable)) {
66714 aRv.Throw(NS_ERROR_UNEXPECTED);
66715 return;
66716 }
66717 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66718 if (!JS::Call(cx, thisValue, callable,
66719 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66720 aRv.NoteJSContextException(cx);
66721 return;
66722 }
66723}
66724
66725void
66726TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66727{
66728 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66729 if (aRv.Failed()) {
66730 return;
66731 }
66732 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66732); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66732); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66733 BindingCallContext& cx = s.GetCallContext();
66734
66735 JS::Rooted<JS::Value> rval(cx);
66736 JS::RootedVector<JS::Value> argv(cx);
66737 if (!argv.resize(1)) {
66738 // That threw an exception on the JSContext, and our CallSetup will do
66739 // the right thing with that.
66740 return;
66741 }
66742 unsigned argc = 1;
66743
66744 do {
66745 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66746 if (arg.IsNull()) {
66747 argv[0].setNull();
66748 break;
66749 }
66750 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66751 aRv.Throw(NS_ERROR_UNEXPECTED);
66752 return;
66753 }
66754 break;
66755 } while (false);
66756
66757 JS::Rooted<JS::Value> callable(cx);
66758 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66759 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66760 !InitIds(cx, atomsCache)) ||
66761 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue20_id, &callable)) {
66762 aRv.Throw(NS_ERROR_UNEXPECTED);
66763 return;
66764 }
66765 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66766 if (!JS::Call(cx, thisValue, callable,
66767 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66768 aRv.NoteJSContextException(cx);
66769 return;
66770 }
66771}
66772
66773void
66774TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66775{
66776 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66777 if (aRv.Failed()) {
66778 return;
66779 }
66780 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66780); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66780); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66781 BindingCallContext& cx = s.GetCallContext();
66782
66783 JS::Rooted<JS::Value> rval(cx);
66784 JS::RootedVector<JS::Value> argv(cx);
66785 if (!argv.resize(1)) {
66786 // That threw an exception on the JSContext, and our CallSetup will do
66787 // the right thing with that.
66788 return;
66789 }
66790 unsigned argc = 1;
66791
66792 do {
66793 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66794 if (arg.IsNull()) {
66795 argv[0].setNull();
66796 break;
66797 }
66798 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66799 aRv.Throw(NS_ERROR_UNEXPECTED);
66800 return;
66801 }
66802 break;
66803 } while (false);
66804
66805 JS::Rooted<JS::Value> callable(cx);
66806 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66807 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66808 !InitIds(cx, atomsCache)) ||
66809 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue21_id, &callable)) {
66810 aRv.Throw(NS_ERROR_UNEXPECTED);
66811 return;
66812 }
66813 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66814 if (!JS::Call(cx, thisValue, callable,
66815 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66816 aRv.NoteJSContextException(cx);
66817 return;
66818 }
66819}
66820
66821void
66822TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66823{
66824 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66825 if (aRv.Failed()) {
66826 return;
66827 }
66828 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66828); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66828); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66829 BindingCallContext& cx = s.GetCallContext();
66830
66831 JS::Rooted<JS::Value> rval(cx);
66832 JS::RootedVector<JS::Value> argv(cx);
66833 if (!argv.resize(1)) {
66834 // That threw an exception on the JSContext, and our CallSetup will do
66835 // the right thing with that.
66836 return;
66837 }
66838 unsigned argc = 1;
66839
66840 do {
66841 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66842 if (arg.IsNull()) {
66843 argv[0].setNull();
66844 break;
66845 }
66846 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66847 aRv.Throw(NS_ERROR_UNEXPECTED);
66848 return;
66849 }
66850 break;
66851 } while (false);
66852
66853 JS::Rooted<JS::Value> callable(cx);
66854 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66855 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66856 !InitIds(cx, atomsCache)) ||
66857 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue22_id, &callable)) {
66858 aRv.Throw(NS_ERROR_UNEXPECTED);
66859 return;
66860 }
66861 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66862 if (!JS::Call(cx, thisValue, callable,
66863 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66864 aRv.NoteJSContextException(cx);
66865 return;
66866 }
66867}
66868
66869void
66870TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66871{
66872 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66873 if (aRv.Failed()) {
66874 return;
66875 }
66876 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66876); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66876); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66877 BindingCallContext& cx = s.GetCallContext();
66878
66879 JS::Rooted<JS::Value> rval(cx);
66880 JS::RootedVector<JS::Value> argv(cx);
66881 if (!argv.resize(1)) {
66882 // That threw an exception on the JSContext, and our CallSetup will do
66883 // the right thing with that.
66884 return;
66885 }
66886 unsigned argc = 1;
66887
66888 do {
66889 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66890 if (arg.IsNull()) {
66891 argv[0].setNull();
66892 break;
66893 }
66894 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66895 aRv.Throw(NS_ERROR_UNEXPECTED);
66896 return;
66897 }
66898 break;
66899 } while (false);
66900
66901 JS::Rooted<JS::Value> callable(cx);
66902 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66903 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66904 !InitIds(cx, atomsCache)) ||
66905 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue23_id, &callable)) {
66906 aRv.Throw(NS_ERROR_UNEXPECTED);
66907 return;
66908 }
66909 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66910 if (!JS::Call(cx, thisValue, callable,
66911 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66912 aRv.NoteJSContextException(cx);
66913 return;
66914 }
66915}
66916
66917void
66918TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66919{
66920 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66921 if (aRv.Failed()) {
66922 return;
66923 }
66924 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66924); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66924); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66925 BindingCallContext& cx = s.GetCallContext();
66926
66927 JS::Rooted<JS::Value> rval(cx);
66928 JS::RootedVector<JS::Value> argv(cx);
66929 if (!argv.resize(1)) {
66930 // That threw an exception on the JSContext, and our CallSetup will do
66931 // the right thing with that.
66932 return;
66933 }
66934 unsigned argc = 1;
66935
66936 do {
66937 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66938 if (arg.IsNull()) {
66939 argv[0].setNull();
66940 break;
66941 }
66942 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66943 aRv.Throw(NS_ERROR_UNEXPECTED);
66944 return;
66945 }
66946 break;
66947 } while (false);
66948
66949 JS::Rooted<JS::Value> callable(cx);
66950 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66951 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66952 !InitIds(cx, atomsCache)) ||
66953 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue24_id, &callable)) {
66954 aRv.Throw(NS_ERROR_UNEXPECTED);
66955 return;
66956 }
66957 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66958 if (!JS::Call(cx, thisValue, callable,
66959 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66960 aRv.NoteJSContextException(cx);
66961 return;
66962 }
66963}
66964
66965void
66966TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66967{
66968 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66969 if (aRv.Failed()) {
66970 return;
66971 }
66972 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 66972); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
66973 BindingCallContext& cx = s.GetCallContext();
66974
66975 JS::Rooted<JS::Value> rval(cx);
66976 JS::RootedVector<JS::Value> argv(cx);
66977 if (!argv.resize(1)) {
66978 // That threw an exception on the JSContext, and our CallSetup will do
66979 // the right thing with that.
66980 return;
66981 }
66982 unsigned argc = 1;
66983
66984 do {
66985 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66986 if (arg.IsNull()) {
66987 argv[0].setNull();
66988 break;
66989 }
66990 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66991 aRv.Throw(NS_ERROR_UNEXPECTED);
66992 return;
66993 }
66994 break;
66995 } while (false);
66996
66997 JS::Rooted<JS::Value> callable(cx);
66998 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66999 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67000 !InitIds(cx, atomsCache)) ||
67001 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue25_id, &callable)) {
67002 aRv.Throw(NS_ERROR_UNEXPECTED);
67003 return;
67004 }
67005 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67006 if (!JS::Call(cx, thisValue, callable,
67007 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67008 aRv.NoteJSContextException(cx);
67009 return;
67010 }
67011}
67012
67013void
67014TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67015{
67016 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue26", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67017 if (aRv.Failed()) {
67018 return;
67019 }
67020 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67020); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67020); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67021 BindingCallContext& cx = s.GetCallContext();
67022
67023 JS::Rooted<JS::Value> rval(cx);
67024 JS::RootedVector<JS::Value> argv(cx);
67025 if (!argv.resize(1)) {
67026 // That threw an exception on the JSContext, and our CallSetup will do
67027 // the right thing with that.
67028 return;
67029 }
67030 unsigned argc = 1;
67031
67032 do {
67033 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67034 if (arg.IsNull()) {
67035 argv[0].setNull();
67036 break;
67037 }
67038 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
67039 aRv.Throw(NS_ERROR_UNEXPECTED);
67040 return;
67041 }
67042 break;
67043 } while (false);
67044
67045 JS::Rooted<JS::Value> callable(cx);
67046 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67047 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67048 !InitIds(cx, atomsCache)) ||
67049 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue26_id, &callable)) {
67050 aRv.Throw(NS_ERROR_UNEXPECTED);
67051 return;
67052 }
67053 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67054 if (!JS::Call(cx, thisValue, callable,
67055 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67056 aRv.NoteJSContextException(cx);
67057 return;
67058 }
67059}
67060
67061void
67062TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67063{
67064 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue27", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67065 if (aRv.Failed()) {
67066 return;
67067 }
67068 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67068); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67068); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67069 BindingCallContext& cx = s.GetCallContext();
67070
67071 JS::Rooted<JS::Value> rval(cx);
67072 JS::RootedVector<JS::Value> argv(cx);
67073 if (!argv.resize(1)) {
67074 // That threw an exception on the JSContext, and our CallSetup will do
67075 // the right thing with that.
67076 return;
67077 }
67078 unsigned argc = 1;
67079
67080 do {
67081 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67082 if (arg.IsNull()) {
67083 argv[0].setNull();
67084 break;
67085 }
67086 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
67087 aRv.Throw(NS_ERROR_UNEXPECTED);
67088 return;
67089 }
67090 break;
67091 } while (false);
67092
67093 JS::Rooted<JS::Value> callable(cx);
67094 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67095 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67096 !InitIds(cx, atomsCache)) ||
67097 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue27_id, &callable)) {
67098 aRv.Throw(NS_ERROR_UNEXPECTED);
67099 return;
67100 }
67101 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67102 if (!JS::Call(cx, thisValue, callable,
67103 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67104 aRv.NoteJSContextException(cx);
67105 return;
67106 }
67107}
67108
67109void
67110TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67111{
67112 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue28", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67113 if (aRv.Failed()) {
67114 return;
67115 }
67116 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67116); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67116); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67117 BindingCallContext& cx = s.GetCallContext();
67118
67119 JS::Rooted<JS::Value> rval(cx);
67120 JS::RootedVector<JS::Value> argv(cx);
67121 if (!argv.resize(1)) {
67122 // That threw an exception on the JSContext, and our CallSetup will do
67123 // the right thing with that.
67124 return;
67125 }
67126 unsigned argc = 1;
67127
67128 do {
67129 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67130 if (arg.IsNull()) {
67131 argv[0].setNull();
67132 break;
67133 }
67134 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
67135 aRv.Throw(NS_ERROR_UNEXPECTED);
67136 return;
67137 }
67138 break;
67139 } while (false);
67140
67141 JS::Rooted<JS::Value> callable(cx);
67142 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67143 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67144 !InitIds(cx, atomsCache)) ||
67145 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue28_id, &callable)) {
67146 aRv.Throw(NS_ERROR_UNEXPECTED);
67147 return;
67148 }
67149 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67150 if (!JS::Call(cx, thisValue, callable,
67151 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67152 aRv.NoteJSContextException(cx);
67153 return;
67154 }
67155}
67156
67157void
67158TestJSImplInterfaceJSImpl::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67159{
67160 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67161 if (aRv.Failed()) {
67162 return;
67163 }
67164 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67164); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67164); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67165 BindingCallContext& cx = s.GetCallContext();
67166
67167 JS::Rooted<JS::Value> rval(cx);
67168 JS::RootedVector<JS::Value> argv(cx);
67169 if (!argv.resize(1)) {
67170 // That threw an exception on the JSContext, and our CallSetup will do
67171 // the right thing with that.
67172 return;
67173 }
67174 unsigned argc = 1;
67175
67176 do {
67177
67178 uint32_t length = arg.Length();
67179 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67180 if (!returnArray) {
67181 aRv.Throw(NS_ERROR_UNEXPECTED);
67182 return;
67183 }
67184 // Scope for 'tmp'
67185 {
67186 JS::Rooted<JS::Value> tmp(cx);
67187 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67188 // Control block to let us common up the JS_DefineElement calls when there
67189 // are different ways to succeed at wrapping the object.
67190 do {
67191 if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) {
67192 aRv.Throw(NS_ERROR_UNEXPECTED);
67193 return;
67194 }
67195 break;
67196 } while (false);
67197 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67198 JSPROP_ENUMERATE)) {
67199 aRv.Throw(NS_ERROR_UNEXPECTED);
67200 return;
67201 }
67202 }
67203 }
67204 argv[0].setObject(*returnArray);
67205 break;
67206 } while (false);
67207
67208 JS::Rooted<JS::Value> callable(cx);
67209 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67210 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67211 !InitIds(cx, atomsCache)) ||
67212 !GetCallableProperty(cx, atomsCache->passSequenceOfUnions_id, &callable)) {
67213 aRv.Throw(NS_ERROR_UNEXPECTED);
67214 return;
67215 }
67216 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67217 if (!JS::Call(cx, thisValue, callable,
67218 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67219 aRv.NoteJSContextException(cx);
67220 return;
67221 }
67222}
67223
67224void
67225TestJSImplInterfaceJSImpl::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67226{
67227 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67228 if (aRv.Failed()) {
67229 return;
67230 }
67231 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67231); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67232 BindingCallContext& cx = s.GetCallContext();
67233
67234 JS::Rooted<JS::Value> rval(cx);
67235 JS::RootedVector<JS::Value> argv(cx);
67236 if (!argv.resize(1)) {
67237 // That threw an exception on the JSContext, and our CallSetup will do
67238 // the right thing with that.
67239 return;
67240 }
67241 unsigned argc = 1;
67242
67243 do {
67244
67245 uint32_t length = arg.Length();
67246 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67247 if (!returnArray) {
67248 aRv.Throw(NS_ERROR_UNEXPECTED);
67249 return;
67250 }
67251 // Scope for 'tmp'
67252 {
67253 JS::Rooted<JS::Value> tmp(cx);
67254 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67255 // Control block to let us common up the JS_DefineElement calls when there
67256 // are different ways to succeed at wrapping the object.
67257 do {
67258 if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) {
67259 aRv.Throw(NS_ERROR_UNEXPECTED);
67260 return;
67261 }
67262 break;
67263 } while (false);
67264 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67265 JSPROP_ENUMERATE)) {
67266 aRv.Throw(NS_ERROR_UNEXPECTED);
67267 return;
67268 }
67269 }
67270 }
67271 argv[0].setObject(*returnArray);
67272 break;
67273 } while (false);
67274
67275 JS::Rooted<JS::Value> callable(cx);
67276 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67277 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67278 !InitIds(cx, atomsCache)) ||
67279 !GetCallableProperty(cx, atomsCache->passSequenceOfUnions2_id, &callable)) {
67280 aRv.Throw(NS_ERROR_UNEXPECTED);
67281 return;
67282 }
67283 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67284 if (!JS::Call(cx, thisValue, callable,
67285 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67286 aRv.NoteJSContextException(cx);
67287 return;
67288 }
67289}
67290
67291void
67292TestJSImplInterfaceJSImpl::PassVariadicUnion(const nsTArray<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67293{
67294 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67295 if (aRv.Failed()) {
67296 return;
67297 }
67298 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67298); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67299 BindingCallContext& cx = s.GetCallContext();
67300
67301 JS::Rooted<JS::Value> rval(cx);
67302 JS::RootedVector<JS::Value> argv(cx);
67303 if (!argv.resize((1 - 1) + arg.Length())) {
67304 // That threw an exception on the JSContext, and our CallSetup will do
67305 // the right thing with that.
67306 return;
67307 }
67308 unsigned argc = (1 - 1) + arg.Length();
67309
67310 do {
67311 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
67312 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67313 if (!arg[idx].ToJSVal(cx, callbackObj, argv[0 + idx])) {
67314 aRv.Throw(NS_ERROR_UNEXPECTED);
67315 return;
67316 }
67317 continue;
67318 }
67319 break;
67320 } while (false);
67321
67322 JS::Rooted<JS::Value> callable(cx);
67323 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67324 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67325 !InitIds(cx, atomsCache)) ||
67326 !GetCallableProperty(cx, atomsCache->passVariadicUnion_id, &callable)) {
67327 aRv.Throw(NS_ERROR_UNEXPECTED);
67328 return;
67329 }
67330 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67331 if (!JS::Call(cx, thisValue, callable,
67332 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67333 aRv.NoteJSContextException(cx);
67334 return;
67335 }
67336}
67337
67338void
67339TestJSImplInterfaceJSImpl::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67340{
67341 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67342 if (aRv.Failed()) {
67343 return;
67344 }
67345 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67345); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67345); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67346 BindingCallContext& cx = s.GetCallContext();
67347
67348 JS::Rooted<JS::Value> rval(cx);
67349 JS::RootedVector<JS::Value> argv(cx);
67350 if (!argv.resize(1)) {
67351 // That threw an exception on the JSContext, and our CallSetup will do
67352 // the right thing with that.
67353 return;
67354 }
67355 unsigned argc = 1;
67356
67357 do {
67358
67359 uint32_t length = arg.Length();
67360 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67361 if (!returnArray) {
67362 aRv.Throw(NS_ERROR_UNEXPECTED);
67363 return;
67364 }
67365 // Scope for 'tmp'
67366 {
67367 JS::Rooted<JS::Value> tmp(cx);
67368 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67369 // Control block to let us common up the JS_DefineElement calls when there
67370 // are different ways to succeed at wrapping the object.
67371 do {
67372 if (arg[sequenceIdx0].IsNull()) {
67373 tmp.setNull();
67374 break;
67375 }
67376 if (!arg[sequenceIdx0].Value().ToJSVal(cx, returnArray, &tmp)) {
67377 aRv.Throw(NS_ERROR_UNEXPECTED);
67378 return;
67379 }
67380 break;
67381 } while (false);
67382 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67383 JSPROP_ENUMERATE)) {
67384 aRv.Throw(NS_ERROR_UNEXPECTED);
67385 return;
67386 }
67387 }
67388 }
67389 argv[0].setObject(*returnArray);
67390 break;
67391 } while (false);
67392
67393 JS::Rooted<JS::Value> callable(cx);
67394 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67395 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67396 !InitIds(cx, atomsCache)) ||
67397 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableUnions_id, &callable)) {
67398 aRv.Throw(NS_ERROR_UNEXPECTED);
67399 return;
67400 }
67401 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67402 if (!JS::Call(cx, thisValue, callable,
67403 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67404 aRv.NoteJSContextException(cx);
67405 return;
67406 }
67407}
67408
67409void
67410TestJSImplInterfaceJSImpl::PassVariadicNullableUnion(const nsTArray<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67411{
67412 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67413 if (aRv.Failed()) {
67414 return;
67415 }
67416 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67416); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67416); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67417 BindingCallContext& cx = s.GetCallContext();
67418
67419 JS::Rooted<JS::Value> rval(cx);
67420 JS::RootedVector<JS::Value> argv(cx);
67421 if (!argv.resize((1 - 1) + arg.Length())) {
67422 // That threw an exception on the JSContext, and our CallSetup will do
67423 // the right thing with that.
67424 return;
67425 }
67426 unsigned argc = (1 - 1) + arg.Length();
67427
67428 do {
67429 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
67430 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67431 if (arg[idx].IsNull()) {
67432 argv[0 + idx].setNull();
67433 continue;
67434 }
67435 if (!arg[idx].Value().ToJSVal(cx, callbackObj, argv[0 + idx])) {
67436 aRv.Throw(NS_ERROR_UNEXPECTED);
67437 return;
67438 }
67439 continue;
67440 }
67441 break;
67442 } while (false);
67443
67444 JS::Rooted<JS::Value> callable(cx);
67445 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67446 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67447 !InitIds(cx, atomsCache)) ||
67448 !GetCallableProperty(cx, atomsCache->passVariadicNullableUnion_id, &callable)) {
67449 aRv.Throw(NS_ERROR_UNEXPECTED);
67450 return;
67451 }
67452 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67453 if (!JS::Call(cx, thisValue, callable,
67454 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67455 aRv.NoteJSContextException(cx);
67456 return;
67457 }
67458}
67459
67460void
67461TestJSImplInterfaceJSImpl::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67462{
67463 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67464 if (aRv.Failed()) {
67465 return;
67466 }
67467 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67467); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67467); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67468 BindingCallContext& cx = s.GetCallContext();
67469
67470 JS::Rooted<JS::Value> rval(cx);
67471 JS::RootedVector<JS::Value> argv(cx);
67472 if (!argv.resize(1)) {
67473 // That threw an exception on the JSContext, and our CallSetup will do
67474 // the right thing with that.
67475 return;
67476 }
67477 unsigned argc = 1;
67478
67479 do {
67480
67481 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
67482 if (!returnObj) {
67483 aRv.Throw(NS_ERROR_UNEXPECTED);
67484 return;
67485 }
67486 // Scope for 'tmp'
67487 {
67488 JS::Rooted<JS::Value> tmp(cx);
67489 for (auto& entry : arg.Entries()) {
67490 auto& recordValue0 = entry.mValue;
67491 // Control block to let us common up the JS_DefineUCProperty calls when there
67492 // are different ways to succeed at wrapping the value.
67493 do {
67494 if (!recordValue0.ToJSVal(cx, returnObj, &tmp)) {
67495 aRv.Throw(NS_ERROR_UNEXPECTED);
67496 return;
67497 }
67498 break;
67499 } while (false);
67500 if (!JS_DefineUCProperty(cx, returnObj,
67501 entry.mKey.BeginReading(),
67502 entry.mKey.Length(), tmp,
67503 JSPROP_ENUMERATE)) {
67504 aRv.Throw(NS_ERROR_UNEXPECTED);
67505 return;
67506 }
67507 }
67508 }
67509 argv[0].setObject(*returnObj);
67510 break;
67511 } while (false);
67512
67513 JS::Rooted<JS::Value> callable(cx);
67514 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67515 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67516 !InitIds(cx, atomsCache)) ||
67517 !GetCallableProperty(cx, atomsCache->passRecordOfUnions_id, &callable)) {
67518 aRv.Throw(NS_ERROR_UNEXPECTED);
67519 return;
67520 }
67521 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67522 if (!JS::Call(cx, thisValue, callable,
67523 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67524 aRv.NoteJSContextException(cx);
67525 return;
67526 }
67527}
67528
67529void
67530TestJSImplInterfaceJSImpl::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67531{
67532 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67533 if (aRv.Failed()) {
67534 return;
67535 }
67536 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67536); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67536); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67537 BindingCallContext& cx = s.GetCallContext();
67538
67539 JS::Rooted<JS::Value> rval(cx);
67540
67541 JS::Rooted<JS::Value> callable(cx);
67542 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67543 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67544 !InitIds(cx, atomsCache)) ||
67545 !GetCallableProperty(cx, atomsCache->receiveUnion_id, &callable)) {
67546 aRv.Throw(NS_ERROR_UNEXPECTED);
67547 return;
67548 }
67549 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67550 if (!JS::Call(cx, thisValue, callable,
67551 JS::HandleValueArray::empty(), &rval)) {
67552 aRv.NoteJSContextException(cx);
67553 return;
67554 }
67555 OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal);
67556 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion", false)) {
67557 aRv.Throw(NS_ERROR_UNEXPECTED);
67558 return;
67559 }
67560}
67561
67562void
67563TestJSImplInterfaceJSImpl::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67564{
67565 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67566 if (aRv.Failed()) {
67567 return;
67568 }
67569 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67569); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67570 BindingCallContext& cx = s.GetCallContext();
67571
67572 JS::Rooted<JS::Value> rval(cx);
67573
67574 JS::Rooted<JS::Value> callable(cx);
67575 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67576 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67577 !InitIds(cx, atomsCache)) ||
67578 !GetCallableProperty(cx, atomsCache->receiveUnion2_id, &callable)) {
67579 aRv.Throw(NS_ERROR_UNEXPECTED);
67580 return;
67581 }
67582 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67583 if (!JS::Call(cx, thisValue, callable,
67584 JS::HandleValueArray::empty(), &rval)) {
67585 aRv.NoteJSContextException(cx);
67586 return;
67587 }
67588 OwningObjectOrLong& rvalDecl(aRetVal);
67589 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion2", false)) {
67590 aRv.Throw(NS_ERROR_UNEXPECTED);
67591 return;
67592 }
67593}
67594
67595void
67596TestJSImplInterfaceJSImpl::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67597{
67598 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67599 if (aRv.Failed()) {
67600 return;
67601 }
67602 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67602); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67602); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67603 BindingCallContext& cx = s.GetCallContext();
67604
67605 JS::Rooted<JS::Value> rval(cx);
67606
67607 JS::Rooted<JS::Value> callable(cx);
67608 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67609 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67610 !InitIds(cx, atomsCache)) ||
67611 !GetCallableProperty(cx, atomsCache->receiveUnionContainingNull_id, &callable)) {
67612 aRv.Throw(NS_ERROR_UNEXPECTED);
67613 return;
67614 }
67615 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67616 if (!JS::Call(cx, thisValue, callable,
67617 JS::HandleValueArray::empty(), &rval)) {
67618 aRv.NoteJSContextException(cx);
67619 return;
67620 }
67621 OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal);
67622 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnionContainingNull", false)) {
67623 aRv.Throw(NS_ERROR_UNEXPECTED);
67624 return;
67625 }
67626}
67627
67628void
67629TestJSImplInterfaceJSImpl::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67630{
67631 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67632 if (aRv.Failed()) {
67633 return;
67634 }
67635 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67635); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67635); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67636 BindingCallContext& cx = s.GetCallContext();
67637
67638 JS::Rooted<JS::Value> rval(cx);
67639
67640 JS::Rooted<JS::Value> callable(cx);
67641 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67642 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67643 !InitIds(cx, atomsCache)) ||
67644 !GetCallableProperty(cx, atomsCache->receiveNullableUnion_id, &callable)) {
67645 aRv.Throw(NS_ERROR_UNEXPECTED);
67646 return;
67647 }
67648 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67649 if (!JS::Call(cx, thisValue, callable,
67650 JS::HandleValueArray::empty(), &rval)) {
67651 aRv.NoteJSContextException(cx);
67652 return;
67653 }
67654 Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal);
67655 if (rval.isNullOrUndefined()) {
67656 rvalDecl.SetNull();
67657 } else {
67658 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion", false)) {
67659 aRv.Throw(NS_ERROR_UNEXPECTED);
67660 return;
67661 }
67662 }
67663}
67664
67665void
67666TestJSImplInterfaceJSImpl::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67667{
67668 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67669 if (aRv.Failed()) {
67670 return;
67671 }
67672 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67672); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67673 BindingCallContext& cx = s.GetCallContext();
67674
67675 JS::Rooted<JS::Value> rval(cx);
67676
67677 JS::Rooted<JS::Value> callable(cx);
67678 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67679 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67680 !InitIds(cx, atomsCache)) ||
67681 !GetCallableProperty(cx, atomsCache->receiveNullableUnion2_id, &callable)) {
67682 aRv.Throw(NS_ERROR_UNEXPECTED);
67683 return;
67684 }
67685 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67686 if (!JS::Call(cx, thisValue, callable,
67687 JS::HandleValueArray::empty(), &rval)) {
67688 aRv.NoteJSContextException(cx);
67689 return;
67690 }
67691 Nullable<OwningObjectOrLong >& rvalDecl(aRetVal);
67692 if (rval.isNullOrUndefined()) {
67693 rvalDecl.SetNull();
67694 } else {
67695 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion2", false)) {
67696 aRv.Throw(NS_ERROR_UNEXPECTED);
67697 return;
67698 }
67699 }
67700}
67701
67702void
67703TestJSImplInterfaceJSImpl::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm)
67704{
67705 CallSetup s(this, aRv, "TestJSImplInterface.passPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67706 if (aRv.Failed()) {
67707 return;
67708 }
67709 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67709); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67709); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67710 BindingCallContext& cx = s.GetCallContext();
67711
67712 JS::Rooted<JS::Value> rval(cx);
67713 JS::RootedVector<JS::Value> argv(cx);
67714 if (!argv.resize(1)) {
67715 // That threw an exception on the JSContext, and our CallSetup will do
67716 // the right thing with that.
67717 return;
67718 }
67719 unsigned argc = 1;
67720
67721 do {
67722 if (!ToJSValue(cx, arg, argv[0])) {
67723 aRv.Throw(NS_ERROR_UNEXPECTED);
67724 return;
67725 }
67726 break;
67727 } while (false);
67728
67729 JS::Rooted<JS::Value> callable(cx);
67730 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67731 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67732 !InitIds(cx, atomsCache)) ||
67733 !GetCallableProperty(cx, atomsCache->passPromise_id, &callable)) {
67734 aRv.Throw(NS_ERROR_UNEXPECTED);
67735 return;
67736 }
67737 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67738 if (!JS::Call(cx, thisValue, callable,
67739 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67740 aRv.NoteJSContextException(cx);
67741 return;
67742 }
67743}
67744
67745void
67746TestJSImplInterfaceJSImpl::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67747{
67748 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67749 if (aRv.Failed()) {
67750 return;
67751 }
67752 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67752); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67752); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67753 BindingCallContext& cx = s.GetCallContext();
67754
67755 JS::Rooted<JS::Value> rval(cx);
67756 JS::RootedVector<JS::Value> argv(cx);
67757 if (!argv.resize(1)) {
67758 // That threw an exception on the JSContext, and our CallSetup will do
67759 // the right thing with that.
67760 return;
67761 }
67762 unsigned argc = 1;
67763
67764 do {
67765 if (arg.WasPassed()) {
67766 if (!ToJSValue(cx, arg.Value(), argv[0])) {
67767 aRv.Throw(NS_ERROR_UNEXPECTED);
67768 return;
67769 }
67770 break;
67771 } else if (argc == 1) {
67772 // This is our current trailing argument; reduce argc
67773 --argc;
67774 } else {
67775 argv[0].setUndefined();
67776 }
67777 } while (false);
67778
67779 JS::Rooted<JS::Value> callable(cx);
67780 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67781 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67782 !InitIds(cx, atomsCache)) ||
67783 !GetCallableProperty(cx, atomsCache->passOptionalPromise_id, &callable)) {
67784 aRv.Throw(NS_ERROR_UNEXPECTED);
67785 return;
67786 }
67787 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67788 if (!JS::Call(cx, thisValue, callable,
67789 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67790 aRv.NoteJSContextException(cx);
67791 return;
67792 }
67793}
67794
67795void
67796TestJSImplInterfaceJSImpl::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67797{
67798 CallSetup s(this, aRv, "TestJSImplInterface.passPromiseSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67799 if (aRv.Failed()) {
67800 return;
67801 }
67802 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67802); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67802); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67803 BindingCallContext& cx = s.GetCallContext();
67804
67805 JS::Rooted<JS::Value> rval(cx);
67806 JS::RootedVector<JS::Value> argv(cx);
67807 if (!argv.resize(1)) {
67808 // That threw an exception on the JSContext, and our CallSetup will do
67809 // the right thing with that.
67810 return;
67811 }
67812 unsigned argc = 1;
67813
67814 do {
67815
67816 uint32_t length = arg.Length();
67817 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67818 if (!returnArray) {
67819 aRv.Throw(NS_ERROR_UNEXPECTED);
67820 return;
67821 }
67822 // Scope for 'tmp'
67823 {
67824 JS::Rooted<JS::Value> tmp(cx);
67825 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67826 // Control block to let us common up the JS_DefineElement calls when there
67827 // are different ways to succeed at wrapping the object.
67828 do {
67829 if (!ToJSValue(cx, arg[sequenceIdx0], &tmp)) {
67830 aRv.Throw(NS_ERROR_UNEXPECTED);
67831 return;
67832 }
67833 break;
67834 } while (false);
67835 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67836 JSPROP_ENUMERATE)) {
67837 aRv.Throw(NS_ERROR_UNEXPECTED);
67838 return;
67839 }
67840 }
67841 }
67842 argv[0].setObject(*returnArray);
67843 break;
67844 } while (false);
67845
67846 JS::Rooted<JS::Value> callable(cx);
67847 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67848 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67849 !InitIds(cx, atomsCache)) ||
67850 !GetCallableProperty(cx, atomsCache->passPromiseSequence_id, &callable)) {
67851 aRv.Throw(NS_ERROR_UNEXPECTED);
67852 return;
67853 }
67854 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67855 if (!JS::Call(cx, thisValue, callable,
67856 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67857 aRv.NoteJSContextException(cx);
67858 return;
67859 }
67860}
67861
67862already_AddRefed<Promise>
67863TestJSImplInterfaceJSImpl::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm)
67864{
67865 CallSetup s(this, aRv, "TestJSImplInterface.receivePromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67866 if (aRv.Failed()) {
67867 return nullptr;
67868 }
67869 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67869); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67869); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67870 BindingCallContext& cx = s.GetCallContext();
67871
67872 JS::Rooted<JS::Value> rval(cx);
67873
67874 JS::Rooted<JS::Value> callable(cx);
67875 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67876 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67877 !InitIds(cx, atomsCache)) ||
67878 !GetCallableProperty(cx, atomsCache->receivePromise_id, &callable)) {
67879 aRv.Throw(NS_ERROR_UNEXPECTED);
67880 return nullptr;
67881 }
67882 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67883 if (!JS::Call(cx, thisValue, callable,
67884 JS::HandleValueArray::empty(), &rval)) {
67885 aRv.NoteJSContextException(cx);
67886 return nullptr;
67887 }
67888 RefPtr<Promise> rvalDecl;
67889 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
67890 // etc.
67891
67892 JS::Rooted<JSObject*> globalObj(cx);
67893 if (!rval.isObject()) {
67894 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise");
67895 return nullptr;
67896 }
67897 JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject());
67898 if (!unwrappedVal) {
67899 // A slight lie, but not much of one, for a dead object wrapper.
67900 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise");
67901 return nullptr;
67902 }
67903 globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal);
67904 JSAutoRealm ar(cx, globalObj);
67905 GlobalObject promiseGlobal(cx, globalObj);
67906 if (promiseGlobal.Failed()) {
67907 aRv.Throw(NS_ERROR_UNEXPECTED);
67908 return nullptr;
67909 }
67910
67911 JS::Rooted<JS::Value> valueToResolve(cx, rval);
67912 if (!JS_WrapValue(cx, &valueToResolve)) {
67913 aRv.Throw(NS_ERROR_UNEXPECTED);
67914 return nullptr;
67915 }
67916 binding_detail::FastErrorResult promiseRv;
67917 nsCOMPtr<nsIGlobalObject> global =
67918 do_QueryInterface(promiseGlobal.GetAsSupports());
67919 if (!global) {
67920 promiseRv.Throw(NS_ERROR_UNEXPECTED);
67921 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { do { } while (false); MOZ_ReportCrash
("" "promiseRv.MaybeSetPendingException(cx)", "../TestJSImplGenBinding.cpp"
, 67921); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)"
")"); do { MOZ_CrashSequence(__null, 67921); __attribute__((
nomerge)) ::abort(); } while (false); } while (false); } } while
(false)
;
67922 aRv.Throw(NS_ERROR_UNEXPECTED);
67923 return nullptr;
67924 }
67925 rvalDecl = Promise::Resolve(global, cx, valueToResolve,
67926 promiseRv);
67927 if (promiseRv.MaybeSetPendingException(cx)) {
67928 aRv.Throw(NS_ERROR_UNEXPECTED);
67929 return nullptr;
67930 }
67931 }
67932 return rvalDecl.forget();
67933}
67934
67935already_AddRefed<Promise>
67936TestJSImplInterfaceJSImpl::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm)
67937{
67938 CallSetup s(this, aRv, "TestJSImplInterface.receiveAddrefedPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67939 if (aRv.Failed()) {
67940 return nullptr;
67941 }
67942 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67942); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 67942); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
67943 BindingCallContext& cx = s.GetCallContext();
67944
67945 JS::Rooted<JS::Value> rval(cx);
67946
67947 JS::Rooted<JS::Value> callable(cx);
67948 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67949 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67950 !InitIds(cx, atomsCache)) ||
67951 !GetCallableProperty(cx, atomsCache->receiveAddrefedPromise_id, &callable)) {
67952 aRv.Throw(NS_ERROR_UNEXPECTED);
67953 return nullptr;
67954 }
67955 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67956 if (!JS::Call(cx, thisValue, callable,
67957 JS::HandleValueArray::empty(), &rval)) {
67958 aRv.NoteJSContextException(cx);
67959 return nullptr;
67960 }
67961 RefPtr<Promise> rvalDecl;
67962 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
67963 // etc.
67964
67965 JS::Rooted<JSObject*> globalObj(cx);
67966 if (!rval.isObject()) {
67967 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise");
67968 return nullptr;
67969 }
67970 JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject());
67971 if (!unwrappedVal) {
67972 // A slight lie, but not much of one, for a dead object wrapper.
67973 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise");
67974 return nullptr;
67975 }
67976 globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal);
67977 JSAutoRealm ar(cx, globalObj);
67978 GlobalObject promiseGlobal(cx, globalObj);
67979 if (promiseGlobal.Failed()) {
67980 aRv.Throw(NS_ERROR_UNEXPECTED);
67981 return nullptr;
67982 }
67983
67984 JS::Rooted<JS::Value> valueToResolve(cx, rval);
67985 if (!JS_WrapValue(cx, &valueToResolve)) {
67986 aRv.Throw(NS_ERROR_UNEXPECTED);
67987 return nullptr;
67988 }
67989 binding_detail::FastErrorResult promiseRv;
67990 nsCOMPtr<nsIGlobalObject> global =
67991 do_QueryInterface(promiseGlobal.GetAsSupports());
67992 if (!global) {
67993 promiseRv.Throw(NS_ERROR_UNEXPECTED);
67994 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { do { } while (false); MOZ_ReportCrash
("" "promiseRv.MaybeSetPendingException(cx)", "../TestJSImplGenBinding.cpp"
, 67994); AnnotateMozCrashReason("MOZ_CRASH(" "promiseRv.MaybeSetPendingException(cx)"
")"); do { MOZ_CrashSequence(__null, 67994); __attribute__((
nomerge)) ::abort(); } while (false); } while (false); } } while
(false)
;
67995 aRv.Throw(NS_ERROR_UNEXPECTED);
67996 return nullptr;
67997 }
67998 rvalDecl = Promise::Resolve(global, cx, valueToResolve,
67999 promiseRv);
68000 if (promiseRv.MaybeSetPendingException(cx)) {
68001 aRv.Throw(NS_ERROR_UNEXPECTED);
68002 return nullptr;
68003 }
68004 }
68005 return rvalDecl.forget();
68006}
68007
68008void
68009TestJSImplInterfaceJSImpl::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
68010{
68011 CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68012 if (aRv.Failed()) {
68013 return;
68014 }
68015 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68015); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68015); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68016 BindingCallContext& cx = s.GetCallContext();
68017
68018 JS::Rooted<JS::Value> rval(cx);
68019
68020 JS::Rooted<JS::Value> callable(cx);
68021 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68022 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68023 !InitIds(cx, atomsCache)) ||
68024 !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) {
68025 aRv.Throw(NS_ERROR_UNEXPECTED);
68026 return;
68027 }
68028 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68029 if (!JS::Call(cx, thisValue, callable,
68030 JS::HandleValueArray::empty(), &rval)) {
68031 aRv.NoteJSContextException(cx);
68032 return;
68033 }
68034}
68035
68036void
68037TestJSImplInterfaceJSImpl::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm)
68038{
68039 CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68040 if (aRv.Failed()) {
68041 return;
68042 }
68043 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68043); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68043); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68044 BindingCallContext& cx = s.GetCallContext();
68045
68046 JS::Rooted<JS::Value> rval(cx);
68047 JS::RootedVector<JS::Value> argv(cx);
68048 if (!argv.resize(1)) {
68049 // That threw an exception on the JSContext, and our CallSetup will do
68050 // the right thing with that.
68051 return;
68052 }
68053 unsigned argc = 1;
68054
68055 do {
68056 argv[0].setInt32(int32_t(argument));
68057 break;
68058 } while (false);
68059
68060 JS::Rooted<JS::Value> callable(cx);
68061 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68062 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68063 !InitIds(cx, atomsCache)) ||
68064 !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) {
68065 aRv.Throw(NS_ERROR_UNEXPECTED);
68066 return;
68067 }
68068 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68069 if (!JS::Call(cx, thisValue, callable,
68070 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68071 aRv.NoteJSContextException(cx);
68072 return;
68073 }
68074}
68075
68076void
68077TestJSImplInterfaceJSImpl::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
68078{
68079 CallSetup s(this, aRv, "TestJSImplInterface.passDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68080 if (aRv.Failed()) {
68081 return;
68082 }
68083 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68083); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68083); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68084 BindingCallContext& cx = s.GetCallContext();
68085
68086 JS::Rooted<JS::Value> rval(cx);
68087 JS::RootedVector<JS::Value> argv(cx);
68088 if (!argv.resize(1)) {
68089 // That threw an exception on the JSContext, and our CallSetup will do
68090 // the right thing with that.
68091 return;
68092 }
68093 unsigned argc = 1;
68094
68095 do {
68096 if (!x.ToObjectInternal(cx, argv[0])) {
68097 aRv.Throw(NS_ERROR_UNEXPECTED);
68098 return;
68099 }
68100 break;
68101 } while (false);
68102
68103 JS::Rooted<JS::Value> callable(cx);
68104 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68105 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68106 !InitIds(cx, atomsCache)) ||
68107 !GetCallableProperty(cx, atomsCache->passDictionary_id, &callable)) {
68108 aRv.Throw(NS_ERROR_UNEXPECTED);
68109 return;
68110 }
68111 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68112 if (!JS::Call(cx, thisValue, callable,
68113 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68114 aRv.NoteJSContextException(cx);
68115 return;
68116 }
68117}
68118
68119void
68120TestJSImplInterfaceJSImpl::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
68121{
68122 CallSetup s(this, aRv, "TestJSImplInterface.passDictionary2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68123 if (aRv.Failed()) {
68124 return;
68125 }
68126 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68126); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68126); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68127 BindingCallContext& cx = s.GetCallContext();
68128
68129 JS::Rooted<JS::Value> rval(cx);
68130 JS::RootedVector<JS::Value> argv(cx);
68131 if (!argv.resize(1)) {
68132 // That threw an exception on the JSContext, and our CallSetup will do
68133 // the right thing with that.
68134 return;
68135 }
68136 unsigned argc = 1;
68137
68138 do {
68139 if (!x.ToObjectInternal(cx, argv[0])) {
68140 aRv.Throw(NS_ERROR_UNEXPECTED);
68141 return;
68142 }
68143 break;
68144 } while (false);
68145
68146 JS::Rooted<JS::Value> callable(cx);
68147 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68148 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68149 !InitIds(cx, atomsCache)) ||
68150 !GetCallableProperty(cx, atomsCache->passDictionary2_id, &callable)) {
68151 aRv.Throw(NS_ERROR_UNEXPECTED);
68152 return;
68153 }
68154 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68155 if (!JS::Call(cx, thisValue, callable,
68156 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68157 aRv.NoteJSContextException(cx);
68158 return;
68159 }
68160}
68161
68162void
68163TestJSImplInterfaceJSImpl::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68164{
68165 CallSetup s(this, aRv, "TestJSImplInterface.receiveDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68166 if (aRv.Failed()) {
68167 return;
68168 }
68169 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68169); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68169); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68170 BindingCallContext& cx = s.GetCallContext();
68171
68172 JS::Rooted<JS::Value> rval(cx);
68173
68174 JS::Rooted<JS::Value> callable(cx);
68175 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68176 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68177 !InitIds(cx, atomsCache)) ||
68178 !GetCallableProperty(cx, atomsCache->receiveDictionary_id, &callable)) {
68179 aRv.Throw(NS_ERROR_UNEXPECTED);
68180 return;
68181 }
68182 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68183 if (!JS::Call(cx, thisValue, callable,
68184 JS::HandleValueArray::empty(), &rval)) {
68185 aRv.NoteJSContextException(cx);
68186 return;
68187 }
68188 Dict& rvalDecl(aRetVal);
68189 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictionary", false)) {
68190 aRv.Throw(NS_ERROR_UNEXPECTED);
68191 return;
68192 }
68193}
68194
68195void
68196TestJSImplInterfaceJSImpl::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68197{
68198 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68199 if (aRv.Failed()) {
68200 return;
68201 }
68202 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68202); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68202); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68203 BindingCallContext& cx = s.GetCallContext();
68204
68205 JS::Rooted<JS::Value> rval(cx);
68206
68207 JS::Rooted<JS::Value> callable(cx);
68208 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68209 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68210 !InitIds(cx, atomsCache)) ||
68211 !GetCallableProperty(cx, atomsCache->receiveNullableDictionary_id, &callable)) {
68212 aRv.Throw(NS_ERROR_UNEXPECTED);
68213 return;
68214 }
68215 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68216 if (!JS::Call(cx, thisValue, callable,
68217 JS::HandleValueArray::empty(), &rval)) {
68218 aRv.NoteJSContextException(cx);
68219 return;
68220 }
68221 Nullable<Dict>& rvalDecl(aRetVal);
68222 if (rval.isNullOrUndefined()) {
68223 rvalDecl.SetNull();
68224 } else {
68225 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableDictionary", false)) {
68226 aRv.Throw(NS_ERROR_UNEXPECTED);
68227 return;
68228 }
68229 }
68230}
68231
68232void
68233TestJSImplInterfaceJSImpl::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm)
68234{
68235 CallSetup s(this, aRv, "TestJSImplInterface.passOtherDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68236 if (aRv.Failed()) {
68237 return;
68238 }
68239 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68239); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68239); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68240 BindingCallContext& cx = s.GetCallContext();
68241
68242 JS::Rooted<JS::Value> rval(cx);
68243 JS::RootedVector<JS::Value> argv(cx);
68244 if (!argv.resize(1)) {
68245 // That threw an exception on the JSContext, and our CallSetup will do
68246 // the right thing with that.
68247 return;
68248 }
68249 unsigned argc = 1;
68250
68251 do {
68252 if (!x.ToObjectInternal(cx, argv[0])) {
68253 aRv.Throw(NS_ERROR_UNEXPECTED);
68254 return;
68255 }
68256 break;
68257 } while (false);
68258
68259 JS::Rooted<JS::Value> callable(cx);
68260 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68261 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68262 !InitIds(cx, atomsCache)) ||
68263 !GetCallableProperty(cx, atomsCache->passOtherDictionary_id, &callable)) {
68264 aRv.Throw(NS_ERROR_UNEXPECTED);
68265 return;
68266 }
68267 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68268 if (!JS::Call(cx, thisValue, callable,
68269 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68270 aRv.NoteJSContextException(cx);
68271 return;
68272 }
68273}
68274
68275void
68276TestJSImplInterfaceJSImpl::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm)
68277{
68278 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68279 if (aRv.Failed()) {
68280 return;
68281 }
68282 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68282); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68282); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68283 BindingCallContext& cx = s.GetCallContext();
68284
68285 JS::Rooted<JS::Value> rval(cx);
68286 JS::RootedVector<JS::Value> argv(cx);
68287 if (!argv.resize(1)) {
68288 // That threw an exception on the JSContext, and our CallSetup will do
68289 // the right thing with that.
68290 return;
68291 }
68292 unsigned argc = 1;
68293
68294 do {
68295
68296 uint32_t length = x.Length();
68297 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
68298 if (!returnArray) {
68299 aRv.Throw(NS_ERROR_UNEXPECTED);
68300 return;
68301 }
68302 // Scope for 'tmp'
68303 {
68304 JS::Rooted<JS::Value> tmp(cx);
68305 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
68306 // Control block to let us common up the JS_DefineElement calls when there
68307 // are different ways to succeed at wrapping the object.
68308 do {
68309 if (!x[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
68310 aRv.Throw(NS_ERROR_UNEXPECTED);
68311 return;
68312 }
68313 break;
68314 } while (false);
68315 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
68316 JSPROP_ENUMERATE)) {
68317 aRv.Throw(NS_ERROR_UNEXPECTED);
68318 return;
68319 }
68320 }
68321 }
68322 argv[0].setObject(*returnArray);
68323 break;
68324 } while (false);
68325
68326 JS::Rooted<JS::Value> callable(cx);
68327 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68328 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68329 !InitIds(cx, atomsCache)) ||
68330 !GetCallableProperty(cx, atomsCache->passSequenceOfDictionaries_id, &callable)) {
68331 aRv.Throw(NS_ERROR_UNEXPECTED);
68332 return;
68333 }
68334 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68335 if (!JS::Call(cx, thisValue, callable,
68336 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68337 aRv.NoteJSContextException(cx);
68338 return;
68339 }
68340}
68341
68342void
68343TestJSImplInterfaceJSImpl::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm)
68344{
68345 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68346 if (aRv.Failed()) {
68347 return;
68348 }
68349 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68349); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68349); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68350 BindingCallContext& cx = s.GetCallContext();
68351
68352 JS::Rooted<JS::Value> rval(cx);
68353 JS::RootedVector<JS::Value> argv(cx);
68354 if (!argv.resize(1)) {
68355 // That threw an exception on the JSContext, and our CallSetup will do
68356 // the right thing with that.
68357 return;
68358 }
68359 unsigned argc = 1;
68360
68361 do {
68362
68363 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
68364 if (!returnObj) {
68365 aRv.Throw(NS_ERROR_UNEXPECTED);
68366 return;
68367 }
68368 // Scope for 'tmp'
68369 {
68370 JS::Rooted<JS::Value> tmp(cx);
68371 for (auto& entry : x.Entries()) {
68372 auto& recordValue0 = entry.mValue;
68373 // Control block to let us common up the JS_DefineUCProperty calls when there
68374 // are different ways to succeed at wrapping the value.
68375 do {
68376 if (!recordValue0.ToObjectInternal(cx, &tmp)) {
68377 aRv.Throw(NS_ERROR_UNEXPECTED);
68378 return;
68379 }
68380 break;
68381 } while (false);
68382 if (!JS_DefineUCProperty(cx, returnObj,
68383 entry.mKey.BeginReading(),
68384 entry.mKey.Length(), tmp,
68385 JSPROP_ENUMERATE)) {
68386 aRv.Throw(NS_ERROR_UNEXPECTED);
68387 return;
68388 }
68389 }
68390 }
68391 argv[0].setObject(*returnObj);
68392 break;
68393 } while (false);
68394
68395 JS::Rooted<JS::Value> callable(cx);
68396 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68397 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68398 !InitIds(cx, atomsCache)) ||
68399 !GetCallableProperty(cx, atomsCache->passRecordOfDictionaries_id, &callable)) {
68400 aRv.Throw(NS_ERROR_UNEXPECTED);
68401 return;
68402 }
68403 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68404 if (!JS::Call(cx, thisValue, callable,
68405 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68406 aRv.NoteJSContextException(cx);
68407 return;
68408 }
68409}
68410
68411void
68412TestJSImplInterfaceJSImpl::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
68413{
68414 CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68415 if (aRv.Failed()) {
68416 return;
68417 }
68418 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68418); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68419 BindingCallContext& cx = s.GetCallContext();
68420
68421 JS::Rooted<JS::Value> rval(cx);
68422 JS::RootedVector<JS::Value> argv(cx);
68423 if (!argv.resize(1)) {
68424 // That threw an exception on the JSContext, and our CallSetup will do
68425 // the right thing with that.
68426 return;
68427 }
68428 unsigned argc = 1;
68429
68430 do {
68431 if (!x.ToObjectInternal(cx, argv[0])) {
68432 aRv.Throw(NS_ERROR_UNEXPECTED);
68433 return;
68434 }
68435 break;
68436 } while (false);
68437
68438 JS::Rooted<JS::Value> callable(cx);
68439 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68440 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68441 !InitIds(cx, atomsCache)) ||
68442 !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) {
68443 aRv.Throw(NS_ERROR_UNEXPECTED);
68444 return;
68445 }
68446 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68447 if (!JS::Call(cx, thisValue, callable,
68448 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68449 aRv.NoteJSContextException(cx);
68450 return;
68451 }
68452}
68453
68454void
68455TestJSImplInterfaceJSImpl::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm)
68456{
68457 CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68458 if (aRv.Failed()) {
68459 return;
68460 }
68461 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68461); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68461); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68462 BindingCallContext& cx = s.GetCallContext();
68463
68464 JS::Rooted<JS::Value> rval(cx);
68465 JS::RootedVector<JS::Value> argv(cx);
68466 if (!argv.resize(1)) {
68467 // That threw an exception on the JSContext, and our CallSetup will do
68468 // the right thing with that.
68469 return;
68470 }
68471 unsigned argc = 1;
68472
68473 do {
68474 argv[0].setInt32(int32_t(x));
68475 break;
68476 } while (false);
68477
68478 JS::Rooted<JS::Value> callable(cx);
68479 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68480 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68481 !InitIds(cx, atomsCache)) ||
68482 !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) {
68483 aRv.Throw(NS_ERROR_UNEXPECTED);
68484 return;
68485 }
68486 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68487 if (!JS::Call(cx, thisValue, callable,
68488 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68489 aRv.NoteJSContextException(cx);
68490 return;
68491 }
68492}
68493
68494void
68495TestJSImplInterfaceJSImpl::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm)
68496{
68497 CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingDict", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68498 if (aRv.Failed()) {
68499 return;
68500 }
68501 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68501); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68501); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68502 BindingCallContext& cx = s.GetCallContext();
68503
68504 JS::Rooted<JS::Value> rval(cx);
68505 JS::RootedVector<JS::Value> argv(cx);
68506 if (!argv.resize(1)) {
68507 // That threw an exception on the JSContext, and our CallSetup will do
68508 // the right thing with that.
68509 return;
68510 }
68511 unsigned argc = 1;
68512
68513 do {
68514 if (!arg.ToObjectInternal(cx, argv[0])) {
68515 aRv.Throw(NS_ERROR_UNEXPECTED);
68516 return;
68517 }
68518 break;
68519 } while (false);
68520
68521 JS::Rooted<JS::Value> callable(cx);
68522 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68523 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68524 !InitIds(cx, atomsCache)) ||
68525 !GetCallableProperty(cx, atomsCache->passDictContainingDict_id, &callable)) {
68526 aRv.Throw(NS_ERROR_UNEXPECTED);
68527 return;
68528 }
68529 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68530 if (!JS::Call(cx, thisValue, callable,
68531 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68532 aRv.NoteJSContextException(cx);
68533 return;
68534 }
68535}
68536
68537void
68538TestJSImplInterfaceJSImpl::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
68539{
68540 CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68541 if (aRv.Failed()) {
68542 return;
68543 }
68544 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68544); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68545 BindingCallContext& cx = s.GetCallContext();
68546
68547 JS::Rooted<JS::Value> rval(cx);
68548 JS::RootedVector<JS::Value> argv(cx);
68549 if (!argv.resize(1)) {
68550 // That threw an exception on the JSContext, and our CallSetup will do
68551 // the right thing with that.
68552 return;
68553 }
68554 unsigned argc = 1;
68555
68556 do {
68557 if (!arg.ToObjectInternal(cx, argv[0])) {
68558 aRv.Throw(NS_ERROR_UNEXPECTED);
68559 return;
68560 }
68561 break;
68562 } while (false);
68563
68564 JS::Rooted<JS::Value> callable(cx);
68565 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68566 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68567 !InitIds(cx, atomsCache)) ||
68568 !GetCallableProperty(cx, atomsCache->passDictContainingSequence_id, &callable)) {
68569 aRv.Throw(NS_ERROR_UNEXPECTED);
68570 return;
68571 }
68572 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68573 if (!JS::Call(cx, thisValue, callable,
68574 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68575 aRv.NoteJSContextException(cx);
68576 return;
68577 }
68578}
68579
68580void
68581TestJSImplInterfaceJSImpl::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68582{
68583 CallSetup s(this, aRv, "TestJSImplInterface.receiveDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68584 if (aRv.Failed()) {
68585 return;
68586 }
68587 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68587); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68587); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68588 BindingCallContext& cx = s.GetCallContext();
68589
68590 JS::Rooted<JS::Value> rval(cx);
68591
68592 JS::Rooted<JS::Value> callable(cx);
68593 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68594 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68595 !InitIds(cx, atomsCache)) ||
68596 !GetCallableProperty(cx, atomsCache->receiveDictContainingSequence_id, &callable)) {
68597 aRv.Throw(NS_ERROR_UNEXPECTED);
68598 return;
68599 }
68600 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68601 if (!JS::Call(cx, thisValue, callable,
68602 JS::HandleValueArray::empty(), &rval)) {
68603 aRv.NoteJSContextException(cx);
68604 return;
68605 }
68606 DictContainingSequence& rvalDecl(aRetVal);
68607 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictContainingSequence", false)) {
68608 aRv.Throw(NS_ERROR_UNEXPECTED);
68609 return;
68610 }
68611}
68612
68613void
68614TestJSImplInterfaceJSImpl::PassVariadicDictionary(const nsTArray<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68615{
68616 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68617 if (aRv.Failed()) {
68618 return;
68619 }
68620 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68620); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68620); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68621 BindingCallContext& cx = s.GetCallContext();
68622
68623 JS::Rooted<JS::Value> rval(cx);
68624 JS::RootedVector<JS::Value> argv(cx);
68625 if (!argv.resize((1 - 1) + arg.Length())) {
68626 // That threw an exception on the JSContext, and our CallSetup will do
68627 // the right thing with that.
68628 return;
68629 }
68630 unsigned argc = (1 - 1) + arg.Length();
68631
68632 do {
68633 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
68634 if (!arg[idx].ToObjectInternal(cx, argv[0 + idx])) {
68635 aRv.Throw(NS_ERROR_UNEXPECTED);
68636 return;
68637 }
68638 continue;
68639 }
68640 break;
68641 } while (false);
68642
68643 JS::Rooted<JS::Value> callable(cx);
68644 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68645 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68646 !InitIds(cx, atomsCache)) ||
68647 !GetCallableProperty(cx, atomsCache->passVariadicDictionary_id, &callable)) {
68648 aRv.Throw(NS_ERROR_UNEXPECTED);
68649 return;
68650 }
68651 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68652 if (!JS::Call(cx, thisValue, callable,
68653 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68654 aRv.NoteJSContextException(cx);
68655 return;
68656 }
68657}
68658
68659void
68660TestJSImplInterfaceJSImpl::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68661{
68662 CallSetup s(this, aRv, "TestJSImplInterface.dontEnforceRangeOrClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68663 if (aRv.Failed()) {
68664 return;
68665 }
68666 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68666); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68666); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68667 BindingCallContext& cx = s.GetCallContext();
68668
68669 JS::Rooted<JS::Value> rval(cx);
68670 JS::RootedVector<JS::Value> argv(cx);
68671 if (!argv.resize(1)) {
68672 // That threw an exception on the JSContext, and our CallSetup will do
68673 // the right thing with that.
68674 return;
68675 }
68676 unsigned argc = 1;
68677
68678 do {
68679 argv[0].setInt32(int32_t(arg));
68680 break;
68681 } while (false);
68682
68683 JS::Rooted<JS::Value> callable(cx);
68684 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68685 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68686 !InitIds(cx, atomsCache)) ||
68687 !GetCallableProperty(cx, atomsCache->dontEnforceRangeOrClamp_id, &callable)) {
68688 aRv.Throw(NS_ERROR_UNEXPECTED);
68689 return;
68690 }
68691 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68692 if (!JS::Call(cx, thisValue, callable,
68693 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68694 aRv.NoteJSContextException(cx);
68695 return;
68696 }
68697}
68698
68699void
68700TestJSImplInterfaceJSImpl::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68701{
68702 CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRange", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68703 if (aRv.Failed()) {
68704 return;
68705 }
68706 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68706); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68706); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68707 BindingCallContext& cx = s.GetCallContext();
68708
68709 JS::Rooted<JS::Value> rval(cx);
68710 JS::RootedVector<JS::Value> argv(cx);
68711 if (!argv.resize(1)) {
68712 // That threw an exception on the JSContext, and our CallSetup will do
68713 // the right thing with that.
68714 return;
68715 }
68716 unsigned argc = 1;
68717
68718 do {
68719 argv[0].setInt32(int32_t(arg));
68720 break;
68721 } while (false);
68722
68723 JS::Rooted<JS::Value> callable(cx);
68724 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68725 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68726 !InitIds(cx, atomsCache)) ||
68727 !GetCallableProperty(cx, atomsCache->doEnforceRange_id, &callable)) {
68728 aRv.Throw(NS_ERROR_UNEXPECTED);
68729 return;
68730 }
68731 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68732 if (!JS::Call(cx, thisValue, callable,
68733 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68734 aRv.NoteJSContextException(cx);
68735 return;
68736 }
68737}
68738
68739void
68740TestJSImplInterfaceJSImpl::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68741{
68742 CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRangeNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68743 if (aRv.Failed()) {
68744 return;
68745 }
68746 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68746); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68746); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68747 BindingCallContext& cx = s.GetCallContext();
68748
68749 JS::Rooted<JS::Value> rval(cx);
68750 JS::RootedVector<JS::Value> argv(cx);
68751 if (!argv.resize(1)) {
68752 // That threw an exception on the JSContext, and our CallSetup will do
68753 // the right thing with that.
68754 return;
68755 }
68756 unsigned argc = 1;
68757
68758 do {
68759 if (arg.IsNull()) {
68760 argv[0].setNull();
68761 break;
68762 }
68763 argv[0].setInt32(int32_t(arg.Value()));
68764 break;
68765 } while (false);
68766
68767 JS::Rooted<JS::Value> callable(cx);
68768 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68769 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68770 !InitIds(cx, atomsCache)) ||
68771 !GetCallableProperty(cx, atomsCache->doEnforceRangeNullable_id, &callable)) {
68772 aRv.Throw(NS_ERROR_UNEXPECTED);
68773 return;
68774 }
68775 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68776 if (!JS::Call(cx, thisValue, callable,
68777 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68778 aRv.NoteJSContextException(cx);
68779 return;
68780 }
68781}
68782
68783void
68784TestJSImplInterfaceJSImpl::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68785{
68786 CallSetup s(this, aRv, "TestJSImplInterface.doClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68787 if (aRv.Failed()) {
68788 return;
68789 }
68790 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68790); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68790); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68791 BindingCallContext& cx = s.GetCallContext();
68792
68793 JS::Rooted<JS::Value> rval(cx);
68794 JS::RootedVector<JS::Value> argv(cx);
68795 if (!argv.resize(1)) {
68796 // That threw an exception on the JSContext, and our CallSetup will do
68797 // the right thing with that.
68798 return;
68799 }
68800 unsigned argc = 1;
68801
68802 do {
68803 argv[0].setInt32(int32_t(arg));
68804 break;
68805 } while (false);
68806
68807 JS::Rooted<JS::Value> callable(cx);
68808 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68809 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68810 !InitIds(cx, atomsCache)) ||
68811 !GetCallableProperty(cx, atomsCache->doClamp_id, &callable)) {
68812 aRv.Throw(NS_ERROR_UNEXPECTED);
68813 return;
68814 }
68815 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68816 if (!JS::Call(cx, thisValue, callable,
68817 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68818 aRv.NoteJSContextException(cx);
68819 return;
68820 }
68821}
68822
68823void
68824TestJSImplInterfaceJSImpl::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68825{
68826 CallSetup s(this, aRv, "TestJSImplInterface.doClampNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68827 if (aRv.Failed()) {
68828 return;
68829 }
68830 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68830); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68831 BindingCallContext& cx = s.GetCallContext();
68832
68833 JS::Rooted<JS::Value> rval(cx);
68834 JS::RootedVector<JS::Value> argv(cx);
68835 if (!argv.resize(1)) {
68836 // That threw an exception on the JSContext, and our CallSetup will do
68837 // the right thing with that.
68838 return;
68839 }
68840 unsigned argc = 1;
68841
68842 do {
68843 if (arg.IsNull()) {
68844 argv[0].setNull();
68845 break;
68846 }
68847 argv[0].setInt32(int32_t(arg.Value()));
68848 break;
68849 } while (false);
68850
68851 JS::Rooted<JS::Value> callable(cx);
68852 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68853 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68854 !InitIds(cx, atomsCache)) ||
68855 !GetCallableProperty(cx, atomsCache->doClampNullable_id, &callable)) {
68856 aRv.Throw(NS_ERROR_UNEXPECTED);
68857 return;
68858 }
68859 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68860 if (!JS::Call(cx, thisValue, callable,
68861 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68862 aRv.NoteJSContextException(cx);
68863 return;
68864 }
68865}
68866
68867void
68868TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
68869{
68870 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68871 if (aRv.Failed()) {
68872 return;
68873 }
68874 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68874); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68875 BindingCallContext& cx = s.GetCallContext();
68876
68877 JS::Rooted<JS::Value> rval(cx);
68878 JS::RootedVector<JS::Value> argv(cx);
68879 if (!argv.resize(1)) {
68880 // That threw an exception on the JSContext, and our CallSetup will do
68881 // the right thing with that.
68882 return;
68883 }
68884 unsigned argc = 1;
68885
68886 do {
68887 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
68888 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 68888); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 68888); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68889 aRv.Throw(NS_ERROR_UNEXPECTED);
68890 return;
68891 }
68892 break;
68893 } while (false);
68894
68895 JS::Rooted<JS::Value> callable(cx);
68896 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68897 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68898 !InitIds(cx, atomsCache)) ||
68899 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces1_id, &callable)) {
68900 aRv.Throw(NS_ERROR_UNEXPECTED);
68901 return;
68902 }
68903 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68904 if (!JS::Call(cx, thisValue, callable,
68905 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68906 aRv.NoteJSContextException(cx);
68907 return;
68908 }
68909}
68910
68911already_AddRefed<TestJSImplInterface>
68912TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
68913{
68914 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68915 if (aRv.Failed()) {
68916 return nullptr;
68917 }
68918 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68918); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 68918); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68919 BindingCallContext& cx = s.GetCallContext();
68920
68921 JS::Rooted<JS::Value> rval(cx);
68922 JS::RootedVector<JS::Value> argv(cx);
68923 if (!argv.resize(1)) {
68924 // That threw an exception on the JSContext, and our CallSetup will do
68925 // the right thing with that.
68926 return nullptr;
68927 }
68928 unsigned argc = 1;
68929
68930 do {
68931 if (!arg) {
68932 argv[0].setNull();
68933 break;
68934 }
68935 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
68936 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 68936); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 68936); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
68937 aRv.Throw(NS_ERROR_UNEXPECTED);
68938 return nullptr;
68939 }
68940 break;
68941 } while (false);
68942
68943 JS::Rooted<JS::Value> callable(cx);
68944 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68945 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68946 !InitIds(cx, atomsCache)) ||
68947 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces2_id, &callable)) {
68948 aRv.Throw(NS_ERROR_UNEXPECTED);
68949 return nullptr;
68950 }
68951 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68952 if (!JS::Call(cx, thisValue, callable,
68953 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68954 aRv.NoteJSContextException(cx);
68955 return nullptr;
68956 }
68957 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
68958 if (rval.isObject()) {
68959 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
68960 {
68961 // Our JSContext should be in the right global to do unwrapping in.
68962 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
68963 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
68964 // Be careful to not wrap random DOM objects here, even if
68965 // they're wrapped in opaque security wrappers for some reason.
68966 // XXXbz Wish we could check for a JS-implemented object
68967 // that already has a content reflection...
68968 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
68969 nsCOMPtr<nsIGlobalObject> contentGlobal;
68970 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
68971 if (!callback ||
68972 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
68973 aRv.Throw(NS_ERROR_UNEXPECTED);
68974 return nullptr;
68975 }
68976 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
68977 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", 68978); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 68978); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
68978 "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", 68978); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 68978); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
68979 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
68980 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
68981 } else {
68982 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2", "TestJSImplInterface");
68983 aRv.Throw(NS_ERROR_UNEXPECTED);
68984 return nullptr;
68985 }
68986 }
68987 }
68988 } else {
68989 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2");
68990 aRv.Throw(NS_ERROR_UNEXPECTED);
68991 return nullptr;
68992 }
68993 return rvalDecl.forget();
68994}
68995
68996void
68997TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
68998{
68999 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69000 if (aRv.Failed()) {
69001 return;
69002 }
69003 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69003); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69003); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69004 BindingCallContext& cx = s.GetCallContext();
69005
69006 JS::Rooted<JS::Value> rval(cx);
69007 JS::RootedVector<JS::Value> argv(cx);
69008 if (!argv.resize(1)) {
69009 // That threw an exception on the JSContext, and our CallSetup will do
69010 // the right thing with that.
69011 return;
69012 }
69013 unsigned argc = 1;
69014
69015 do {
69016 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69017 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69017); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69017); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69018 aRv.Throw(NS_ERROR_UNEXPECTED);
69019 return;
69020 }
69021 break;
69022 } while (false);
69023
69024 JS::Rooted<JS::Value> callable(cx);
69025 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69026 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69027 !InitIds(cx, atomsCache)) ||
69028 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces3_id, &callable)) {
69029 aRv.Throw(NS_ERROR_UNEXPECTED);
69030 return;
69031 }
69032 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69033 if (!JS::Call(cx, thisValue, callable,
69034 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69035 aRv.NoteJSContextException(cx);
69036 return;
69037 }
69038}
69039
69040int8_t
69041TestJSImplInterfaceJSImpl::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm)
69042{
69043 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69044 if (aRv.Failed()) {
69045 return int8_t(0);
69046 }
69047 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69047); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69047); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69048 BindingCallContext& cx = s.GetCallContext();
69049
69050 JS::Rooted<JS::Value> rval(cx);
69051
69052 JS::Rooted<JS::Value> callable(cx);
69053 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69054 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69055 !InitIds(cx, atomsCache)) ||
69056 !GetCallableProperty(cx, atomsCache->deprecatedMethod_id, &callable)) {
69057 aRv.Throw(NS_ERROR_UNEXPECTED);
69058 return int8_t(0);
69059 }
69060 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69061 if (!JS::Call(cx, thisValue, callable,
69062 JS::HandleValueArray::empty(), &rval)) {
69063 aRv.NoteJSContextException(cx);
69064 return int8_t(0);
69065 }
69066 int8_t rvalDecl;
69067 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedMethod", &rvalDecl)) {
69068 aRv.Throw(NS_ERROR_UNEXPECTED);
69069 return int8_t(0);
69070 }
69071 return rvalDecl;
69072}
69073
69074void
69075TestJSImplInterfaceJSImpl::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
69076{
69077 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethodWithContext", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69078 if (aRv.Failed()) {
69079 return;
69080 }
69081 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69081); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69081); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69082 BindingCallContext& cx = s.GetCallContext();
69083
69084 JS::Rooted<JS::Value> rval(cx);
69085 JS::RootedVector<JS::Value> argv(cx);
69086 if (!argv.resize(1)) {
69087 // That threw an exception on the JSContext, and our CallSetup will do
69088 // the right thing with that.
69089 return;
69090 }
69091 unsigned argc = 1;
69092
69093 do {
69094 JS::ExposeValueToActiveJS(arg);
69095 argv[0].set(arg);
69096 if (!MaybeWrapValue(cx, argv[0])) {
69097 aRv.Throw(NS_ERROR_UNEXPECTED);
69098 return;
69099 }
69100 break;
69101 } while (false);
69102
69103 JS::Rooted<JS::Value> callable(cx);
69104 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69105 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69106 !InitIds(cx, atomsCache)) ||
69107 !GetCallableProperty(cx, atomsCache->deprecatedMethodWithContext_id, &callable)) {
69108 aRv.Throw(NS_ERROR_UNEXPECTED);
69109 return;
69110 }
69111 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69112 if (!JS::Call(cx, thisValue, callable,
69113 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69114 aRv.NoteJSContextException(cx);
69115 return;
69116 }
69117}
69118
69119bool
69120TestJSImplInterfaceJSImpl::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69121{
69122 CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69123 if (aRv.Failed()) {
69124 return bool(0);
69125 }
69126 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69126); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69126); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69127 BindingCallContext& cx = s.GetCallContext();
69128
69129 JS::Rooted<JS::Value> rval(cx);
69130 JS::RootedVector<JS::Value> argv(cx);
69131 if (!argv.resize(1)) {
69132 // That threw an exception on the JSContext, and our CallSetup will do
69133 // the right thing with that.
69134 return bool(0);
69135 }
69136 unsigned argc = 1;
69137
69138 do {
69139 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69140 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69140); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69141 aRv.Throw(NS_ERROR_UNEXPECTED);
69142 return bool(0);
69143 }
69144 break;
69145 } while (false);
69146
69147 JS::Rooted<JS::Value> callable(cx);
69148 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69149 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69150 !InitIds(cx, atomsCache)) ||
69151 !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) {
69152 aRv.Throw(NS_ERROR_UNEXPECTED);
69153 return bool(0);
69154 }
69155 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69156 if (!JS::Call(cx, thisValue, callable,
69157 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69158 aRv.NoteJSContextException(cx);
69159 return bool(0);
69160 }
69161 bool rvalDecl;
69162 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.overload1", &rvalDecl)) {
69163 aRv.Throw(NS_ERROR_UNEXPECTED);
69164 return bool(0);
69165 }
69166 return rvalDecl;
69167}
69168
69169already_AddRefed<TestJSImplInterface>
69170TestJSImplInterfaceJSImpl::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69171{
69172 CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69173 if (aRv.Failed()) {
69174 return nullptr;
69175 }
69176 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69176); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69177 BindingCallContext& cx = s.GetCallContext();
69178
69179 JS::Rooted<JS::Value> rval(cx);
69180 JS::RootedVector<JS::Value> argv(cx);
69181 if (!argv.resize(2)) {
69182 // That threw an exception on the JSContext, and our CallSetup will do
69183 // the right thing with that.
69184 return nullptr;
69185 }
69186 unsigned argc = 2;
69187
69188 do {
69189 if (!GetOrCreateDOMReflector(cx, arg, argv[1])) {
69190 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69190); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69191 aRv.Throw(NS_ERROR_UNEXPECTED);
69192 return nullptr;
69193 }
69194 break;
69195 } while (false);
69196
69197 do {
69198 if (!xpc::NonVoidStringToJsval(cx, strs, argv[0])) {
69199 aRv.Throw(NS_ERROR_UNEXPECTED);
69200 return nullptr;
69201 }
69202 break;
69203 } while (false);
69204
69205 JS::Rooted<JS::Value> callable(cx);
69206 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69207 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69208 !InitIds(cx, atomsCache)) ||
69209 !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) {
69210 aRv.Throw(NS_ERROR_UNEXPECTED);
69211 return nullptr;
69212 }
69213 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69214 if (!JS::Call(cx, thisValue, callable,
69215 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69216 aRv.NoteJSContextException(cx);
69217 return nullptr;
69218 }
69219 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
69220 if (rval.isObject()) {
69221 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
69222 {
69223 // Our JSContext should be in the right global to do unwrapping in.
69224 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
69225 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
69226 // Be careful to not wrap random DOM objects here, even if
69227 // they're wrapped in opaque security wrappers for some reason.
69228 // XXXbz Wish we could check for a JS-implemented object
69229 // that already has a content reflection...
69230 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
69231 nsCOMPtr<nsIGlobalObject> contentGlobal;
69232 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
69233 if (!callback ||
69234 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
69235 aRv.Throw(NS_ERROR_UNEXPECTED);
69236 return nullptr;
69237 }
69238 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
69239 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", 69240); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 69240); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
69240 "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", 69240); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 69240); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
69241 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
69242 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
69243 } else {
69244 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.overload1", "TestJSImplInterface");
69245 aRv.Throw(NS_ERROR_UNEXPECTED);
69246 return nullptr;
69247 }
69248 }
69249 }
69250 } else {
69251 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.overload1");
69252 aRv.Throw(NS_ERROR_UNEXPECTED);
69253 return nullptr;
69254 }
69255 return rvalDecl.forget();
69256}
69257
69258void
69259TestJSImplInterfaceJSImpl::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69260{
69261 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69262 if (aRv.Failed()) {
69263 return;
69264 }
69265 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69265); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69265); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69266 BindingCallContext& cx = s.GetCallContext();
69267
69268 JS::Rooted<JS::Value> rval(cx);
69269 JS::RootedVector<JS::Value> argv(cx);
69270 if (!argv.resize(1)) {
69271 // That threw an exception on the JSContext, and our CallSetup will do
69272 // the right thing with that.
69273 return;
69274 }
69275 unsigned argc = 1;
69276
69277 do {
69278 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69279 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69279); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69279); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69280 aRv.Throw(NS_ERROR_UNEXPECTED);
69281 return;
69282 }
69283 break;
69284 } while (false);
69285
69286 JS::Rooted<JS::Value> callable(cx);
69287 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69288 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69289 !InitIds(cx, atomsCache)) ||
69290 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69291 aRv.Throw(NS_ERROR_UNEXPECTED);
69292 return;
69293 }
69294 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69295 if (!JS::Call(cx, thisValue, callable,
69296 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69297 aRv.NoteJSContextException(cx);
69298 return;
69299 }
69300}
69301
69302void
69303TestJSImplInterfaceJSImpl::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
69304{
69305 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69306 if (aRv.Failed()) {
69307 return;
69308 }
69309 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69309); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69310 BindingCallContext& cx = s.GetCallContext();
69311
69312 JS::Rooted<JS::Value> rval(cx);
69313 JS::RootedVector<JS::Value> argv(cx);
69314 if (!argv.resize(1)) {
69315 // That threw an exception on the JSContext, and our CallSetup will do
69316 // the right thing with that.
69317 return;
69318 }
69319 unsigned argc = 1;
69320
69321 do {
69322 if (!arg.ToObjectInternal(cx, argv[0])) {
69323 aRv.Throw(NS_ERROR_UNEXPECTED);
69324 return;
69325 }
69326 break;
69327 } while (false);
69328
69329 JS::Rooted<JS::Value> callable(cx);
69330 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69331 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69332 !InitIds(cx, atomsCache)) ||
69333 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69334 aRv.Throw(NS_ERROR_UNEXPECTED);
69335 return;
69336 }
69337 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69338 if (!JS::Call(cx, thisValue, callable,
69339 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69340 aRv.NoteJSContextException(cx);
69341 return;
69342 }
69343}
69344
69345void
69346TestJSImplInterfaceJSImpl::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69347{
69348 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69349 if (aRv.Failed()) {
69350 return;
69351 }
69352 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69352); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69352); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69353 BindingCallContext& cx = s.GetCallContext();
69354
69355 JS::Rooted<JS::Value> rval(cx);
69356 JS::RootedVector<JS::Value> argv(cx);
69357 if (!argv.resize(1)) {
69358 // That threw an exception on the JSContext, and our CallSetup will do
69359 // the right thing with that.
69360 return;
69361 }
69362 unsigned argc = 1;
69363
69364 do {
69365 argv[0].setBoolean(arg);
69366 break;
69367 } while (false);
69368
69369 JS::Rooted<JS::Value> callable(cx);
69370 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69371 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69372 !InitIds(cx, atomsCache)) ||
69373 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69374 aRv.Throw(NS_ERROR_UNEXPECTED);
69375 return;
69376 }
69377 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69378 if (!JS::Call(cx, thisValue, callable,
69379 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69380 aRv.NoteJSContextException(cx);
69381 return;
69382 }
69383}
69384
69385void
69386TestJSImplInterfaceJSImpl::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69387{
69388 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69389 if (aRv.Failed()) {
69390 return;
69391 }
69392 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69392); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69392); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69393 BindingCallContext& cx = s.GetCallContext();
69394
69395 JS::Rooted<JS::Value> rval(cx);
69396 JS::RootedVector<JS::Value> argv(cx);
69397 if (!argv.resize(1)) {
69398 // That threw an exception on the JSContext, and our CallSetup will do
69399 // the right thing with that.
69400 return;
69401 }
69402 unsigned argc = 1;
69403
69404 do {
69405 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
69406 aRv.Throw(NS_ERROR_UNEXPECTED);
69407 return;
69408 }
69409 break;
69410 } while (false);
69411
69412 JS::Rooted<JS::Value> callable(cx);
69413 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69414 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69415 !InitIds(cx, atomsCache)) ||
69416 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69417 aRv.Throw(NS_ERROR_UNEXPECTED);
69418 return;
69419 }
69420 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69421 if (!JS::Call(cx, thisValue, callable,
69422 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69423 aRv.NoteJSContextException(cx);
69424 return;
69425 }
69426}
69427
69428void
69429TestJSImplInterfaceJSImpl::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69430{
69431 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69432 if (aRv.Failed()) {
69433 return;
69434 }
69435 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69435); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69435); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69436 BindingCallContext& cx = s.GetCallContext();
69437
69438 JS::Rooted<JS::Value> rval(cx);
69439 JS::RootedVector<JS::Value> argv(cx);
69440 if (!argv.resize(1)) {
69441 // That threw an exception on the JSContext, and our CallSetup will do
69442 // the right thing with that.
69443 return;
69444 }
69445 unsigned argc = 1;
69446
69447 do {
69448 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69449 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69449); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69449); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69450 aRv.Throw(NS_ERROR_UNEXPECTED);
69451 return;
69452 }
69453 break;
69454 } while (false);
69455
69456 JS::Rooted<JS::Value> callable(cx);
69457 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69458 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69459 !InitIds(cx, atomsCache)) ||
69460 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69461 aRv.Throw(NS_ERROR_UNEXPECTED);
69462 return;
69463 }
69464 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69465 if (!JS::Call(cx, thisValue, callable,
69466 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69467 aRv.NoteJSContextException(cx);
69468 return;
69469 }
69470}
69471
69472void
69473TestJSImplInterfaceJSImpl::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
69474{
69475 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69476 if (aRv.Failed()) {
69477 return;
69478 }
69479 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69479); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69479); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69480 BindingCallContext& cx = s.GetCallContext();
69481
69482 JS::Rooted<JS::Value> rval(cx);
69483 JS::RootedVector<JS::Value> argv(cx);
69484 if (!argv.resize(1)) {
69485 // That threw an exception on the JSContext, and our CallSetup will do
69486 // the right thing with that.
69487 return;
69488 }
69489 unsigned argc = 1;
69490
69491 do {
69492 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
69493 if (!MaybeWrapObjectValue(cx, argv[0])) {
69494 aRv.Throw(NS_ERROR_UNEXPECTED);
69495 return;
69496 }
69497 break;
69498 } while (false);
69499
69500 JS::Rooted<JS::Value> callable(cx);
69501 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69502 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69503 !InitIds(cx, atomsCache)) ||
69504 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69505 aRv.Throw(NS_ERROR_UNEXPECTED);
69506 return;
69507 }
69508 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69509 if (!JS::Call(cx, thisValue, callable,
69510 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69511 aRv.NoteJSContextException(cx);
69512 return;
69513 }
69514}
69515
69516void
69517TestJSImplInterfaceJSImpl::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69518{
69519 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69520 if (aRv.Failed()) {
69521 return;
69522 }
69523 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69523); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69524 BindingCallContext& cx = s.GetCallContext();
69525
69526 JS::Rooted<JS::Value> rval(cx);
69527 JS::RootedVector<JS::Value> argv(cx);
69528 if (!argv.resize(1)) {
69529 // That threw an exception on the JSContext, and our CallSetup will do
69530 // the right thing with that.
69531 return;
69532 }
69533 unsigned argc = 1;
69534
69535 do {
69536 argv[0].setBoolean(arg);
69537 break;
69538 } while (false);
69539
69540 JS::Rooted<JS::Value> callable(cx);
69541 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69542 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69543 !InitIds(cx, atomsCache)) ||
69544 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69545 aRv.Throw(NS_ERROR_UNEXPECTED);
69546 return;
69547 }
69548 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69549 if (!JS::Call(cx, thisValue, callable,
69550 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69551 aRv.NoteJSContextException(cx);
69552 return;
69553 }
69554}
69555
69556void
69557TestJSImplInterfaceJSImpl::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69558{
69559 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69560 if (aRv.Failed()) {
69561 return;
69562 }
69563 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69563); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69563); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69564 BindingCallContext& cx = s.GetCallContext();
69565
69566 JS::Rooted<JS::Value> rval(cx);
69567 JS::RootedVector<JS::Value> argv(cx);
69568 if (!argv.resize(1)) {
69569 // That threw an exception on the JSContext, and our CallSetup will do
69570 // the right thing with that.
69571 return;
69572 }
69573 unsigned argc = 1;
69574
69575 do {
69576 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69577 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69577); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 69577); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69578 aRv.Throw(NS_ERROR_UNEXPECTED);
69579 return;
69580 }
69581 break;
69582 } while (false);
69583
69584 JS::Rooted<JS::Value> callable(cx);
69585 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69586 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69587 !InitIds(cx, atomsCache)) ||
69588 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69589 aRv.Throw(NS_ERROR_UNEXPECTED);
69590 return;
69591 }
69592 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69593 if (!JS::Call(cx, thisValue, callable,
69594 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69595 aRv.NoteJSContextException(cx);
69596 return;
69597 }
69598}
69599
69600void
69601TestJSImplInterfaceJSImpl::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69602{
69603 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69604 if (aRv.Failed()) {
69605 return;
69606 }
69607 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69607); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69608 BindingCallContext& cx = s.GetCallContext();
69609
69610 JS::Rooted<JS::Value> rval(cx);
69611 JS::RootedVector<JS::Value> argv(cx);
69612 if (!argv.resize(1)) {
69613 // That threw an exception on the JSContext, and our CallSetup will do
69614 // the right thing with that.
69615 return;
69616 }
69617 unsigned argc = 1;
69618
69619 do {
69620 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
69621 if (!MaybeWrapObjectValue(cx, argv[0])) {
69622 aRv.Throw(NS_ERROR_UNEXPECTED);
69623 return;
69624 }
69625 break;
69626 } while (false);
69627
69628 JS::Rooted<JS::Value> callable(cx);
69629 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69630 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69631 !InitIds(cx, atomsCache)) ||
69632 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69633 aRv.Throw(NS_ERROR_UNEXPECTED);
69634 return;
69635 }
69636 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69637 if (!JS::Call(cx, thisValue, callable,
69638 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69639 aRv.NoteJSContextException(cx);
69640 return;
69641 }
69642}
69643
69644void
69645TestJSImplInterfaceJSImpl::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69646{
69647 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69648 if (aRv.Failed()) {
69649 return;
69650 }
69651 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69651); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69652 BindingCallContext& cx = s.GetCallContext();
69653
69654 JS::Rooted<JS::Value> rval(cx);
69655 JS::RootedVector<JS::Value> argv(cx);
69656 if (!argv.resize(1)) {
69657 // That threw an exception on the JSContext, and our CallSetup will do
69658 // the right thing with that.
69659 return;
69660 }
69661 unsigned argc = 1;
69662
69663 do {
69664 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
69665 aRv.Throw(NS_ERROR_UNEXPECTED);
69666 return;
69667 }
69668 break;
69669 } while (false);
69670
69671 JS::Rooted<JS::Value> callable(cx);
69672 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69673 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69674 !InitIds(cx, atomsCache)) ||
69675 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69676 aRv.Throw(NS_ERROR_UNEXPECTED);
69677 return;
69678 }
69679 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69680 if (!JS::Call(cx, thisValue, callable,
69681 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69682 aRv.NoteJSContextException(cx);
69683 return;
69684 }
69685}
69686
69687void
69688TestJSImplInterfaceJSImpl::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69689{
69690 CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69691 if (aRv.Failed()) {
69692 return;
69693 }
69694 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69694); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69695 BindingCallContext& cx = s.GetCallContext();
69696
69697 JS::Rooted<JS::Value> rval(cx);
69698 JS::RootedVector<JS::Value> argv(cx);
69699 if (!argv.resize(1)) {
69700 // That threw an exception on the JSContext, and our CallSetup will do
69701 // the right thing with that.
69702 return;
69703 }
69704 unsigned argc = 1;
69705
69706 do {
69707 argv[0].setInt32(int32_t(arg));
69708 break;
69709 } while (false);
69710
69711 JS::Rooted<JS::Value> callable(cx);
69712 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69713 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69714 !InitIds(cx, atomsCache)) ||
69715 !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) {
69716 aRv.Throw(NS_ERROR_UNEXPECTED);
69717 return;
69718 }
69719 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69720 if (!JS::Call(cx, thisValue, callable,
69721 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69722 aRv.NoteJSContextException(cx);
69723 return;
69724 }
69725}
69726
69727void
69728TestJSImplInterfaceJSImpl::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
69729{
69730 CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69731 if (aRv.Failed()) {
69732 return;
69733 }
69734 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69734); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69735 BindingCallContext& cx = s.GetCallContext();
69736
69737 JS::Rooted<JS::Value> rval(cx);
69738 JS::RootedVector<JS::Value> argv(cx);
69739 if (!argv.resize(1)) {
69740 // That threw an exception on the JSContext, and our CallSetup will do
69741 // the right thing with that.
69742 return;
69743 }
69744 unsigned argc = 1;
69745
69746 do {
69747 if (!ToJSValue(cx, arg, argv[0])) {
69748 aRv.Throw(NS_ERROR_UNEXPECTED);
69749 return;
69750 }
69751 break;
69752 } while (false);
69753
69754 JS::Rooted<JS::Value> callable(cx);
69755 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69756 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69757 !InitIds(cx, atomsCache)) ||
69758 !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) {
69759 aRv.Throw(NS_ERROR_UNEXPECTED);
69760 return;
69761 }
69762 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69763 if (!JS::Call(cx, thisValue, callable,
69764 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69765 aRv.NoteJSContextException(cx);
69766 return;
69767 }
69768}
69769
69770void
69771TestJSImplInterfaceJSImpl::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69772{
69773 CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69774 if (aRv.Failed()) {
69775 return;
69776 }
69777 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69777); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69777); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69778 BindingCallContext& cx = s.GetCallContext();
69779
69780 JS::Rooted<JS::Value> rval(cx);
69781 JS::RootedVector<JS::Value> argv(cx);
69782 if (!argv.resize(1)) {
69783 // That threw an exception on the JSContext, and our CallSetup will do
69784 // the right thing with that.
69785 return;
69786 }
69787 unsigned argc = 1;
69788
69789 do {
69790 argv[0].setInt32(int32_t(arg));
69791 break;
69792 } while (false);
69793
69794 JS::Rooted<JS::Value> callable(cx);
69795 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69796 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69797 !InitIds(cx, atomsCache)) ||
69798 !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) {
69799 aRv.Throw(NS_ERROR_UNEXPECTED);
69800 return;
69801 }
69802 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69803 if (!JS::Call(cx, thisValue, callable,
69804 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69805 aRv.NoteJSContextException(cx);
69806 return;
69807 }
69808}
69809
69810void
69811TestJSImplInterfaceJSImpl::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69812{
69813 CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69814 if (aRv.Failed()) {
69815 return;
69816 }
69817 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69817); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69817); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69818 BindingCallContext& cx = s.GetCallContext();
69819
69820 JS::Rooted<JS::Value> rval(cx);
69821 JS::RootedVector<JS::Value> argv(cx);
69822 if (!argv.resize(1)) {
69823 // That threw an exception on the JSContext, and our CallSetup will do
69824 // the right thing with that.
69825 return;
69826 }
69827 unsigned argc = 1;
69828
69829 do {
69830 argv[0].setBoolean(arg);
69831 break;
69832 } while (false);
69833
69834 JS::Rooted<JS::Value> callable(cx);
69835 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69836 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69837 !InitIds(cx, atomsCache)) ||
69838 !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) {
69839 aRv.Throw(NS_ERROR_UNEXPECTED);
69840 return;
69841 }
69842 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69843 if (!JS::Call(cx, thisValue, callable,
69844 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69845 aRv.NoteJSContextException(cx);
69846 return;
69847 }
69848}
69849
69850void
69851TestJSImplInterfaceJSImpl::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69852{
69853 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69854 if (aRv.Failed()) {
69855 return;
69856 }
69857 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69857); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69857); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69858 BindingCallContext& cx = s.GetCallContext();
69859
69860 JS::Rooted<JS::Value> rval(cx);
69861 JS::RootedVector<JS::Value> argv(cx);
69862 if (!argv.resize(1)) {
69863 // That threw an exception on the JSContext, and our CallSetup will do
69864 // the right thing with that.
69865 return;
69866 }
69867 unsigned argc = 1;
69868
69869 do {
69870 argv[0].setInt32(int32_t(arg));
69871 break;
69872 } while (false);
69873
69874 JS::Rooted<JS::Value> callable(cx);
69875 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69876 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69877 !InitIds(cx, atomsCache)) ||
69878 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69879 aRv.Throw(NS_ERROR_UNEXPECTED);
69880 return;
69881 }
69882 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69883 if (!JS::Call(cx, thisValue, callable,
69884 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69885 aRv.NoteJSContextException(cx);
69886 return;
69887 }
69888}
69889
69890void
69891TestJSImplInterfaceJSImpl::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69892{
69893 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69894 if (aRv.Failed()) {
69895 return;
69896 }
69897 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69897); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69897); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69898 BindingCallContext& cx = s.GetCallContext();
69899
69900 JS::Rooted<JS::Value> rval(cx);
69901 JS::RootedVector<JS::Value> argv(cx);
69902 if (!argv.resize(1)) {
69903 // That threw an exception on the JSContext, and our CallSetup will do
69904 // the right thing with that.
69905 return;
69906 }
69907 unsigned argc = 1;
69908
69909 do {
69910 argv[0].setBoolean(arg);
69911 break;
69912 } while (false);
69913
69914 JS::Rooted<JS::Value> callable(cx);
69915 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69916 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69917 !InitIds(cx, atomsCache)) ||
69918 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69919 aRv.Throw(NS_ERROR_UNEXPECTED);
69920 return;
69921 }
69922 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69923 if (!JS::Call(cx, thisValue, callable,
69924 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69925 aRv.NoteJSContextException(cx);
69926 return;
69927 }
69928}
69929
69930void
69931TestJSImplInterfaceJSImpl::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69932{
69933 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69934 if (aRv.Failed()) {
69935 return;
69936 }
69937 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69937); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69937); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69938 BindingCallContext& cx = s.GetCallContext();
69939
69940 JS::Rooted<JS::Value> rval(cx);
69941 JS::RootedVector<JS::Value> argv(cx);
69942 if (!argv.resize(1)) {
69943 // That threw an exception on the JSContext, and our CallSetup will do
69944 // the right thing with that.
69945 return;
69946 }
69947 unsigned argc = 1;
69948
69949 do {
69950 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
69951 aRv.Throw(NS_ERROR_UNEXPECTED);
69952 return;
69953 }
69954 break;
69955 } while (false);
69956
69957 JS::Rooted<JS::Value> callable(cx);
69958 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69959 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69960 !InitIds(cx, atomsCache)) ||
69961 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69962 aRv.Throw(NS_ERROR_UNEXPECTED);
69963 return;
69964 }
69965 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69966 if (!JS::Call(cx, thisValue, callable,
69967 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69968 aRv.NoteJSContextException(cx);
69969 return;
69970 }
69971}
69972
69973void
69974TestJSImplInterfaceJSImpl::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69975{
69976 CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69977 if (aRv.Failed()) {
69978 return;
69979 }
69980 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69980); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 69980); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
69981 BindingCallContext& cx = s.GetCallContext();
69982
69983 JS::Rooted<JS::Value> rval(cx);
69984 JS::RootedVector<JS::Value> argv(cx);
69985 if (!argv.resize(1)) {
69986 // That threw an exception on the JSContext, and our CallSetup will do
69987 // the right thing with that.
69988 return;
69989 }
69990 unsigned argc = 1;
69991
69992 do {
69993 argv[0].setInt32(int32_t(arg));
69994 break;
69995 } while (false);
69996
69997 JS::Rooted<JS::Value> callable(cx);
69998 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69999 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70000 !InitIds(cx, atomsCache)) ||
70001 !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) {
70002 aRv.Throw(NS_ERROR_UNEXPECTED);
70003 return;
70004 }
70005 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70006 if (!JS::Call(cx, thisValue, callable,
70007 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70008 aRv.NoteJSContextException(cx);
70009 return;
70010 }
70011}
70012
70013void
70014TestJSImplInterfaceJSImpl::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
70015{
70016 CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70017 if (aRv.Failed()) {
70018 return;
70019 }
70020 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70020); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70020); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70021 BindingCallContext& cx = s.GetCallContext();
70022
70023 JS::Rooted<JS::Value> rval(cx);
70024 JS::RootedVector<JS::Value> argv(cx);
70025 if (!argv.resize(1)) {
70026 // That threw an exception on the JSContext, and our CallSetup will do
70027 // the right thing with that.
70028 return;
70029 }
70030 unsigned argc = 1;
70031
70032 do {
70033 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
70034 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70034); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 70034); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70035 aRv.Throw(NS_ERROR_UNEXPECTED);
70036 return;
70037 }
70038 break;
70039 } while (false);
70040
70041 JS::Rooted<JS::Value> callable(cx);
70042 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70043 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70044 !InitIds(cx, atomsCache)) ||
70045 !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) {
70046 aRv.Throw(NS_ERROR_UNEXPECTED);
70047 return;
70048 }
70049 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70050 if (!JS::Call(cx, thisValue, callable,
70051 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70052 aRv.NoteJSContextException(cx);
70053 return;
70054 }
70055}
70056
70057void
70058TestJSImplInterfaceJSImpl::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70059{
70060 CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70061 if (aRv.Failed()) {
70062 return;
70063 }
70064 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70064); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70065 BindingCallContext& cx = s.GetCallContext();
70066
70067 JS::Rooted<JS::Value> rval(cx);
70068 JS::RootedVector<JS::Value> argv(cx);
70069 if (!argv.resize(1)) {
70070 // That threw an exception on the JSContext, and our CallSetup will do
70071 // the right thing with that.
70072 return;
70073 }
70074 unsigned argc = 1;
70075
70076 do {
70077 if (arg.IsNull()) {
70078 argv[0].setNull();
70079 break;
70080 }
70081 argv[0].setInt32(int32_t(arg.Value()));
70082 break;
70083 } while (false);
70084
70085 JS::Rooted<JS::Value> callable(cx);
70086 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70087 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70088 !InitIds(cx, atomsCache)) ||
70089 !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) {
70090 aRv.Throw(NS_ERROR_UNEXPECTED);
70091 return;
70092 }
70093 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70094 if (!JS::Call(cx, thisValue, callable,
70095 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70096 aRv.NoteJSContextException(cx);
70097 return;
70098 }
70099}
70100
70101void
70102TestJSImplInterfaceJSImpl::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
70103{
70104 CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70105 if (aRv.Failed()) {
70106 return;
70107 }
70108 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70108); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70108); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70109 BindingCallContext& cx = s.GetCallContext();
70110
70111 JS::Rooted<JS::Value> rval(cx);
70112 JS::RootedVector<JS::Value> argv(cx);
70113 if (!argv.resize(1)) {
70114 // That threw an exception on the JSContext, and our CallSetup will do
70115 // the right thing with that.
70116 return;
70117 }
70118 unsigned argc = 1;
70119
70120 do {
70121 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
70122 aRv.Throw(NS_ERROR_UNEXPECTED);
70123 return;
70124 }
70125 break;
70126 } while (false);
70127
70128 JS::Rooted<JS::Value> callable(cx);
70129 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70130 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70131 !InitIds(cx, atomsCache)) ||
70132 !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) {
70133 aRv.Throw(NS_ERROR_UNEXPECTED);
70134 return;
70135 }
70136 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70137 if (!JS::Call(cx, thisValue, callable,
70138 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70139 aRv.NoteJSContextException(cx);
70140 return;
70141 }
70142}
70143
70144void
70145TestJSImplInterfaceJSImpl::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70146{
70147 CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70148 if (aRv.Failed()) {
70149 return;
70150 }
70151 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70151); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70151); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70152 BindingCallContext& cx = s.GetCallContext();
70153
70154 JS::Rooted<JS::Value> rval(cx);
70155 JS::RootedVector<JS::Value> argv(cx);
70156 if (!argv.resize(1)) {
70157 // That threw an exception on the JSContext, and our CallSetup will do
70158 // the right thing with that.
70159 return;
70160 }
70161 unsigned argc = 1;
70162
70163 do {
70164 if (arg.IsNull()) {
70165 argv[0].setNull();
70166 break;
70167 }
70168 argv[0].setInt32(int32_t(arg.Value()));
70169 break;
70170 } while (false);
70171
70172 JS::Rooted<JS::Value> callable(cx);
70173 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70174 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70175 !InitIds(cx, atomsCache)) ||
70176 !GetCallableProperty(cx, atomsCache->overload10_id, &callable)) {
70177 aRv.Throw(NS_ERROR_UNEXPECTED);
70178 return;
70179 }
70180 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70181 if (!JS::Call(cx, thisValue, callable,
70182 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70183 aRv.NoteJSContextException(cx);
70184 return;
70185 }
70186}
70187
70188void
70189TestJSImplInterfaceJSImpl::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
70190{
70191 CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70192 if (aRv.Failed()) {
70193 return;
70194 }
70195 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70195); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70196 BindingCallContext& cx = s.GetCallContext();
70197
70198 JS::Rooted<JS::Value> rval(cx);
70199 JS::RootedVector<JS::Value> argv(cx);
70200 if (!argv.resize(1)) {
70201 // That threw an exception on the JSContext, and our CallSetup will do
70202 // the right thing with that.
70203 return;
70204 }
70205 unsigned argc = 1;
70206
70207 do {
70208 JS::ExposeObjectToActiveJS(arg);
70209 argv[0].setObject(*arg);
70210 if (!MaybeWrapObjectValue(cx, argv[0])) {
70211 aRv.Throw(NS_ERROR_UNEXPECTED);
70212 return;
70213 }
70214 break;
70215 } while (false);
70216
70217 JS::Rooted<JS::Value> callable(cx);
70218 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70219 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70220 !InitIds(cx, atomsCache)) ||
70221 !GetCallableProperty(cx, atomsCache->overload10_id, &callable)) {
70222 aRv.Throw(NS_ERROR_UNEXPECTED);
70223 return;
70224 }
70225 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70226 if (!JS::Call(cx, thisValue, callable,
70227 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70228 aRv.NoteJSContextException(cx);
70229 return;
70230 }
70231}
70232
70233void
70234TestJSImplInterfaceJSImpl::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70235{
70236 CallSetup s(this, aRv, "TestJSImplInterface.overload11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70237 if (aRv.Failed()) {
70238 return;
70239 }
70240 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70240); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70240); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70241 BindingCallContext& cx = s.GetCallContext();
70242
70243 JS::Rooted<JS::Value> rval(cx);
70244 JS::RootedVector<JS::Value> argv(cx);
70245 if (!argv.resize(1)) {
70246 // That threw an exception on the JSContext, and our CallSetup will do
70247 // the right thing with that.
70248 return;
70249 }
70250 unsigned argc = 1;
70251
70252 do {
70253 argv[0].setInt32(int32_t(arg));
70254 break;
70255 } while (false);
70256
70257 JS::Rooted<JS::Value> callable(cx);
70258 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70259 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70260 !InitIds(cx, atomsCache)) ||
70261 !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) {
70262 aRv.Throw(NS_ERROR_UNEXPECTED);
70263 return;
70264 }
70265 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70266 if (!JS::Call(cx, thisValue, callable,
70267 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70268 aRv.NoteJSContextException(cx);
70269 return;
70270 }
70271}
70272
70273void
70274TestJSImplInterfaceJSImpl::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
70275{
70276 CallSetup s(this, aRv, "TestJSImplInterface.overload11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70277 if (aRv.Failed()) {
70278 return;
70279 }
70280 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70280); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70280); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70281 BindingCallContext& cx = s.GetCallContext();
70282
70283 JS::Rooted<JS::Value> rval(cx);
70284 JS::RootedVector<JS::Value> argv(cx);
70285 if (!argv.resize(1)) {
70286 // That threw an exception on the JSContext, and our CallSetup will do
70287 // the right thing with that.
70288 return;
70289 }
70290 unsigned argc = 1;
70291
70292 do {
70293 if (!xpc::StringToJsval(cx, arg, argv[0])) {
70294 aRv.Throw(NS_ERROR_UNEXPECTED);
70295 return;
70296 }
70297 break;
70298 } while (false);
70299
70300 JS::Rooted<JS::Value> callable(cx);
70301 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70302 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70303 !InitIds(cx, atomsCache)) ||
70304 !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) {
70305 aRv.Throw(NS_ERROR_UNEXPECTED);
70306 return;
70307 }
70308 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70309 if (!JS::Call(cx, thisValue, callable,
70310 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70311 aRv.NoteJSContextException(cx);
70312 return;
70313 }
70314}
70315
70316void
70317TestJSImplInterfaceJSImpl::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70318{
70319 CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70320 if (aRv.Failed()) {
70321 return;
70322 }
70323 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70323); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70324 BindingCallContext& cx = s.GetCallContext();
70325
70326 JS::Rooted<JS::Value> rval(cx);
70327 JS::RootedVector<JS::Value> argv(cx);
70328 if (!argv.resize(1)) {
70329 // That threw an exception on the JSContext, and our CallSetup will do
70330 // the right thing with that.
70331 return;
70332 }
70333 unsigned argc = 1;
70334
70335 do {
70336 argv[0].setInt32(int32_t(arg));
70337 break;
70338 } while (false);
70339
70340 JS::Rooted<JS::Value> callable(cx);
70341 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70342 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70343 !InitIds(cx, atomsCache)) ||
70344 !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) {
70345 aRv.Throw(NS_ERROR_UNEXPECTED);
70346 return;
70347 }
70348 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70349 if (!JS::Call(cx, thisValue, callable,
70350 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70351 aRv.NoteJSContextException(cx);
70352 return;
70353 }
70354}
70355
70356void
70357TestJSImplInterfaceJSImpl::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70358{
70359 CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70360 if (aRv.Failed()) {
70361 return;
70362 }
70363 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70363); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70363); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70364 BindingCallContext& cx = s.GetCallContext();
70365
70366 JS::Rooted<JS::Value> rval(cx);
70367 JS::RootedVector<JS::Value> argv(cx);
70368 if (!argv.resize(1)) {
70369 // That threw an exception on the JSContext, and our CallSetup will do
70370 // the right thing with that.
70371 return;
70372 }
70373 unsigned argc = 1;
70374
70375 do {
70376 if (arg.IsNull()) {
70377 argv[0].setNull();
70378 break;
70379 }
70380 argv[0].setBoolean(arg.Value());
70381 break;
70382 } while (false);
70383
70384 JS::Rooted<JS::Value> callable(cx);
70385 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70386 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70387 !InitIds(cx, atomsCache)) ||
70388 !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) {
70389 aRv.Throw(NS_ERROR_UNEXPECTED);
70390 return;
70391 }
70392 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70393 if (!JS::Call(cx, thisValue, callable,
70394 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70395 aRv.NoteJSContextException(cx);
70396 return;
70397 }
70398}
70399
70400void
70401TestJSImplInterfaceJSImpl::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70402{
70403 CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70404 if (aRv.Failed()) {
70405 return;
70406 }
70407 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70407); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70407); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70408 BindingCallContext& cx = s.GetCallContext();
70409
70410 JS::Rooted<JS::Value> rval(cx);
70411 JS::RootedVector<JS::Value> argv(cx);
70412 if (!argv.resize(1)) {
70413 // That threw an exception on the JSContext, and our CallSetup will do
70414 // the right thing with that.
70415 return;
70416 }
70417 unsigned argc = 1;
70418
70419 do {
70420 if (arg.IsNull()) {
70421 argv[0].setNull();
70422 break;
70423 }
70424 argv[0].setInt32(int32_t(arg.Value()));
70425 break;
70426 } while (false);
70427
70428 JS::Rooted<JS::Value> callable(cx);
70429 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70430 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70431 !InitIds(cx, atomsCache)) ||
70432 !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) {
70433 aRv.Throw(NS_ERROR_UNEXPECTED);
70434 return;
70435 }
70436 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70437 if (!JS::Call(cx, thisValue, callable,
70438 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70439 aRv.NoteJSContextException(cx);
70440 return;
70441 }
70442}
70443
70444void
70445TestJSImplInterfaceJSImpl::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
70446{
70447 CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70448 if (aRv.Failed()) {
70449 return;
70450 }
70451 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70451); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70451); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70452 BindingCallContext& cx = s.GetCallContext();
70453
70454 JS::Rooted<JS::Value> rval(cx);
70455 JS::RootedVector<JS::Value> argv(cx);
70456 if (!argv.resize(1)) {
70457 // That threw an exception on the JSContext, and our CallSetup will do
70458 // the right thing with that.
70459 return;
70460 }
70461 unsigned argc = 1;
70462
70463 do {
70464 argv[0].setBoolean(arg);
70465 break;
70466 } while (false);
70467
70468 JS::Rooted<JS::Value> callable(cx);
70469 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70470 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70471 !InitIds(cx, atomsCache)) ||
70472 !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) {
70473 aRv.Throw(NS_ERROR_UNEXPECTED);
70474 return;
70475 }
70476 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70477 if (!JS::Call(cx, thisValue, callable,
70478 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70479 aRv.NoteJSContextException(cx);
70480 return;
70481 }
70482}
70483
70484void
70485TestJSImplInterfaceJSImpl::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70486{
70487 CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70488 if (aRv.Failed()) {
70489 return;
70490 }
70491 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70491); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70491); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70492 BindingCallContext& cx = s.GetCallContext();
70493
70494 JS::Rooted<JS::Value> rval(cx);
70495 JS::RootedVector<JS::Value> argv(cx);
70496 if (!argv.resize(1)) {
70497 // That threw an exception on the JSContext, and our CallSetup will do
70498 // the right thing with that.
70499 return;
70500 }
70501 unsigned argc = 1;
70502
70503 do {
70504 if (arg.WasPassed()) {
70505 argv[0].setInt32(int32_t(arg.Value()));
70506 break;
70507 } else if (argc == 1) {
70508 // This is our current trailing argument; reduce argc
70509 --argc;
70510 } else {
70511 argv[0].setUndefined();
70512 }
70513 } while (false);
70514
70515 JS::Rooted<JS::Value> callable(cx);
70516 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70517 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70518 !InitIds(cx, atomsCache)) ||
70519 !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) {
70520 aRv.Throw(NS_ERROR_UNEXPECTED);
70521 return;
70522 }
70523 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70524 if (!JS::Call(cx, thisValue, callable,
70525 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70526 aRv.NoteJSContextException(cx);
70527 return;
70528 }
70529}
70530
70531void
70532TestJSImplInterfaceJSImpl::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
70533{
70534 CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70535 if (aRv.Failed()) {
70536 return;
70537 }
70538 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70538); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70539 BindingCallContext& cx = s.GetCallContext();
70540
70541 JS::Rooted<JS::Value> rval(cx);
70542 JS::RootedVector<JS::Value> argv(cx);
70543 if (!argv.resize(1)) {
70544 // That threw an exception on the JSContext, and our CallSetup will do
70545 // the right thing with that.
70546 return;
70547 }
70548 unsigned argc = 1;
70549
70550 do {
70551 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
70552 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 70552); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70553 aRv.Throw(NS_ERROR_UNEXPECTED);
70554 return;
70555 }
70556 break;
70557 } while (false);
70558
70559 JS::Rooted<JS::Value> callable(cx);
70560 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70561 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70562 !InitIds(cx, atomsCache)) ||
70563 !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) {
70564 aRv.Throw(NS_ERROR_UNEXPECTED);
70565 return;
70566 }
70567 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70568 if (!JS::Call(cx, thisValue, callable,
70569 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70570 aRv.NoteJSContextException(cx);
70571 return;
70572 }
70573}
70574
70575void
70576TestJSImplInterfaceJSImpl::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70577{
70578 CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70579 if (aRv.Failed()) {
70580 return;
70581 }
70582 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70582); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70583 BindingCallContext& cx = s.GetCallContext();
70584
70585 JS::Rooted<JS::Value> rval(cx);
70586 JS::RootedVector<JS::Value> argv(cx);
70587 if (!argv.resize(1)) {
70588 // That threw an exception on the JSContext, and our CallSetup will do
70589 // the right thing with that.
70590 return;
70591 }
70592 unsigned argc = 1;
70593
70594 do {
70595 argv[0].setInt32(int32_t(arg));
70596 break;
70597 } while (false);
70598
70599 JS::Rooted<JS::Value> callable(cx);
70600 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70601 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70602 !InitIds(cx, atomsCache)) ||
70603 !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) {
70604 aRv.Throw(NS_ERROR_UNEXPECTED);
70605 return;
70606 }
70607 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70608 if (!JS::Call(cx, thisValue, callable,
70609 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70610 aRv.NoteJSContextException(cx);
70611 return;
70612 }
70613}
70614
70615void
70616TestJSImplInterfaceJSImpl::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70617{
70618 CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70619 if (aRv.Failed()) {
70620 return;
70621 }
70622 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70622); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70622); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70623 BindingCallContext& cx = s.GetCallContext();
70624
70625 JS::Rooted<JS::Value> rval(cx);
70626 JS::RootedVector<JS::Value> argv(cx);
70627 if (!argv.resize(1)) {
70628 // That threw an exception on the JSContext, and our CallSetup will do
70629 // the right thing with that.
70630 return;
70631 }
70632 unsigned argc = 1;
70633
70634 do {
70635 if (arg.WasPassed()) {
70636 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
70637 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70637); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 70637); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70638 aRv.Throw(NS_ERROR_UNEXPECTED);
70639 return;
70640 }
70641 break;
70642 } else if (argc == 1) {
70643 // This is our current trailing argument; reduce argc
70644 --argc;
70645 } else {
70646 argv[0].setUndefined();
70647 }
70648 } while (false);
70649
70650 JS::Rooted<JS::Value> callable(cx);
70651 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70652 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70653 !InitIds(cx, atomsCache)) ||
70654 !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) {
70655 aRv.Throw(NS_ERROR_UNEXPECTED);
70656 return;
70657 }
70658 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70659 if (!JS::Call(cx, thisValue, callable,
70660 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70661 aRv.NoteJSContextException(cx);
70662 return;
70663 }
70664}
70665
70666void
70667TestJSImplInterfaceJSImpl::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70668{
70669 CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70670 if (aRv.Failed()) {
70671 return;
70672 }
70673 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70673); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70673); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70674 BindingCallContext& cx = s.GetCallContext();
70675
70676 JS::Rooted<JS::Value> rval(cx);
70677 JS::RootedVector<JS::Value> argv(cx);
70678 if (!argv.resize(1)) {
70679 // That threw an exception on the JSContext, and our CallSetup will do
70680 // the right thing with that.
70681 return;
70682 }
70683 unsigned argc = 1;
70684
70685 do {
70686 argv[0].setInt32(int32_t(arg));
70687 break;
70688 } while (false);
70689
70690 JS::Rooted<JS::Value> callable(cx);
70691 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70692 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70693 !InitIds(cx, atomsCache)) ||
70694 !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) {
70695 aRv.Throw(NS_ERROR_UNEXPECTED);
70696 return;
70697 }
70698 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70699 if (!JS::Call(cx, thisValue, callable,
70700 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70701 aRv.NoteJSContextException(cx);
70702 return;
70703 }
70704}
70705
70706void
70707TestJSImplInterfaceJSImpl::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70708{
70709 CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70710 if (aRv.Failed()) {
70711 return;
70712 }
70713 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70713); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70713); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70714 BindingCallContext& cx = s.GetCallContext();
70715
70716 JS::Rooted<JS::Value> rval(cx);
70717 JS::RootedVector<JS::Value> argv(cx);
70718 if (!argv.resize(1)) {
70719 // That threw an exception on the JSContext, and our CallSetup will do
70720 // the right thing with that.
70721 return;
70722 }
70723 unsigned argc = 1;
70724
70725 do {
70726 if (arg.WasPassed()) {
70727 if (!arg.Value()) {
70728 argv[0].setNull();
70729 break;
70730 }
70731 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
70732 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70732); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 70732); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70733 aRv.Throw(NS_ERROR_UNEXPECTED);
70734 return;
70735 }
70736 break;
70737 } else if (argc == 1) {
70738 // This is our current trailing argument; reduce argc
70739 --argc;
70740 } else {
70741 argv[0].setUndefined();
70742 }
70743 } while (false);
70744
70745 JS::Rooted<JS::Value> callable(cx);
70746 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70747 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70748 !InitIds(cx, atomsCache)) ||
70749 !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) {
70750 aRv.Throw(NS_ERROR_UNEXPECTED);
70751 return;
70752 }
70753 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70754 if (!JS::Call(cx, thisValue, callable,
70755 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70756 aRv.NoteJSContextException(cx);
70757 return;
70758 }
70759}
70760
70761void
70762TestJSImplInterfaceJSImpl::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70763{
70764 CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70765 if (aRv.Failed()) {
70766 return;
70767 }
70768 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70768); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70768); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70769 BindingCallContext& cx = s.GetCallContext();
70770
70771 JS::Rooted<JS::Value> rval(cx);
70772 JS::RootedVector<JS::Value> argv(cx);
70773 if (!argv.resize(1)) {
70774 // That threw an exception on the JSContext, and our CallSetup will do
70775 // the right thing with that.
70776 return;
70777 }
70778 unsigned argc = 1;
70779
70780 do {
70781
70782 uint32_t length = arg.Length();
70783 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
70784 if (!returnArray) {
70785 aRv.Throw(NS_ERROR_UNEXPECTED);
70786 return;
70787 }
70788 // Scope for 'tmp'
70789 {
70790 JS::Rooted<JS::Value> tmp(cx);
70791 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
70792 // Control block to let us common up the JS_DefineElement calls when there
70793 // are different ways to succeed at wrapping the object.
70794 do {
70795 tmp.setInt32(int32_t(arg[sequenceIdx0]));
70796 break;
70797 } while (false);
70798 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
70799 JSPROP_ENUMERATE)) {
70800 aRv.Throw(NS_ERROR_UNEXPECTED);
70801 return;
70802 }
70803 }
70804 }
70805 argv[0].setObject(*returnArray);
70806 break;
70807 } while (false);
70808
70809 JS::Rooted<JS::Value> callable(cx);
70810 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70811 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70812 !InitIds(cx, atomsCache)) ||
70813 !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) {
70814 aRv.Throw(NS_ERROR_UNEXPECTED);
70815 return;
70816 }
70817 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70818 if (!JS::Call(cx, thisValue, callable,
70819 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70820 aRv.NoteJSContextException(cx);
70821 return;
70822 }
70823}
70824
70825void
70826TestJSImplInterfaceJSImpl::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70827{
70828 CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70829 if (aRv.Failed()) {
70830 return;
70831 }
70832 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70832); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70832); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70833 BindingCallContext& cx = s.GetCallContext();
70834
70835 JS::Rooted<JS::Value> rval(cx);
70836 JS::RootedVector<JS::Value> argv(cx);
70837 if (!argv.resize(1)) {
70838 // That threw an exception on the JSContext, and our CallSetup will do
70839 // the right thing with that.
70840 return;
70841 }
70842 unsigned argc = 1;
70843
70844 do {
70845
70846 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
70847 if (!returnObj) {
70848 aRv.Throw(NS_ERROR_UNEXPECTED);
70849 return;
70850 }
70851 // Scope for 'tmp'
70852 {
70853 JS::Rooted<JS::Value> tmp(cx);
70854 for (auto& entry : arg.Entries()) {
70855 auto& recordValue0 = entry.mValue;
70856 // Control block to let us common up the JS_DefineUCProperty calls when there
70857 // are different ways to succeed at wrapping the value.
70858 do {
70859 tmp.setInt32(int32_t(recordValue0));
70860 break;
70861 } while (false);
70862 if (!JS_DefineUCProperty(cx, returnObj,
70863 entry.mKey.BeginReading(),
70864 entry.mKey.Length(), tmp,
70865 JSPROP_ENUMERATE)) {
70866 aRv.Throw(NS_ERROR_UNEXPECTED);
70867 return;
70868 }
70869 }
70870 }
70871 argv[0].setObject(*returnObj);
70872 break;
70873 } while (false);
70874
70875 JS::Rooted<JS::Value> callable(cx);
70876 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70877 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70878 !InitIds(cx, atomsCache)) ||
70879 !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) {
70880 aRv.Throw(NS_ERROR_UNEXPECTED);
70881 return;
70882 }
70883 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70884 if (!JS::Call(cx, thisValue, callable,
70885 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70886 aRv.NoteJSContextException(cx);
70887 return;
70888 }
70889}
70890
70891void
70892TestJSImplInterfaceJSImpl::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70893{
70894 CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70895 if (aRv.Failed()) {
70896 return;
70897 }
70898 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70898); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70898); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70899 BindingCallContext& cx = s.GetCallContext();
70900
70901 JS::Rooted<JS::Value> rval(cx);
70902 JS::RootedVector<JS::Value> argv(cx);
70903 if (!argv.resize(1)) {
70904 // That threw an exception on the JSContext, and our CallSetup will do
70905 // the right thing with that.
70906 return;
70907 }
70908 unsigned argc = 1;
70909
70910 do {
70911
70912 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
70913 if (!returnObj) {
70914 aRv.Throw(NS_ERROR_UNEXPECTED);
70915 return;
70916 }
70917 // Scope for 'tmp'
70918 {
70919 JS::Rooted<JS::Value> tmp(cx);
70920 for (auto& entry : arg.Entries()) {
70921 auto& recordValue0 = entry.mValue;
70922 // Control block to let us common up the JS_DefineUCProperty calls when there
70923 // are different ways to succeed at wrapping the value.
70924 do {
70925 if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) {
70926 aRv.Throw(NS_ERROR_UNEXPECTED);
70927 return;
70928 }
70929 break;
70930 } while (false);
70931 if (!JS_DefineUCProperty(cx, returnObj,
70932 entry.mKey.BeginReading(),
70933 entry.mKey.Length(), tmp,
70934 JSPROP_ENUMERATE)) {
70935 aRv.Throw(NS_ERROR_UNEXPECTED);
70936 return;
70937 }
70938 }
70939 }
70940 argv[0].setObject(*returnObj);
70941 break;
70942 } while (false);
70943
70944 JS::Rooted<JS::Value> callable(cx);
70945 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70946 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70947 !InitIds(cx, atomsCache)) ||
70948 !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) {
70949 aRv.Throw(NS_ERROR_UNEXPECTED);
70950 return;
70951 }
70952 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70953 if (!JS::Call(cx, thisValue, callable,
70954 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70955 aRv.NoteJSContextException(cx);
70956 return;
70957 }
70958}
70959
70960void
70961TestJSImplInterfaceJSImpl::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70962{
70963 CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70964 if (aRv.Failed()) {
70965 return;
70966 }
70967 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 70967); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
70968 BindingCallContext& cx = s.GetCallContext();
70969
70970 JS::Rooted<JS::Value> rval(cx);
70971 JS::RootedVector<JS::Value> argv(cx);
70972 if (!argv.resize(1)) {
70973 // That threw an exception on the JSContext, and our CallSetup will do
70974 // the right thing with that.
70975 return;
70976 }
70977 unsigned argc = 1;
70978
70979 do {
70980
70981 uint32_t length = arg.Length();
70982 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
70983 if (!returnArray) {
70984 aRv.Throw(NS_ERROR_UNEXPECTED);
70985 return;
70986 }
70987 // Scope for 'tmp'
70988 {
70989 JS::Rooted<JS::Value> tmp(cx);
70990 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
70991 // Control block to let us common up the JS_DefineElement calls when there
70992 // are different ways to succeed at wrapping the object.
70993 do {
70994 if (!xpc::NonVoidStringToJsval(cx, arg[sequenceIdx0], &tmp)) {
70995 aRv.Throw(NS_ERROR_UNEXPECTED);
70996 return;
70997 }
70998 break;
70999 } while (false);
71000 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
71001 JSPROP_ENUMERATE)) {
71002 aRv.Throw(NS_ERROR_UNEXPECTED);
71003 return;
71004 }
71005 }
71006 }
71007 argv[0].setObject(*returnArray);
71008 break;
71009 } while (false);
71010
71011 JS::Rooted<JS::Value> callable(cx);
71012 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71013 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71014 !InitIds(cx, atomsCache)) ||
71015 !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) {
71016 aRv.Throw(NS_ERROR_UNEXPECTED);
71017 return;
71018 }
71019 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71020 if (!JS::Call(cx, thisValue, callable,
71021 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71022 aRv.NoteJSContextException(cx);
71023 return;
71024 }
71025}
71026
71027void
71028TestJSImplInterfaceJSImpl::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
71029{
71030 CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71031 if (aRv.Failed()) {
71032 return;
71033 }
71034 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71034); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71034); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71035 BindingCallContext& cx = s.GetCallContext();
71036
71037 JS::Rooted<JS::Value> rval(cx);
71038 JS::RootedVector<JS::Value> argv(cx);
71039 if (!argv.resize(1)) {
71040 // That threw an exception on the JSContext, and our CallSetup will do
71041 // the right thing with that.
71042 return;
71043 }
71044 unsigned argc = 1;
71045
71046 do {
71047
71048 uint32_t length = arg.Length();
71049 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
71050 if (!returnArray) {
71051 aRv.Throw(NS_ERROR_UNEXPECTED);
71052 return;
71053 }
71054 // Scope for 'tmp'
71055 {
71056 JS::Rooted<JS::Value> tmp(cx);
71057 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
71058 // Control block to let us common up the JS_DefineElement calls when there
71059 // are different ways to succeed at wrapping the object.
71060 do {
71061 tmp.setInt32(int32_t(arg[sequenceIdx0]));
71062 break;
71063 } while (false);
71064 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
71065 JSPROP_ENUMERATE)) {
71066 aRv.Throw(NS_ERROR_UNEXPECTED);
71067 return;
71068 }
71069 }
71070 }
71071 argv[0].setObject(*returnArray);
71072 break;
71073 } while (false);
71074
71075 JS::Rooted<JS::Value> callable(cx);
71076 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71077 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71078 !InitIds(cx, atomsCache)) ||
71079 !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) {
71080 aRv.Throw(NS_ERROR_UNEXPECTED);
71081 return;
71082 }
71083 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71084 if (!JS::Call(cx, thisValue, callable,
71085 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71086 aRv.NoteJSContextException(cx);
71087 return;
71088 }
71089}
71090
71091void
71092TestJSImplInterfaceJSImpl::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
71093{
71094 CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71095 if (aRv.Failed()) {
71096 return;
71097 }
71098 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71098); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71098); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71099 BindingCallContext& cx = s.GetCallContext();
71100
71101 JS::Rooted<JS::Value> rval(cx);
71102 JS::RootedVector<JS::Value> argv(cx);
71103 if (!argv.resize(1)) {
71104 // That threw an exception on the JSContext, and our CallSetup will do
71105 // the right thing with that.
71106 return;
71107 }
71108 unsigned argc = 1;
71109
71110 do {
71111 if (!arg.ToObjectInternal(cx, argv[0])) {
71112 aRv.Throw(NS_ERROR_UNEXPECTED);
71113 return;
71114 }
71115 break;
71116 } while (false);
71117
71118 JS::Rooted<JS::Value> callable(cx);
71119 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71120 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71121 !InitIds(cx, atomsCache)) ||
71122 !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) {
71123 aRv.Throw(NS_ERROR_UNEXPECTED);
71124 return;
71125 }
71126 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71127 if (!JS::Call(cx, thisValue, callable,
71128 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71129 aRv.NoteJSContextException(cx);
71130 return;
71131 }
71132}
71133
71134void
71135TestJSImplInterfaceJSImpl::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
71136{
71137 CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71138 if (aRv.Failed()) {
71139 return;
71140 }
71141 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71141); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71142 BindingCallContext& cx = s.GetCallContext();
71143
71144 JS::Rooted<JS::Value> rval(cx);
71145 JS::RootedVector<JS::Value> argv(cx);
71146 if (!argv.resize(1)) {
71147 // That threw an exception on the JSContext, and our CallSetup will do
71148 // the right thing with that.
71149 return;
71150 }
71151 unsigned argc = 1;
71152
71153 do {
71154 if (!arg.ToObjectInternal(cx, argv[0])) {
71155 aRv.Throw(NS_ERROR_UNEXPECTED);
71156 return;
71157 }
71158 break;
71159 } while (false);
71160
71161 JS::Rooted<JS::Value> callable(cx);
71162 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71163 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71164 !InitIds(cx, atomsCache)) ||
71165 !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) {
71166 aRv.Throw(NS_ERROR_UNEXPECTED);
71167 return;
71168 }
71169 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71170 if (!JS::Call(cx, thisValue, callable,
71171 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71172 aRv.NoteJSContextException(cx);
71173 return;
71174 }
71175}
71176
71177void
71178TestJSImplInterfaceJSImpl::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
71179{
71180 CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71181 if (aRv.Failed()) {
71182 return;
71183 }
71184 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71184); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71184); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71185 BindingCallContext& cx = s.GetCallContext();
71186
71187 JS::Rooted<JS::Value> rval(cx);
71188 JS::RootedVector<JS::Value> argv(cx);
71189 if (!argv.resize(1)) {
71190 // That threw an exception on the JSContext, and our CallSetup will do
71191 // the right thing with that.
71192 return;
71193 }
71194 unsigned argc = 1;
71195
71196 do {
71197
71198 uint32_t length = arg.Length();
71199 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
71200 if (!returnArray) {
71201 aRv.Throw(NS_ERROR_UNEXPECTED);
71202 return;
71203 }
71204 // Scope for 'tmp'
71205 {
71206 JS::Rooted<JS::Value> tmp(cx);
71207 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
71208 // Control block to let us common up the JS_DefineElement calls when there
71209 // are different ways to succeed at wrapping the object.
71210 do {
71211 tmp.setInt32(int32_t(arg[sequenceIdx0]));
71212 break;
71213 } while (false);
71214 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
71215 JSPROP_ENUMERATE)) {
71216 aRv.Throw(NS_ERROR_UNEXPECTED);
71217 return;
71218 }
71219 }
71220 }
71221 argv[0].setObject(*returnArray);
71222 break;
71223 } while (false);
71224
71225 JS::Rooted<JS::Value> callable(cx);
71226 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71227 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71228 !InitIds(cx, atomsCache)) ||
71229 !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) {
71230 aRv.Throw(NS_ERROR_UNEXPECTED);
71231 return;
71232 }
71233 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71234 if (!JS::Call(cx, thisValue, callable,
71235 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71236 aRv.NoteJSContextException(cx);
71237 return;
71238 }
71239}
71240
71241void
71242TestJSImplInterfaceJSImpl::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const nsTArray<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm)
71243{
71244 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicThirdArg", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71245 if (aRv.Failed()) {
71246 return;
71247 }
71248 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71248); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71249 BindingCallContext& cx = s.GetCallContext();
71250
71251 JS::Rooted<JS::Value> rval(cx);
71252 JS::RootedVector<JS::Value> argv(cx);
71253 if (!argv.resize((3 - 1) + arg3.Length())) {
71254 // That threw an exception on the JSContext, and our CallSetup will do
71255 // the right thing with that.
71256 return;
71257 }
71258 unsigned argc = (3 - 1) + arg3.Length();
71259
71260 do {
71261 for (uint32_t idx = 0; idx < arg3.Length(); ++idx) {
71262 if (!GetOrCreateDOMReflector(cx, arg3[idx], argv[2 + idx])) {
71263 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 71263); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71264 aRv.Throw(NS_ERROR_UNEXPECTED);
71265 return;
71266 }
71267 continue;
71268 }
71269 break;
71270 } while (false);
71271
71272 do {
71273 argv[1].setInt32(int32_t(arg2));
71274 break;
71275 } while (false);
71276
71277 do {
71278 if (!xpc::NonVoidStringToJsval(cx, arg1, argv[0])) {
71279 aRv.Throw(NS_ERROR_UNEXPECTED);
71280 return;
71281 }
71282 break;
71283 } while (false);
71284
71285 JS::Rooted<JS::Value> callable(cx);
71286 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71287 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71288 !InitIds(cx, atomsCache)) ||
71289 !GetCallableProperty(cx, atomsCache->passVariadicThirdArg_id, &callable)) {
71290 aRv.Throw(NS_ERROR_UNEXPECTED);
71291 return;
71292 }
71293 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71294 if (!JS::Call(cx, thisValue, callable,
71295 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71296 aRv.NoteJSContextException(cx);
71297 return;
71298 }
71299}
71300
71301void
71302TestJSImplInterfaceJSImpl::Prefable10(ErrorResult& aRv, JS::Realm* aRealm)
71303{
71304 CallSetup s(this, aRv, "TestJSImplInterface.prefable10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71305 if (aRv.Failed()) {
71306 return;
71307 }
71308 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71308); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71308); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71309 BindingCallContext& cx = s.GetCallContext();
71310
71311 JS::Rooted<JS::Value> rval(cx);
71312
71313 JS::Rooted<JS::Value> callable(cx);
71314 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71315 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71316 !InitIds(cx, atomsCache)) ||
71317 !GetCallableProperty(cx, atomsCache->prefable10_id, &callable)) {
71318 aRv.Throw(NS_ERROR_UNEXPECTED);
71319 return;
71320 }
71321 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71322 if (!JS::Call(cx, thisValue, callable,
71323 JS::HandleValueArray::empty(), &rval)) {
71324 aRv.NoteJSContextException(cx);
71325 return;
71326 }
71327}
71328
71329void
71330TestJSImplInterfaceJSImpl::Prefable11(ErrorResult& aRv, JS::Realm* aRealm)
71331{
71332 CallSetup s(this, aRv, "TestJSImplInterface.prefable11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71333 if (aRv.Failed()) {
71334 return;
71335 }
71336 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71336); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71336); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71337 BindingCallContext& cx = s.GetCallContext();
71338
71339 JS::Rooted<JS::Value> rval(cx);
71340
71341 JS::Rooted<JS::Value> callable(cx);
71342 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71343 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71344 !InitIds(cx, atomsCache)) ||
71345 !GetCallableProperty(cx, atomsCache->prefable11_id, &callable)) {
71346 aRv.Throw(NS_ERROR_UNEXPECTED);
71347 return;
71348 }
71349 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71350 if (!JS::Call(cx, thisValue, callable,
71351 JS::HandleValueArray::empty(), &rval)) {
71352 aRv.NoteJSContextException(cx);
71353 return;
71354 }
71355}
71356
71357void
71358TestJSImplInterfaceJSImpl::Prefable13(ErrorResult& aRv, JS::Realm* aRealm)
71359{
71360 CallSetup s(this, aRv, "TestJSImplInterface.prefable13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71361 if (aRv.Failed()) {
71362 return;
71363 }
71364 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71364); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71364); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71365 BindingCallContext& cx = s.GetCallContext();
71366
71367 JS::Rooted<JS::Value> rval(cx);
71368
71369 JS::Rooted<JS::Value> callable(cx);
71370 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71371 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71372 !InitIds(cx, atomsCache)) ||
71373 !GetCallableProperty(cx, atomsCache->prefable13_id, &callable)) {
71374 aRv.Throw(NS_ERROR_UNEXPECTED);
71375 return;
71376 }
71377 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71378 if (!JS::Call(cx, thisValue, callable,
71379 JS::HandleValueArray::empty(), &rval)) {
71380 aRv.NoteJSContextException(cx);
71381 return;
71382 }
71383}
71384
71385void
71386TestJSImplInterfaceJSImpl::Prefable17(ErrorResult& aRv, JS::Realm* aRealm)
71387{
71388 CallSetup s(this, aRv, "TestJSImplInterface.prefable17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71389 if (aRv.Failed()) {
71390 return;
71391 }
71392 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71392); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71392); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71393 BindingCallContext& cx = s.GetCallContext();
71394
71395 JS::Rooted<JS::Value> rval(cx);
71396
71397 JS::Rooted<JS::Value> callable(cx);
71398 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71399 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71400 !InitIds(cx, atomsCache)) ||
71401 !GetCallableProperty(cx, atomsCache->prefable17_id, &callable)) {
71402 aRv.Throw(NS_ERROR_UNEXPECTED);
71403 return;
71404 }
71405 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71406 if (!JS::Call(cx, thisValue, callable,
71407 JS::HandleValueArray::empty(), &rval)) {
71408 aRv.NoteJSContextException(cx);
71409 return;
71410 }
71411}
71412
71413void
71414TestJSImplInterfaceJSImpl::Prefable18(ErrorResult& aRv, JS::Realm* aRealm)
71415{
71416 CallSetup s(this, aRv, "TestJSImplInterface.prefable18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71417 if (aRv.Failed()) {
71418 return;
71419 }
71420 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71420); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71420); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71421 BindingCallContext& cx = s.GetCallContext();
71422
71423 JS::Rooted<JS::Value> rval(cx);
71424
71425 JS::Rooted<JS::Value> callable(cx);
71426 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71427 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71428 !InitIds(cx, atomsCache)) ||
71429 !GetCallableProperty(cx, atomsCache->prefable18_id, &callable)) {
71430 aRv.Throw(NS_ERROR_UNEXPECTED);
71431 return;
71432 }
71433 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71434 if (!JS::Call(cx, thisValue, callable,
71435 JS::HandleValueArray::empty(), &rval)) {
71436 aRv.NoteJSContextException(cx);
71437 return;
71438 }
71439}
71440
71441void
71442TestJSImplInterfaceJSImpl::Prefable19(ErrorResult& aRv, JS::Realm* aRealm)
71443{
71444 CallSetup s(this, aRv, "TestJSImplInterface.prefable19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71445 if (aRv.Failed()) {
71446 return;
71447 }
71448 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71448); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71448); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71449 BindingCallContext& cx = s.GetCallContext();
71450
71451 JS::Rooted<JS::Value> rval(cx);
71452
71453 JS::Rooted<JS::Value> callable(cx);
71454 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71455 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71456 !InitIds(cx, atomsCache)) ||
71457 !GetCallableProperty(cx, atomsCache->prefable19_id, &callable)) {
71458 aRv.Throw(NS_ERROR_UNEXPECTED);
71459 return;
71460 }
71461 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71462 if (!JS::Call(cx, thisValue, callable,
71463 JS::HandleValueArray::empty(), &rval)) {
71464 aRv.NoteJSContextException(cx);
71465 return;
71466 }
71467}
71468
71469void
71470TestJSImplInterfaceJSImpl::Prefable20(ErrorResult& aRv, JS::Realm* aRealm)
71471{
71472 CallSetup s(this, aRv, "TestJSImplInterface.prefable20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71473 if (aRv.Failed()) {
71474 return;
71475 }
71476 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71476); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71476); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71477 BindingCallContext& cx = s.GetCallContext();
71478
71479 JS::Rooted<JS::Value> rval(cx);
71480
71481 JS::Rooted<JS::Value> callable(cx);
71482 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71483 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71484 !InitIds(cx, atomsCache)) ||
71485 !GetCallableProperty(cx, atomsCache->prefable20_id, &callable)) {
71486 aRv.Throw(NS_ERROR_UNEXPECTED);
71487 return;
71488 }
71489 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71490 if (!JS::Call(cx, thisValue, callable,
71491 JS::HandleValueArray::empty(), &rval)) {
71492 aRv.NoteJSContextException(cx);
71493 return;
71494 }
71495}
71496
71497void
71498TestJSImplInterfaceJSImpl::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm)
71499{
71500 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71501 if (aRv.Failed()) {
71502 return;
71503 }
71504 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71504); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71504); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71505 BindingCallContext& cx = s.GetCallContext();
71506
71507 JS::Rooted<JS::Value> rval(cx);
71508
71509 JS::Rooted<JS::Value> callable(cx);
71510 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71511 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71512 !InitIds(cx, atomsCache)) ||
71513 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext5_id, &callable)) {
71514 aRv.Throw(NS_ERROR_UNEXPECTED);
71515 return;
71516 }
71517 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71518 if (!JS::Call(cx, thisValue, callable,
71519 JS::HandleValueArray::empty(), &rval)) {
71520 aRv.NoteJSContextException(cx);
71521 return;
71522 }
71523}
71524
71525void
71526TestJSImplInterfaceJSImpl::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm)
71527{
71528 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71529 if (aRv.Failed()) {
71530 return;
71531 }
71532 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71532); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71532); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71533 BindingCallContext& cx = s.GetCallContext();
71534
71535 JS::Rooted<JS::Value> rval(cx);
71536
71537 JS::Rooted<JS::Value> callable(cx);
71538 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71539 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71540 !InitIds(cx, atomsCache)) ||
71541 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext6_id, &callable)) {
71542 aRv.Throw(NS_ERROR_UNEXPECTED);
71543 return;
71544 }
71545 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71546 if (!JS::Call(cx, thisValue, callable,
71547 JS::HandleValueArray::empty(), &rval)) {
71548 aRv.NoteJSContextException(cx);
71549 return;
71550 }
71551}
71552
71553void
71554TestJSImplInterfaceJSImpl::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm)
71555{
71556 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71557 if (aRv.Failed()) {
71558 return;
71559 }
71560 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71560); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71560); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71561 BindingCallContext& cx = s.GetCallContext();
71562
71563 JS::Rooted<JS::Value> rval(cx);
71564
71565 JS::Rooted<JS::Value> callable(cx);
71566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71568 !InitIds(cx, atomsCache)) ||
71569 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext7_id, &callable)) {
71570 aRv.Throw(NS_ERROR_UNEXPECTED);
71571 return;
71572 }
71573 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71574 if (!JS::Call(cx, thisValue, callable,
71575 JS::HandleValueArray::empty(), &rval)) {
71576 aRv.NoteJSContextException(cx);
71577 return;
71578 }
71579}
71580
71581void
71582TestJSImplInterfaceJSImpl::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm)
71583{
71584 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71585 if (aRv.Failed()) {
71586 return;
71587 }
71588 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71588); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71589 BindingCallContext& cx = s.GetCallContext();
71590
71591 JS::Rooted<JS::Value> rval(cx);
71592
71593 JS::Rooted<JS::Value> callable(cx);
71594 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71595 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71596 !InitIds(cx, atomsCache)) ||
71597 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext8_id, &callable)) {
71598 aRv.Throw(NS_ERROR_UNEXPECTED);
71599 return;
71600 }
71601 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71602 if (!JS::Call(cx, thisValue, callable,
71603 JS::HandleValueArray::empty(), &rval)) {
71604 aRv.NoteJSContextException(cx);
71605 return;
71606 }
71607}
71608
71609void
71610TestJSImplInterfaceJSImpl::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
71611{
71612 CallSetup s(this, aRv, "TestJSImplInterface.passRenamedInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71613 if (aRv.Failed()) {
71614 return;
71615 }
71616 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71616); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71617 BindingCallContext& cx = s.GetCallContext();
71618
71619 JS::Rooted<JS::Value> rval(cx);
71620 JS::RootedVector<JS::Value> argv(cx);
71621 if (!argv.resize(1)) {
71622 // That threw an exception on the JSContext, and our CallSetup will do
71623 // the right thing with that.
71624 return;
71625 }
71626 unsigned argc = 1;
71627
71628 do {
71629 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
71630 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71630); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 71630); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71631 aRv.Throw(NS_ERROR_UNEXPECTED);
71632 return;
71633 }
71634 break;
71635 } while (false);
71636
71637 JS::Rooted<JS::Value> callable(cx);
71638 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71639 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71640 !InitIds(cx, atomsCache)) ||
71641 !GetCallableProperty(cx, atomsCache->passRenamedInterface_id, &callable)) {
71642 aRv.Throw(NS_ERROR_UNEXPECTED);
71643 return;
71644 }
71645 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71646 if (!JS::Call(cx, thisValue, callable,
71647 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71648 aRv.NoteJSContextException(cx);
71649 return;
71650 }
71651}
71652
71653void
71654TestJSImplInterfaceJSImpl::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm)
71655{
71656 CallSetup s(this, aRv, "TestJSImplInterface.throwingMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71657 if (aRv.Failed()) {
71658 return;
71659 }
71660 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71660); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71660); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71661 BindingCallContext& cx = s.GetCallContext();
71662
71663 JS::Rooted<JS::Value> rval(cx);
71664
71665 JS::Rooted<JS::Value> callable(cx);
71666 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71667 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71668 !InitIds(cx, atomsCache)) ||
71669 !GetCallableProperty(cx, atomsCache->throwingMethod_id, &callable)) {
71670 aRv.Throw(NS_ERROR_UNEXPECTED);
71671 return;
71672 }
71673 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71674 if (!JS::Call(cx, thisValue, callable,
71675 JS::HandleValueArray::empty(), &rval)) {
71676 aRv.NoteJSContextException(cx);
71677 return;
71678 }
71679}
71680
71681void
71682TestJSImplInterfaceJSImpl::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm)
71683{
71684 CallSetup s(this, aRv, "TestJSImplInterface.canOOMMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71685 if (aRv.Failed()) {
71686 return;
71687 }
71688 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71688); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71689 BindingCallContext& cx = s.GetCallContext();
71690
71691 JS::Rooted<JS::Value> rval(cx);
71692
71693 JS::Rooted<JS::Value> callable(cx);
71694 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71695 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71696 !InitIds(cx, atomsCache)) ||
71697 !GetCallableProperty(cx, atomsCache->canOOMMethod_id, &callable)) {
71698 aRv.Throw(NS_ERROR_UNEXPECTED);
71699 return;
71700 }
71701 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71702 if (!JS::Call(cx, thisValue, callable,
71703 JS::HandleValueArray::empty(), &rval)) {
71704 aRv.NoteJSContextException(cx);
71705 return;
71706 }
71707}
71708
71709void
71710TestJSImplInterfaceJSImpl::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm)
71711{
71712 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71713 if (aRv.Failed()) {
71714 return;
71715 }
71716 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71716); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71716); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71717 BindingCallContext& cx = s.GetCallContext();
71718
71719 JS::Rooted<JS::Value> rval(cx);
71720
71721 JS::Rooted<JS::Value> callable(cx);
71722 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71723 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71724 !InitIds(cx, atomsCache)) ||
71725 !GetCallableProperty(cx, atomsCache->ceReactionsMethod_id, &callable)) {
71726 aRv.Throw(NS_ERROR_UNEXPECTED);
71727 return;
71728 }
71729 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71730 if (!JS::Call(cx, thisValue, callable,
71731 JS::HandleValueArray::empty(), &rval)) {
71732 aRv.NoteJSContextException(cx);
71733 return;
71734 }
71735}
71736
71737void
71738TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm)
71739{
71740 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71741 if (aRv.Failed()) {
71742 return;
71743 }
71744 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71744); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71744); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71745 BindingCallContext& cx = s.GetCallContext();
71746
71747 JS::Rooted<JS::Value> rval(cx);
71748
71749 JS::Rooted<JS::Value> callable(cx);
71750 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71751 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71752 !InitIds(cx, atomsCache)) ||
71753 !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) {
71754 aRv.Throw(NS_ERROR_UNEXPECTED);
71755 return;
71756 }
71757 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71758 if (!JS::Call(cx, thisValue, callable,
71759 JS::HandleValueArray::empty(), &rval)) {
71760 aRv.NoteJSContextException(cx);
71761 return;
71762 }
71763}
71764
71765void
71766TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm)
71767{
71768 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71769 if (aRv.Failed()) {
71770 return;
71771 }
71772 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71772); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71772); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71773 BindingCallContext& cx = s.GetCallContext();
71774
71775 JS::Rooted<JS::Value> rval(cx);
71776 JS::RootedVector<JS::Value> argv(cx);
71777 if (!argv.resize(1)) {
71778 // That threw an exception on the JSContext, and our CallSetup will do
71779 // the right thing with that.
71780 return;
71781 }
71782 unsigned argc = 1;
71783
71784 do {
71785 if (!xpc::NonVoidStringToJsval(cx, bar, argv[0])) {
71786 aRv.Throw(NS_ERROR_UNEXPECTED);
71787 return;
71788 }
71789 break;
71790 } while (false);
71791
71792 JS::Rooted<JS::Value> callable(cx);
71793 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71794 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71795 !InitIds(cx, atomsCache)) ||
71796 !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) {
71797 aRv.Throw(NS_ERROR_UNEXPECTED);
71798 return;
71799 }
71800 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71801 if (!JS::Call(cx, thisValue, callable,
71802 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71803 aRv.NoteJSContextException(cx);
71804 return;
71805 }
71806}
71807
71808void
71809TestJSImplInterfaceJSImpl::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm)
71810{
71811 CallSetup s(this, aRv, "TestJSImplInterface.passArgsWithDefaults", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71812 if (aRv.Failed()) {
71813 return;
71814 }
71815 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71815); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71816 BindingCallContext& cx = s.GetCallContext();
71817
71818 JS::Rooted<JS::Value> rval(cx);
71819 JS::RootedVector<JS::Value> argv(cx);
71820 if (!argv.resize(5)) {
71821 // That threw an exception on the JSContext, and our CallSetup will do
71822 // the right thing with that.
71823 return;
71824 }
71825 unsigned argc = 5;
71826
71827 do {
71828 if (arg5.WasPassed()) {
71829 argv[4].set(JS_NumberValue(double(arg5.Value())));
71830 break;
71831 } else if (argc == 5) {
71832 // This is our current trailing argument; reduce argc
71833 --argc;
71834 } else {
71835 argv[4].setUndefined();
71836 }
71837 } while (false);
71838
71839 do {
71840 argv[3].set(JS_NumberValue(double(arg4)));
71841 break;
71842 } while (false);
71843
71844 do {
71845 if (!arg3.ToObjectInternal(cx, argv[2])) {
71846 aRv.Throw(NS_ERROR_UNEXPECTED);
71847 return;
71848 }
71849 break;
71850 } while (false);
71851
71852 do {
71853 if (!arg2) {
71854 argv[1].setNull();
71855 break;
71856 }
71857 if (!GetOrCreateDOMReflector(cx, arg2, argv[1])) {
71858 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71858); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 71858); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71859 aRv.Throw(NS_ERROR_UNEXPECTED);
71860 return;
71861 }
71862 break;
71863 } while (false);
71864
71865 do {
71866 if (arg1.WasPassed()) {
71867 argv[0].setInt32(int32_t(arg1.Value()));
71868 break;
71869 } else if (argc == 1) {
71870 // This is our current trailing argument; reduce argc
71871 --argc;
71872 } else {
71873 argv[0].setUndefined();
71874 }
71875 } while (false);
71876
71877 JS::Rooted<JS::Value> callable(cx);
71878 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71879 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71880 !InitIds(cx, atomsCache)) ||
71881 !GetCallableProperty(cx, atomsCache->passArgsWithDefaults_id, &callable)) {
71882 aRv.Throw(NS_ERROR_UNEXPECTED);
71883 return;
71884 }
71885 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71886 if (!JS::Call(cx, thisValue, callable,
71887 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71888 aRv.NoteJSContextException(cx);
71889 return;
71890 }
71891}
71892
71893void
71894TestJSImplInterfaceJSImpl::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
71895{
71896 CallSetup s(this, aRv, "TestJSImplInterface.toJSON", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71897 if (aRv.Failed()) {
71898 return;
71899 }
71900 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71900); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71900); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71901 BindingCallContext& cx = s.GetCallContext();
71902
71903 JS::Rooted<JS::Value> rval(cx);
71904
71905 JS::Rooted<JS::Value> callable(cx);
71906 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71907 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71908 !InitIds(cx, atomsCache)) ||
71909 !GetCallableProperty(cx, atomsCache->toJSON_id, &callable)) {
71910 aRv.Throw(NS_ERROR_UNEXPECTED);
71911 return;
71912 }
71913 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71914 if (!JS::Call(cx, thisValue, callable,
71915 JS::HandleValueArray::empty(), &rval)) {
71916 aRv.NoteJSContextException(cx);
71917 return;
71918 }
71919 JS::Rooted<JSObject*> rvalDecl(cx);
71920 if (rval.isObject()) {
71921#ifdef __clang__1
71922#pragma clang diagnostic push
71923#pragma clang diagnostic ignored "-Wunreachable-code"
71924#pragma clang diagnostic ignored "-Wunreachable-code-return"
71925#endif // __clang__
71926 if ((false) && !CallerSubsumes(rval)) {
71927 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSON");
71928 aRv.Throw(NS_ERROR_UNEXPECTED);
71929 return;
71930 }
71931#ifdef __clang__1
71932#pragma clang diagnostic pop
71933#endif // __clang__
71934 rvalDecl = &rval.toObject();
71935 } else {
71936 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSON");
71937 aRv.Throw(NS_ERROR_UNEXPECTED);
71938 return;
71939 }
71940 aRetVal.set(rvalDecl);
71941}
71942
71943void
71944TestJSImplInterfaceJSImpl::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm)
71945{
71946 CallSetup s(this, aRv, "TestJSImplInterface.dashed-method", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71947 if (aRv.Failed()) {
71948 return;
71949 }
71950 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71950); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71950); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71951 BindingCallContext& cx = s.GetCallContext();
71952
71953 JS::Rooted<JS::Value> rval(cx);
71954
71955 JS::Rooted<JS::Value> callable(cx);
71956 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71957 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71958 !InitIds(cx, atomsCache)) ||
71959 !GetCallableProperty(cx, atomsCache->dashed_method_id, &callable)) {
71960 aRv.Throw(NS_ERROR_UNEXPECTED);
71961 return;
71962 }
71963 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71964 if (!JS::Call(cx, thisValue, callable,
71965 JS::HandleValueArray::empty(), &rval)) {
71966 aRv.NoteJSContextException(cx);
71967 return;
71968 }
71969}
71970
71971void
71972TestJSImplInterfaceJSImpl::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm)
71973{
71974 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71975 if (aRv.Failed()) {
71976 return;
71977 }
71978 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71978); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 71978); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
71979 BindingCallContext& cx = s.GetCallContext();
71980
71981 JS::Rooted<JS::Value> rval(cx);
71982
71983 JS::Rooted<JS::Value> callable(cx);
71984 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71985 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71986 !InitIds(cx, atomsCache)) ||
71987 !GetCallableProperty(cx, atomsCache->nonEnumerableMethod_id, &callable)) {
71988 aRv.Throw(NS_ERROR_UNEXPECTED);
71989 return;
71990 }
71991 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71992 if (!JS::Call(cx, thisValue, callable,
71993 JS::HandleValueArray::empty(), &rval)) {
71994 aRv.NoteJSContextException(cx);
71995 return;
71996 }
71997}
71998
71999void
72000TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
72001{
72002 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72003 if (aRv.Failed()) {
72004 return;
72005 }
72006 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72006); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72006); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72007 BindingCallContext& cx = s.GetCallContext();
72008
72009 JS::Rooted<JS::Value> rval(cx);
72010 JS::RootedVector<JS::Value> argv(cx);
72011 if (!argv.resize(1)) {
72012 // That threw an exception on the JSContext, and our CallSetup will do
72013 // the right thing with that.
72014 return;
72015 }
72016 unsigned argc = 1;
72017
72018 do {
72019 argv[0].setObject(*foo.Obj());
72020 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72021 aRv.Throw(NS_ERROR_UNEXPECTED);
72022 return;
72023 }
72024 break;
72025 } while (false);
72026
72027 JS::Rooted<JS::Value> callable(cx);
72028 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72029 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72030 !InitIds(cx, atomsCache)) ||
72031 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferViewTypedef_id, &callable)) {
72032 aRv.Throw(NS_ERROR_UNEXPECTED);
72033 return;
72034 }
72035 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72036 if (!JS::Call(cx, thisValue, callable,
72037 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72038 aRv.NoteJSContextException(cx);
72039 return;
72040 }
72041}
72042
72043void
72044TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
72045{
72046 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72047 if (aRv.Failed()) {
72048 return;
72049 }
72050 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72050); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72050); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72051 BindingCallContext& cx = s.GetCallContext();
72052
72053 JS::Rooted<JS::Value> rval(cx);
72054 JS::RootedVector<JS::Value> argv(cx);
72055 if (!argv.resize(1)) {
72056 // That threw an exception on the JSContext, and our CallSetup will do
72057 // the right thing with that.
72058 return;
72059 }
72060 unsigned argc = 1;
72061
72062 do {
72063 argv[0].setObject(*foo.Obj());
72064 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72065 aRv.Throw(NS_ERROR_UNEXPECTED);
72066 return;
72067 }
72068 break;
72069 } while (false);
72070
72071 JS::Rooted<JS::Value> callable(cx);
72072 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72073 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72074 !InitIds(cx, atomsCache)) ||
72075 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferView_id, &callable)) {
72076 aRv.Throw(NS_ERROR_UNEXPECTED);
72077 return;
72078 }
72079 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72080 if (!JS::Call(cx, thisValue, callable,
72081 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72082 aRv.NoteJSContextException(cx);
72083 return;
72084 }
72085}
72086
72087void
72088TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm)
72089{
72090 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72091 if (aRv.Failed()) {
72092 return;
72093 }
72094 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72094); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72094); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72095 BindingCallContext& cx = s.GetCallContext();
72096
72097 JS::Rooted<JS::Value> rval(cx);
72098 JS::RootedVector<JS::Value> argv(cx);
72099 if (!argv.resize(1)) {
72100 // That threw an exception on the JSContext, and our CallSetup will do
72101 // the right thing with that.
72102 return;
72103 }
72104 unsigned argc = 1;
72105
72106 do {
72107 if (foo.IsNull()) {
72108 argv[0].setNull();
72109 break;
72110 }
72111 argv[0].setObject(*foo.Value().Obj());
72112 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72113 aRv.Throw(NS_ERROR_UNEXPECTED);
72114 return;
72115 }
72116 break;
72117 } while (false);
72118
72119 JS::Rooted<JS::Value> callable(cx);
72120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72122 !InitIds(cx, atomsCache)) ||
72123 !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBufferView_id, &callable)) {
72124 aRv.Throw(NS_ERROR_UNEXPECTED);
72125 return;
72126 }
72127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72128 if (!JS::Call(cx, thisValue, callable,
72129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72130 aRv.NoteJSContextException(cx);
72131 return;
72132 }
72133}
72134
72135void
72136TestJSImplInterfaceJSImpl::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
72137{
72138 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72139 if (aRv.Failed()) {
72140 return;
72141 }
72142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72142); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72143 BindingCallContext& cx = s.GetCallContext();
72144
72145 JS::Rooted<JS::Value> rval(cx);
72146 JS::RootedVector<JS::Value> argv(cx);
72147 if (!argv.resize(1)) {
72148 // That threw an exception on the JSContext, and our CallSetup will do
72149 // the right thing with that.
72150 return;
72151 }
72152 unsigned argc = 1;
72153
72154 do {
72155 argv[0].setObject(*foo.Obj());
72156 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72157 aRv.Throw(NS_ERROR_UNEXPECTED);
72158 return;
72159 }
72160 break;
72161 } while (false);
72162
72163 JS::Rooted<JS::Value> callable(cx);
72164 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72165 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72166 !InitIds(cx, atomsCache)) ||
72167 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBuffer_id, &callable)) {
72168 aRv.Throw(NS_ERROR_UNEXPECTED);
72169 return;
72170 }
72171 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72172 if (!JS::Call(cx, thisValue, callable,
72173 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72174 aRv.NoteJSContextException(cx);
72175 return;
72176 }
72177}
72178
72179void
72180TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm)
72181{
72182 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72183 if (aRv.Failed()) {
72184 return;
72185 }
72186 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72186); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72186); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72187 BindingCallContext& cx = s.GetCallContext();
72188
72189 JS::Rooted<JS::Value> rval(cx);
72190 JS::RootedVector<JS::Value> argv(cx);
72191 if (!argv.resize(1)) {
72192 // That threw an exception on the JSContext, and our CallSetup will do
72193 // the right thing with that.
72194 return;
72195 }
72196 unsigned argc = 1;
72197
72198 do {
72199 if (foo.IsNull()) {
72200 argv[0].setNull();
72201 break;
72202 }
72203 argv[0].setObject(*foo.Value().Obj());
72204 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72205 aRv.Throw(NS_ERROR_UNEXPECTED);
72206 return;
72207 }
72208 break;
72209 } while (false);
72210
72211 JS::Rooted<JS::Value> callable(cx);
72212 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72213 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72214 !InitIds(cx, atomsCache)) ||
72215 !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBuffer_id, &callable)) {
72216 aRv.Throw(NS_ERROR_UNEXPECTED);
72217 return;
72218 }
72219 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72220 if (!JS::Call(cx, thisValue, callable,
72221 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72222 aRv.NoteJSContextException(cx);
72223 return;
72224 }
72225}
72226
72227void
72228TestJSImplInterfaceJSImpl::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
72229{
72230 CallSetup s(this, aRv, "TestJSImplInterface.passUnionArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72231 if (aRv.Failed()) {
72232 return;
72233 }
72234 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72234); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72234); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72235 BindingCallContext& cx = s.GetCallContext();
72236
72237 JS::Rooted<JS::Value> rval(cx);
72238 JS::RootedVector<JS::Value> argv(cx);
72239 if (!argv.resize(1)) {
72240 // That threw an exception on the JSContext, and our CallSetup will do
72241 // the right thing with that.
72242 return;
72243 }
72244 unsigned argc = 1;
72245
72246 do {
72247 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
72248 if (!foo.ToJSVal(cx, callbackObj, argv[0])) {
72249 aRv.Throw(NS_ERROR_UNEXPECTED);
72250 return;
72251 }
72252 break;
72253 } while (false);
72254
72255 JS::Rooted<JS::Value> callable(cx);
72256 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72257 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72258 !InitIds(cx, atomsCache)) ||
72259 !GetCallableProperty(cx, atomsCache->passUnionArrayBuffer_id, &callable)) {
72260 aRv.Throw(NS_ERROR_UNEXPECTED);
72261 return;
72262 }
72263 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72264 if (!JS::Call(cx, thisValue, callable,
72265 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72266 aRv.NoteJSContextException(cx);
72267 return;
72268 }
72269}
72270
72271void
72272TestJSImplInterfaceJSImpl::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
72273{
72274 CallSetup s(this, aRv, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72275 if (aRv.Failed()) {
72276 return;
72277 }
72278 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72278); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72278); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72279 BindingCallContext& cx = s.GetCallContext();
72280
72281 JS::Rooted<JS::Value> rval(cx);
72282 JS::RootedVector<JS::Value> argv(cx);
72283 if (!argv.resize(1)) {
72284 // That threw an exception on the JSContext, and our CallSetup will do
72285 // the right thing with that.
72286 return;
72287 }
72288 unsigned argc = 1;
72289
72290 do {
72291 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
72292 if (!foo.ToJSVal(cx, callbackObj, argv[0])) {
72293 aRv.Throw(NS_ERROR_UNEXPECTED);
72294 return;
72295 }
72296 break;
72297 } while (false);
72298
72299 JS::Rooted<JS::Value> callable(cx);
72300 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72301 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72302 !InitIds(cx, atomsCache)) ||
72303 !GetCallableProperty(cx, atomsCache->passUnionAllowSharedArrayBuffer_id, &callable)) {
72304 aRv.Throw(NS_ERROR_UNEXPECTED);
72305 return;
72306 }
72307 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72308 if (!JS::Call(cx, thisValue, callable,
72309 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72310 aRv.NoteJSContextException(cx);
72311 return;
72312 }
72313}
72314
72315void
72316TestJSImplInterfaceJSImpl::PassAllowSharedInt8ArrayOrInt16Array(const MaybeSharedInt8ArrayOrMaybeSharedInt16Array& foo, ErrorResult& aRv, JS::Realm* aRealm)
72317{
72318 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedInt8ArrayOrInt16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72319 if (aRv.Failed()) {
72320 return;
72321 }
72322 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72322); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72322); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72323 BindingCallContext& cx = s.GetCallContext();
72324
72325 JS::Rooted<JS::Value> rval(cx);
72326 JS::RootedVector<JS::Value> argv(cx);
72327 if (!argv.resize(1)) {
72328 // That threw an exception on the JSContext, and our CallSetup will do
72329 // the right thing with that.
72330 return;
72331 }
72332 unsigned argc = 1;
72333
72334 do {
72335 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
72336 if (!foo.ToJSVal(cx, callbackObj, argv[0])) {
72337 aRv.Throw(NS_ERROR_UNEXPECTED);
72338 return;
72339 }
72340 break;
72341 } while (false);
72342
72343 JS::Rooted<JS::Value> callable(cx);
72344 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72345 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72346 !InitIds(cx, atomsCache)) ||
72347 !GetCallableProperty(cx, atomsCache->passAllowSharedInt8ArrayOrInt16Array_id, &callable)) {
72348 aRv.Throw(NS_ERROR_UNEXPECTED);
72349 return;
72350 }
72351 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72352 if (!JS::Call(cx, thisValue, callable,
72353 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72354 aRv.NoteJSContextException(cx);
72355 return;
72356 }
72357}
72358
72359void
72360TestJSImplInterfaceJSImpl::__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)
72361{
72362 CallSetup s(this, aRv, "__init", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72363 if (aRv.Failed()) {
72364 return;
72365 }
72366 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72366); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 72366); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72367 BindingCallContext& cx = s.GetCallContext();
72368
72369 JS::Rooted<JS::Value> rval(cx);
72370 JS::RootedVector<JS::Value> argv(cx);
72371 if (!argv.resize(15)) {
72372 // That threw an exception on the JSContext, and our CallSetup will do
72373 // the right thing with that.
72374 return;
72375 }
72376 unsigned argc = 15;
72377
72378 do {
72379 argv[14].setObject(*arrayBuf.Obj());
72380 if (!MaybeWrapNonDOMObjectValue(cx, argv[14])) {
72381 aRv.Throw(NS_ERROR_UNEXPECTED);
72382 return;
72383 }
72384 break;
72385 } while (false);
72386
72387 do {
72388 argv[13].setObject(*typedArr.Obj());
72389 if (!MaybeWrapNonDOMObjectValue(cx, argv[13])) {
72390 aRv.Throw(NS_ERROR_UNEXPECTED);
72391 return;
72392 }
72393 break;
72394 } while (false);
72395
72396 do {
72397 if (obj4.WasPassed()) {
72398 if (obj4.Value()) {
72399 JS::ExposeObjectToActiveJS(obj4.Value());
72400 }
72401 argv[12].setObjectOrNull(obj4.Value());
72402 if (!MaybeWrapObjectOrNullValue(cx, argv[12])) {
72403 aRv.Throw(NS_ERROR_UNEXPECTED);
72404 return;
72405 }
72406 break;
72407 } else if (argc == 13) {
72408 // This is our current trailing argument; reduce argc
72409 --argc;
72410 } else {
72411 argv[12].setUndefined();
72412 }
72413 } while (false);
72414
72415 do {
72416 if (obj3.WasPassed()) {
72417 JS::ExposeObjectToActiveJS(obj3.Value());
72418 argv[11].setObject(*obj3.Value());
72419 if (!MaybeWrapObjectValue(cx, argv[11])) {
72420 aRv.Throw(NS_ERROR_UNEXPECTED);
72421 return;
72422 }
72423 break;
72424 } else if (argc == 12) {
72425 // This is our current trailing argument; reduce argc
72426 --argc;
72427 } else {
72428 argv[11].setUndefined();
72429 }
72430 } while (false);
72431
72432 do {
72433 JS::ExposeValueToActiveJS(any2);
72434 argv[10].set(any2);
72435 if (!MaybeWrapValue(cx, argv[10])) {
72436 aRv.Throw(NS_ERROR_UNEXPECTED);
72437 return;
72438 }
72439 break;
72440 } while (false);
72441
72442 do {
72443
72444 uint32_t length = seq.Length();
72445 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
72446 if (!returnArray) {
72447 aRv.Throw(NS_ERROR_UNEXPECTED);
72448 return;
72449 }
72450 // Scope for 'tmp'
72451 {
72452 JS::Rooted<JS::Value> tmp(cx);
72453 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
72454 // Control block to let us common up the JS_DefineElement calls when there
72455 // are different ways to succeed at wrapping the object.
72456 do {
72457 if (!seq[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
72458 aRv.Throw(NS_ERROR_UNEXPECTED);
72459 return;
72460 }
72461 break;
72462 } while (false);
72463 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
72464 JSPROP_ENUMERATE)) {
72465 aRv.Throw(NS_ERROR_UNEXPECTED);
72466 return;
72467 }
72468 }
72469 }
72470 argv[9].setObject(*returnArray);
72471 break;
72472 } while (false);
72473
72474 do {
72475 if (obj2) {
72476 JS::ExposeObjectToActiveJS(obj2);
72477 }
72478 argv[8].setObjectOrNull(obj2);
72479 if (!MaybeWrapObjectOrNullValue(cx, argv[8])) {
72480 aRv.Throw(NS_ERROR_UNEXPECTED);
72481 return;
72482 }
72483 break;
72484 } while (false);
72485
72486 do {
72487 JS::ExposeObjectToActiveJS(obj1);
72488 argv[7].setObject(*obj1);
72489 if (!MaybeWrapObjectValue(cx, argv[7])) {
72490 aRv.Throw(NS_ERROR_UNEXPECTED);
72491 return;
72492 }
72493 break;
72494 } while (false);
72495
72496 do {
72497 JS::ExposeValueToActiveJS(any1);
72498 argv[6].set(any1);
72499 if (!MaybeWrapValue(cx, argv[6])) {
72500 aRv.Throw(NS_ERROR_UNEXPECTED);
72501 return;
72502 }
72503 break;
72504 } while (false);
72505
72506 do {
72507 if (!dict.ToObjectInternal(cx, argv[5])) {
72508 aRv.Throw(NS_ERROR_UNEXPECTED);
72509 return;
72510 }
72511 break;
72512 } while (false);
72513
72514 do {
72515 argv[4].setInt32(int32_t(arg1));
72516 break;
72517 } while (false);
72518
72519 do {
72520 if (!iface) {
72521 argv[3].setNull();
72522 break;
72523 }
72524 if (!GetOrCreateDOMReflector(cx, iface, argv[3])) {
72525 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 72525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 72525); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
72526 aRv.Throw(NS_ERROR_UNEXPECTED);
72527 return;
72528 }
72529 break;
72530 } while (false);
72531
72532 do {
72533 if (boolArg.IsNull()) {
72534 argv[2].setNull();
72535 break;
72536 }
72537 argv[2].setBoolean(boolArg.Value());
72538 break;
72539 } while (false);
72540
72541 do {
72542 argv[1].setNumber(num);
72543 break;
72544 } while (false);
72545
72546 do {
72547 if (!xpc::NonVoidStringToJsval(cx, str, argv[0])) {
72548 aRv.Throw(NS_ERROR_UNEXPECTED);
72549 return;
72550 }
72551 break;
72552 } while (false);
72553
72554 JS::Rooted<JS::Value> callable(cx);
72555 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72556 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72557 !InitIds(cx, atomsCache)) ||
72558 !GetCallableProperty(cx, atomsCache->__init_id, &callable)) {
72559 aRv.Throw(NS_ERROR_UNEXPECTED);
72560 return;
72561 }
72562 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72563 if (!JS::Call(cx, thisValue, callable,
72564 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72565 aRv.NoteJSContextException(cx);
72566 return;
72567 }
72568}
72569
72570bool
72571TestJSImplInterfaceJSImpl::InitIds(JSContext* cx, TestJSImplInterfaceAtoms* atomsCache)
72572{
72573 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"
, 72573); AnnotateMozCrashReason("MOZ_ASSERT" "(" "reinterpret_cast<jsid*>(atomsCache)->isVoid()"
")"); do { MOZ_CrashSequence(__null, 72573); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
72574
72575 // Initialize these in reverse order so that any failure leaves the first one
72576 // uninitialized.
72577 if (!atomsCache->__init_id.init(cx, "__init") ||
72578 !atomsCache->passAllowSharedInt8ArrayOrInt16Array_id.init(cx, "passAllowSharedInt8ArrayOrInt16Array") ||
72579 !atomsCache->passUnionAllowSharedArrayBuffer_id.init(cx, "passUnionAllowSharedArrayBuffer") ||
72580 !atomsCache->passUnionArrayBuffer_id.init(cx, "passUnionArrayBuffer") ||
72581 !atomsCache->passAllowSharedNullableArrayBuffer_id.init(cx, "passAllowSharedNullableArrayBuffer") ||
72582 !atomsCache->passAllowSharedArrayBuffer_id.init(cx, "passAllowSharedArrayBuffer") ||
72583 !atomsCache->passAllowSharedNullableArrayBufferView_id.init(cx, "passAllowSharedNullableArrayBufferView") ||
72584 !atomsCache->passAllowSharedArrayBufferView_id.init(cx, "passAllowSharedArrayBufferView") ||
72585 !atomsCache->passAllowSharedArrayBufferViewTypedef_id.init(cx, "passAllowSharedArrayBufferViewTypedef") ||
72586 !atomsCache->allowSharedNullableArrayBuffer_id.init(cx, "allowSharedNullableArrayBuffer") ||
72587 !atomsCache->allowSharedArrayBuffer_id.init(cx, "allowSharedArrayBuffer") ||
72588 !atomsCache->allowSharedNullableArrayBufferView_id.init(cx, "allowSharedNullableArrayBufferView") ||
72589 !atomsCache->allowSharedArrayBufferView_id.init(cx, "allowSharedArrayBufferView") ||
72590 !atomsCache->allowSharedArrayBufferViewTypedef_id.init(cx, "allowSharedArrayBufferViewTypedef") ||
72591 !atomsCache->nonEnumerableMethod_id.init(cx, "nonEnumerableMethod") ||
72592 !atomsCache->nonEnumerableAttr_id.init(cx, "nonEnumerableAttr") ||
72593 !atomsCache->dashed_method_id.init(cx, "dashed-method") ||
72594 !atomsCache->dashed_attribute_id.init(cx, "dashed-attribute") ||
72595 !atomsCache->toJSON_id.init(cx, "toJSON") ||
72596 !atomsCache->toJSONShouldSkipThis3_id.init(cx, "toJSONShouldSkipThis3") ||
72597 !atomsCache->toJSONShouldSkipThis2_id.init(cx, "toJSONShouldSkipThis2") ||
72598 !atomsCache->toJSONShouldSkipThis_id.init(cx, "toJSONShouldSkipThis") ||
72599 !atomsCache->passArgsWithDefaults_id.init(cx, "passArgsWithDefaults") ||
72600 !atomsCache->ceReactionsAttr_id.init(cx, "ceReactionsAttr") ||
72601 !atomsCache->ceReactionsMethodOverload_id.init(cx, "ceReactionsMethodOverload") ||
72602 !atomsCache->ceReactionsMethod_id.init(cx, "ceReactionsMethod") ||
72603 !atomsCache->canOOMSetterAttr_id.init(cx, "canOOMSetterAttr") ||
72604 !atomsCache->canOOMGetterAttr_id.init(cx, "canOOMGetterAttr") ||
72605 !atomsCache->canOOMAttr_id.init(cx, "canOOMAttr") ||
72606 !atomsCache->canOOMMethod_id.init(cx, "canOOMMethod") ||
72607 !atomsCache->throwingSetterAttr_id.init(cx, "throwingSetterAttr") ||
72608 !atomsCache->throwingGetterAttr_id.init(cx, "throwingGetterAttr") ||
72609 !atomsCache->throwingAttr_id.init(cx, "throwingAttr") ||
72610 !atomsCache->throwingMethod_id.init(cx, "throwingMethod") ||
72611 !atomsCache->putForwardsAttr3_id.init(cx, "putForwardsAttr3") ||
72612 !atomsCache->putForwardsAttr2_id.init(cx, "putForwardsAttr2") ||
72613 !atomsCache->putForwardsAttr_id.init(cx, "putForwardsAttr") ||
72614 !atomsCache->passRenamedInterface_id.init(cx, "passRenamedInterface") ||
72615 !atomsCache->attrWithLenientThis_id.init(cx, "attrWithLenientThis") ||
72616 !atomsCache->conditionalOnSecureContext8_id.init(cx, "conditionalOnSecureContext8") ||
72617 !atomsCache->conditionalOnSecureContext7_id.init(cx, "conditionalOnSecureContext7") ||
72618 !atomsCache->conditionalOnSecureContext6_id.init(cx, "conditionalOnSecureContext6") ||
72619 !atomsCache->conditionalOnSecureContext5_id.init(cx, "conditionalOnSecureContext5") ||
72620 !atomsCache->conditionalOnSecureContext4_id.init(cx, "conditionalOnSecureContext4") ||
72621 !atomsCache->conditionalOnSecureContext3_id.init(cx, "conditionalOnSecureContext3") ||
72622 !atomsCache->conditionalOnSecureContext2_id.init(cx, "conditionalOnSecureContext2") ||
72623 !atomsCache->conditionalOnSecureContext1_id.init(cx, "conditionalOnSecureContext1") ||
72624 !atomsCache->prefable20_id.init(cx, "prefable20") ||
72625 !atomsCache->prefable19_id.init(cx, "prefable19") ||
72626 !atomsCache->prefable18_id.init(cx, "prefable18") ||
72627 !atomsCache->prefable17_id.init(cx, "prefable17") ||
72628 !atomsCache->prefable16_id.init(cx, "prefable16") ||
72629 !atomsCache->prefable15_id.init(cx, "prefable15") ||
72630 !atomsCache->prefable14_id.init(cx, "prefable14") ||
72631 !atomsCache->prefable13_id.init(cx, "prefable13") ||
72632 !atomsCache->prefable12_id.init(cx, "prefable12") ||
72633 !atomsCache->prefable11_id.init(cx, "prefable11") ||
72634 !atomsCache->prefable10_id.init(cx, "prefable10") ||
72635 !atomsCache->prefable9_id.init(cx, "prefable9") ||
72636 !atomsCache->prefable8_id.init(cx, "prefable8") ||
72637 !atomsCache->prefable7_id.init(cx, "prefable7") ||
72638 !atomsCache->prefable6_id.init(cx, "prefable6") ||
72639 !atomsCache->prefable5_id.init(cx, "prefable5") ||
72640 !atomsCache->prefable4_id.init(cx, "prefable4") ||
72641 !atomsCache->prefable3_id.init(cx, "prefable3") ||
72642 !atomsCache->prefable2_id.init(cx, "prefable2") ||
72643 !atomsCache->prefable1_id.init(cx, "prefable1") ||
72644 !atomsCache->passVariadicThirdArg_id.init(cx, "passVariadicThirdArg") ||
72645 !atomsCache->overload20_id.init(cx, "overload20") ||
72646 !atomsCache->overload19_id.init(cx, "overload19") ||
72647 !atomsCache->overload18_id.init(cx, "overload18") ||
72648 !atomsCache->overload17_id.init(cx, "overload17") ||
72649 !atomsCache->overload16_id.init(cx, "overload16") ||
72650 !atomsCache->overload15_id.init(cx, "overload15") ||
72651 !atomsCache->overload14_id.init(cx, "overload14") ||
72652 !atomsCache->overload13_id.init(cx, "overload13") ||
72653 !atomsCache->overload12_id.init(cx, "overload12") ||
72654 !atomsCache->overload11_id.init(cx, "overload11") ||
72655 !atomsCache->overload10_id.init(cx, "overload10") ||
72656 !atomsCache->overload9_id.init(cx, "overload9") ||
72657 !atomsCache->overload8_id.init(cx, "overload8") ||
72658 !atomsCache->overload7_id.init(cx, "overload7") ||
72659 !atomsCache->overload6_id.init(cx, "overload6") ||
72660 !atomsCache->overload5_id.init(cx, "overload5") ||
72661 !atomsCache->overload4_id.init(cx, "overload4") ||
72662 !atomsCache->overload3_id.init(cx, "overload3") ||
72663 !atomsCache->overload2_id.init(cx, "overload2") ||
72664 !atomsCache->overload1_id.init(cx, "overload1") ||
72665 !atomsCache->deprecatedMethodWithContext_id.init(cx, "deprecatedMethodWithContext") ||
72666 !atomsCache->deprecatedMethod_id.init(cx, "deprecatedMethod") ||
72667 !atomsCache->deprecatedAttribute_id.init(cx, "deprecatedAttribute") ||
72668 !atomsCache->exerciseTypedefInterfaces3_id.init(cx, "exerciseTypedefInterfaces3") ||
72669 !atomsCache->exerciseTypedefInterfaces2_id.init(cx, "exerciseTypedefInterfaces2") ||
72670 !atomsCache->exerciseTypedefInterfaces1_id.init(cx, "exerciseTypedefInterfaces1") ||
72671 !atomsCache->clampedByteNullable_id.init(cx, "clampedByteNullable") ||
72672 !atomsCache->clampedByte_id.init(cx, "clampedByte") ||
72673 !atomsCache->enforcedByteNullable_id.init(cx, "enforcedByteNullable") ||
72674 !atomsCache->enforcedByte_id.init(cx, "enforcedByte") ||
72675 !atomsCache->doClampNullable_id.init(cx, "doClampNullable") ||
72676 !atomsCache->doClamp_id.init(cx, "doClamp") ||
72677 !atomsCache->doEnforceRangeNullable_id.init(cx, "doEnforceRangeNullable") ||
72678 !atomsCache->doEnforceRange_id.init(cx, "doEnforceRange") ||
72679 !atomsCache->dontEnforceRangeOrClamp_id.init(cx, "dontEnforceRangeOrClamp") ||
72680 !atomsCache->passVariadicDictionary_id.init(cx, "passVariadicDictionary") ||
72681 !atomsCache->receiveDictContainingSequence_id.init(cx, "receiveDictContainingSequence") ||
72682 !atomsCache->passDictContainingSequence_id.init(cx, "passDictContainingSequence") ||
72683 !atomsCache->passDictContainingDict_id.init(cx, "passDictContainingDict") ||
72684 !atomsCache->passDictionaryOrLong_id.init(cx, "passDictionaryOrLong") ||
72685 !atomsCache->passRecordOfDictionaries_id.init(cx, "passRecordOfDictionaries") ||
72686 !atomsCache->passSequenceOfDictionaries_id.init(cx, "passSequenceOfDictionaries") ||
72687 !atomsCache->passOtherDictionary_id.init(cx, "passOtherDictionary") ||
72688 !atomsCache->receiveNullableDictionary_id.init(cx, "receiveNullableDictionary") ||
72689 !atomsCache->receiveDictionary_id.init(cx, "receiveDictionary") ||
72690 !atomsCache->passDictionary2_id.init(cx, "passDictionary2") ||
72691 !atomsCache->passDictionary_id.init(cx, "passDictionary") ||
72692 !atomsCache->attributeRenamedTo_id.init(cx, "attributeRenamedTo") ||
72693 !atomsCache->attributeGetterRenamedTo_id.init(cx, "attributeGetterRenamedTo") ||
72694 !atomsCache->methodRenamedTo_id.init(cx, "methodRenamedTo") ||
72695 !atomsCache->receiveAddrefedPromise_id.init(cx, "receiveAddrefedPromise") ||
72696 !atomsCache->receivePromise_id.init(cx, "receivePromise") ||
72697 !atomsCache->passPromiseSequence_id.init(cx, "passPromiseSequence") ||
72698 !atomsCache->passOptionalPromise_id.init(cx, "passOptionalPromise") ||
72699 !atomsCache->passPromise_id.init(cx, "passPromise") ||
72700 !atomsCache->writableNullableUnion_id.init(cx, "writableNullableUnion") ||
72701 !atomsCache->writableUnionContainingNull_id.init(cx, "writableUnionContainingNull") ||
72702 !atomsCache->writableUnion_id.init(cx, "writableUnion") ||
72703 !atomsCache->receiveNullableUnion2_id.init(cx, "receiveNullableUnion2") ||
72704 !atomsCache->receiveNullableUnion_id.init(cx, "receiveNullableUnion") ||
72705 !atomsCache->receiveUnionContainingNull_id.init(cx, "receiveUnionContainingNull") ||
72706 !atomsCache->receiveUnion2_id.init(cx, "receiveUnion2") ||
72707 !atomsCache->receiveUnion_id.init(cx, "receiveUnion") ||
72708 !atomsCache->passRecordOfUnions_id.init(cx, "passRecordOfUnions") ||
72709 !atomsCache->passVariadicNullableUnion_id.init(cx, "passVariadicNullableUnion") ||
72710 !atomsCache->passSequenceOfNullableUnions_id.init(cx, "passSequenceOfNullableUnions") ||
72711 !atomsCache->passVariadicUnion_id.init(cx, "passVariadicUnion") ||
72712 !atomsCache->passSequenceOfUnions2_id.init(cx, "passSequenceOfUnions2") ||
72713 !atomsCache->passSequenceOfUnions_id.init(cx, "passSequenceOfUnions") ||
72714 !atomsCache->passNullableUnionWithDefaultValue28_id.init(cx, "passNullableUnionWithDefaultValue28") ||
72715 !atomsCache->passNullableUnionWithDefaultValue27_id.init(cx, "passNullableUnionWithDefaultValue27") ||
72716 !atomsCache->passNullableUnionWithDefaultValue26_id.init(cx, "passNullableUnionWithDefaultValue26") ||
72717 !atomsCache->passNullableUnionWithDefaultValue25_id.init(cx, "passNullableUnionWithDefaultValue25") ||
72718 !atomsCache->passNullableUnionWithDefaultValue24_id.init(cx, "passNullableUnionWithDefaultValue24") ||
72719 !atomsCache->passNullableUnionWithDefaultValue23_id.init(cx, "passNullableUnionWithDefaultValue23") ||
72720 !atomsCache->passNullableUnionWithDefaultValue22_id.init(cx, "passNullableUnionWithDefaultValue22") ||
72721 !atomsCache->passNullableUnionWithDefaultValue21_id.init(cx, "passNullableUnionWithDefaultValue21") ||
72722 !atomsCache->passNullableUnionWithDefaultValue20_id.init(cx, "passNullableUnionWithDefaultValue20") ||
72723 !atomsCache->passNullableUnionWithDefaultValue19_id.init(cx, "passNullableUnionWithDefaultValue19") ||
72724 !atomsCache->passNullableUnionWithDefaultValue18_id.init(cx, "passNullableUnionWithDefaultValue18") ||
72725 !atomsCache->passNullableUnionWithDefaultValue17_id.init(cx, "passNullableUnionWithDefaultValue17") ||
72726 !atomsCache->passNullableUnionWithDefaultValue16_id.init(cx, "passNullableUnionWithDefaultValue16") ||
72727 !atomsCache->passNullableUnionWithDefaultValue15_id.init(cx, "passNullableUnionWithDefaultValue15") ||
72728 !atomsCache->passNullableUnionWithDefaultValue14_id.init(cx, "passNullableUnionWithDefaultValue14") ||
72729 !atomsCache->passNullableUnionWithDefaultValue13_id.init(cx, "passNullableUnionWithDefaultValue13") ||
72730 !atomsCache->passNullableUnionWithDefaultValue12_id.init(cx, "passNullableUnionWithDefaultValue12") ||
72731 !atomsCache->passNullableUnionWithDefaultValue11_id.init(cx, "passNullableUnionWithDefaultValue11") ||
72732 !atomsCache->passNullableUnionWithDefaultValue10_id.init(cx, "passNullableUnionWithDefaultValue10") ||
72733 !atomsCache->passNullableUnionWithDefaultValue9_id.init(cx, "passNullableUnionWithDefaultValue9") ||
72734 !atomsCache->passNullableUnionWithDefaultValue8_id.init(cx, "passNullableUnionWithDefaultValue8") ||
72735 !atomsCache->passNullableUnionWithDefaultValue7_id.init(cx, "passNullableUnionWithDefaultValue7") ||
72736 !atomsCache->passNullableUnionWithDefaultValue6_id.init(cx, "passNullableUnionWithDefaultValue6") ||
72737 !atomsCache->passNullableUnionWithDefaultValue5_id.init(cx, "passNullableUnionWithDefaultValue5") ||
72738 !atomsCache->passNullableUnionWithDefaultValue4_id.init(cx, "passNullableUnionWithDefaultValue4") ||
72739 !atomsCache->passNullableUnionWithDefaultValue3_id.init(cx, "passNullableUnionWithDefaultValue3") ||
72740 !atomsCache->passNullableUnionWithDefaultValue2_id.init(cx, "passNullableUnionWithDefaultValue2") ||
72741 !atomsCache->passNullableUnionWithDefaultValue1_id.init(cx, "passNullableUnionWithDefaultValue1") ||
72742 !atomsCache->passUnionWithDefaultValue25_id.init(cx, "passUnionWithDefaultValue25") ||
72743 !atomsCache->passUnionWithDefaultValue24_id.init(cx, "passUnionWithDefaultValue24") ||
72744 !atomsCache->passUnionWithDefaultValue23_id.init(cx, "passUnionWithDefaultValue23") ||
72745 !atomsCache->passUnionWithDefaultValue22_id.init(cx, "passUnionWithDefaultValue22") ||
72746 !atomsCache->passUnionWithDefaultValue21_id.init(cx, "passUnionWithDefaultValue21") ||
72747 !atomsCache->passUnionWithDefaultValue20_id.init(cx, "passUnionWithDefaultValue20") ||
72748 !atomsCache->passUnionWithDefaultValue19_id.init(cx, "passUnionWithDefaultValue19") ||
72749 !atomsCache->passUnionWithDefaultValue18_id.init(cx, "passUnionWithDefaultValue18") ||
72750 !atomsCache->passUnionWithDefaultValue17_id.init(cx, "passUnionWithDefaultValue17") ||
72751 !atomsCache->passUnionWithDefaultValue16_id.init(cx, "passUnionWithDefaultValue16") ||
72752 !atomsCache->passUnionWithDefaultValue15_id.init(cx, "passUnionWithDefaultValue15") ||
72753 !atomsCache->passUnionWithDefaultValue14_id.init(cx, "passUnionWithDefaultValue14") ||
72754 !atomsCache->passUnionWithDefaultValue13_id.init(cx, "passUnionWithDefaultValue13") ||
72755 !atomsCache->passUnionWithDefaultValue12_id.init(cx, "passUnionWithDefaultValue12") ||
72756 !atomsCache->passUnionWithDefaultValue11_id.init(cx, "passUnionWithDefaultValue11") ||
72757 !atomsCache->passUnionWithDefaultValue10_id.init(cx, "passUnionWithDefaultValue10") ||
72758 !atomsCache->passUnionWithDefaultValue9_id.init(cx, "passUnionWithDefaultValue9") ||
72759 !atomsCache->passUnionWithDefaultValue8_id.init(cx, "passUnionWithDefaultValue8") ||
72760 !atomsCache->passUnionWithDefaultValue7_id.init(cx, "passUnionWithDefaultValue7") ||
72761 !atomsCache->passUnionWithDefaultValue6_id.init(cx, "passUnionWithDefaultValue6") ||
72762 !atomsCache->passUnionWithDefaultValue5_id.init(cx, "passUnionWithDefaultValue5") ||
72763 !atomsCache->passUnionWithDefaultValue4_id.init(cx, "passUnionWithDefaultValue4") ||
72764 !atomsCache->passUnionWithDefaultValue3_id.init(cx, "passUnionWithDefaultValue3") ||
72765 !atomsCache->passUnionWithDefaultValue2_id.init(cx, "passUnionWithDefaultValue2") ||
72766 !atomsCache->passUnionWithDefaultValue1_id.init(cx, "passUnionWithDefaultValue1") ||
72767 !atomsCache->passUnionWithObject_id.init(cx, "passUnionWithObject") ||
72768 !atomsCache->passUnionWithEnum_id.init(cx, "passUnionWithEnum") ||
72769 !atomsCache->passUnionWithString_id.init(cx, "passUnionWithString") ||
72770 !atomsCache->passUnionWithTypedArraysOrNull_id.init(cx, "passUnionWithTypedArraysOrNull") ||
72771 !atomsCache->passUnionWithTypedArrays_id.init(cx, "passUnionWithTypedArrays") ||
72772 !atomsCache->passUnionWithArrayBufferOrNull_id.init(cx, "passUnionWithArrayBufferOrNull") ||
72773 !atomsCache->passUnionWithArrayBuffer_id.init(cx, "passUnionWithArrayBuffer") ||
72774 !atomsCache->passOptionalNullableUnionWithDefaultValue_id.init(cx, "passOptionalNullableUnionWithDefaultValue") ||
72775 !atomsCache->passOptionalNullableUnion_id.init(cx, "passOptionalNullableUnion") ||
72776 !atomsCache->passOptionalUnion_id.init(cx, "passOptionalUnion") ||
72777 !atomsCache->passNullableUnion_id.init(cx, "passNullableUnion") ||
72778 !atomsCache->passUnionWithNullable_id.init(cx, "passUnionWithNullable") ||
72779 !atomsCache->passUnionWithSVS_id.init(cx, "passUnionWithSVS") ||
72780 !atomsCache->passUnionWithSequenceAndRecord_id.init(cx, "passUnionWithSequenceAndRecord") ||
72781 !atomsCache->passUnionWithRecordAndSequence_id.init(cx, "passUnionWithRecordAndSequence") ||
72782 !atomsCache->passUnionWithRecord_id.init(cx, "passUnionWithRecord") ||
72783 !atomsCache->passUnionWithUTF8String_id.init(cx, "passUnionWithUTF8String") ||
72784 !atomsCache->passUnionWithByteString_id.init(cx, "passUnionWithByteString") ||
72785 !atomsCache->passUnionWithCallback_id.init(cx, "passUnionWithCallback") ||
72786 !atomsCache->passUnion28_id.init(cx, "passUnion28") ||
72787 !atomsCache->passUnion27_id.init(cx, "passUnion27") ||
72788 !atomsCache->passUnion26_id.init(cx, "passUnion26") ||
72789 !atomsCache->passUnion25_id.init(cx, "passUnion25") ||
72790 !atomsCache->passUnion24_id.init(cx, "passUnion24") ||
72791 !atomsCache->passUnion23_id.init(cx, "passUnion23") ||
72792 !atomsCache->passUnion22_id.init(cx, "passUnion22") ||
72793 !atomsCache->passUnion21_id.init(cx, "passUnion21") ||
72794 !atomsCache->passUnion20_id.init(cx, "passUnion20") ||
72795 !atomsCache->passUnion19_id.init(cx, "passUnion19") ||
72796 !atomsCache->passUnion18_id.init(cx, "passUnion18") ||
72797 !atomsCache->passUnion17_id.init(cx, "passUnion17") ||
72798 !atomsCache->passUnion16_id.init(cx, "passUnion16") ||
72799 !atomsCache->passUnion15_id.init(cx, "passUnion15") ||
72800 !atomsCache->passUnion14_id.init(cx, "passUnion14") ||
72801 !atomsCache->passUnion13_id.init(cx, "passUnion13") ||
72802 !atomsCache->passUnion12_id.init(cx, "passUnion12") ||
72803 !atomsCache->passUnion11_id.init(cx, "passUnion11") ||
72804 !atomsCache->passUnion10_id.init(cx, "passUnion10") ||
72805 !atomsCache->passUnion9_id.init(cx, "passUnion9") ||
72806 !atomsCache->passUnion8_id.init(cx, "passUnion8") ||
72807 !atomsCache->passUnion7_id.init(cx, "passUnion7") ||
72808 !atomsCache->passUnion6_id.init(cx, "passUnion6") ||
72809 !atomsCache->passUnion5_id.init(cx, "passUnion5") ||
72810 !atomsCache->passUnion4_id.init(cx, "passUnion4") ||
72811 !atomsCache->passUnion3_id.init(cx, "passUnion3") ||
72812 !atomsCache->passUnion2_id.init(cx, "passUnion2") ||
72813 !atomsCache->passUnion_id.init(cx, "passUnion") ||
72814 !atomsCache->receiveNullableObject_id.init(cx, "receiveNullableObject") ||
72815 !atomsCache->receiveObject_id.init(cx, "receiveObject") ||
72816 !atomsCache->passRecordOfObject_id.init(cx, "passRecordOfObject") ||
72817 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject") ||
72818 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfObject") ||
72819 !atomsCache->passNullableSequenceOfObject_id.init(cx, "passNullableSequenceOfObject") ||
72820 !atomsCache->passSequenceOfNullableObject_id.init(cx, "passSequenceOfNullableObject") ||
72821 !atomsCache->passSequenceOfObject_id.init(cx, "passSequenceOfObject") ||
72822 !atomsCache->passOptionalNullableObjectWithDefaultValue_id.init(cx, "passOptionalNullableObjectWithDefaultValue") ||
72823 !atomsCache->passOptionalNullableObject_id.init(cx, "passOptionalNullableObject") ||
72824 !atomsCache->passOptionalObject_id.init(cx, "passOptionalObject") ||
72825 !atomsCache->passVariadicNullableObject_id.init(cx, "passVariadicNullableObject") ||
72826 !atomsCache->passNullableObject_id.init(cx, "passNullableObject") ||
72827 !atomsCache->passVariadicObject_id.init(cx, "passVariadicObject") ||
72828 !atomsCache->passObject_id.init(cx, "passObject") ||
72829 !atomsCache->receiveAny_id.init(cx, "receiveAny") ||
72830 !atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableRecordOfAny") ||
72831 !atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableRecordOfNullableSequenceOfAny") ||
72832 !atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfNullableRecordOfAny") ||
72833 !atomsCache->passNullableRecordOfNullableRecordOfAny_id.init(cx, "passNullableRecordOfNullableRecordOfAny") ||
72834 !atomsCache->passRecordOfNullableRecordOfAny_id.init(cx, "passRecordOfNullableRecordOfAny") ||
72835 !atomsCache->passRecordOfRecordOfAny_id.init(cx, "passRecordOfRecordOfAny") ||
72836 !atomsCache->passOptionalRecordOfAnyWithDefaultValue_id.init(cx, "passOptionalRecordOfAnyWithDefaultValue") ||
72837 !atomsCache->passOptionalNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfAny") ||
72838 !atomsCache->passOptionalRecordOfAny_id.init(cx, "passOptionalRecordOfAny") ||
72839 !atomsCache->passNullableRecordOfAny_id.init(cx, "passNullableRecordOfAny") ||
72840 !atomsCache->passRecordOfAny_id.init(cx, "passRecordOfAny") ||
72841 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfAny") ||
72842 !atomsCache->passNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfNullableSequenceOfAny") ||
72843 !atomsCache->passSequenceOfNullableSequenceOfAny_id.init(cx, "passSequenceOfNullableSequenceOfAny") ||
72844 !atomsCache->passSequenceOfSequenceOfAny_id.init(cx, "passSequenceOfSequenceOfAny") ||
72845 !atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id.init(cx, "passOptionalSequenceOfAnyWithDefaultValue") ||
72846 !atomsCache->passOptionalNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfAny") ||
72847 !atomsCache->passOptionalSequenceOfAny_id.init(cx, "passOptionalSequenceOfAny") ||
72848 !atomsCache->passNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfAny") ||
72849 !atomsCache->passSequenceOfAny_id.init(cx, "passSequenceOfAny") ||
72850 !atomsCache->passAnyDefaultNull_id.init(cx, "passAnyDefaultNull") ||
72851 !atomsCache->passOptionalAny_id.init(cx, "passOptionalAny") ||
72852 !atomsCache->passVariadicAny_id.init(cx, "passVariadicAny") ||
72853 !atomsCache->passAny_id.init(cx, "passAny") ||
72854 !atomsCache->passOptionalNullableTreatAsNullCallbackWithDefaultValue_id.init(cx, "passOptionalNullableTreatAsNullCallbackWithDefaultValue") ||
72855 !atomsCache->receiveNullableCallback_id.init(cx, "receiveNullableCallback") ||
72856 !atomsCache->receiveCallback_id.init(cx, "receiveCallback") ||
72857 !atomsCache->passOptionalNullableCallbackWithDefaultValue_id.init(cx, "passOptionalNullableCallbackWithDefaultValue") ||
72858 !atomsCache->passOptionalNullableCallback_id.init(cx, "passOptionalNullableCallback") ||
72859 !atomsCache->passOptionalCallback_id.init(cx, "passOptionalCallback") ||
72860 !atomsCache->passNullableCallback_id.init(cx, "passNullableCallback") ||
72861 !atomsCache->passCallback_id.init(cx, "passCallback") ||
72862 !atomsCache->readonlyEnumAttribute_id.init(cx, "readonlyEnumAttribute") ||
72863 !atomsCache->enumAttribute_id.init(cx, "enumAttribute") ||
72864 !atomsCache->receiveNullableEnum_id.init(cx, "receiveNullableEnum") ||
72865 !atomsCache->receiveEnum_id.init(cx, "receiveEnum") ||
72866 !atomsCache->passOptionalNullableEnumWithDefaultValue2_id.init(cx, "passOptionalNullableEnumWithDefaultValue2") ||
72867 !atomsCache->passOptionalNullableEnumWithDefaultValue_id.init(cx, "passOptionalNullableEnumWithDefaultValue") ||
72868 !atomsCache->passOptionalNullableEnum_id.init(cx, "passOptionalNullableEnum") ||
72869 !atomsCache->passEnumWithDefault_id.init(cx, "passEnumWithDefault") ||
72870 !atomsCache->passOptionalEnum_id.init(cx, "passOptionalEnum") ||
72871 !atomsCache->passNullableEnum_id.init(cx, "passNullableEnum") ||
72872 !atomsCache->passEnum_id.init(cx, "passEnum") ||
72873 !atomsCache->jsStringAttr_id.init(cx, "jsStringAttr") ||
72874 !atomsCache->readonlyJSStringAttr_id.init(cx, "readonlyJSStringAttr") ||
72875 !atomsCache->receiveJSString_id.init(cx, "receiveJSString") ||
72876 !atomsCache->passOptionalJSStringWithDefaultValue_id.init(cx, "passOptionalJSStringWithDefaultValue") ||
72877 !atomsCache->passJSString_id.init(cx, "passJSString") ||
72878 !atomsCache->receiveSVS_id.init(cx, "receiveSVS") ||
72879 !atomsCache->passVariadicSVS_id.init(cx, "passVariadicSVS") ||
72880 !atomsCache->passOptionalNullableSVSWithDefaultValue_id.init(cx, "passOptionalNullableSVSWithDefaultValue") ||
72881 !atomsCache->passOptionalNullableSVS_id.init(cx, "passOptionalNullableSVS") ||
72882 !atomsCache->passOptionalSVSWithDefaultValue_id.init(cx, "passOptionalSVSWithDefaultValue") ||
72883 !atomsCache->passOptionalSVS_id.init(cx, "passOptionalSVS") ||
72884 !atomsCache->passNullableSVS_id.init(cx, "passNullableSVS") ||
72885 !atomsCache->passSVS_id.init(cx, "passSVS") ||
72886 !atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id.init(cx, "passOptionalUnionUTF8StringWithDefaultValue") ||
72887 !atomsCache->passOptionalUnionUTF8String_id.init(cx, "passOptionalUnionUTF8String") ||
72888 !atomsCache->passUnionUTF8String_id.init(cx, "passUnionUTF8String") ||
72889 !atomsCache->passVariadicUTF8String_id.init(cx, "passVariadicUTF8String") ||
72890 !atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id.init(cx, "passOptionalNullableUTF8StringWithDefaultValue") ||
72891 !atomsCache->passOptionalNullableUTF8String_id.init(cx, "passOptionalNullableUTF8String") ||
72892 !atomsCache->passOptionalUTF8StringWithDefaultValue_id.init(cx, "passOptionalUTF8StringWithDefaultValue") ||
72893 !atomsCache->passOptionalUTF8String_id.init(cx, "passOptionalUTF8String") ||
72894 !atomsCache->passNullableUTF8String_id.init(cx, "passNullableUTF8String") ||
72895 !atomsCache->passUTF8String_id.init(cx, "passUTF8String") ||
72896 !atomsCache->passOptionalUnionByteStringWithDefaultValue_id.init(cx, "passOptionalUnionByteStringWithDefaultValue") ||
72897 !atomsCache->passOptionalUnionByteString_id.init(cx, "passOptionalUnionByteString") ||
72898 !atomsCache->passUnionByteString_id.init(cx, "passUnionByteString") ||
72899 !atomsCache->passVariadicByteString_id.init(cx, "passVariadicByteString") ||
72900 !atomsCache->passOptionalNullableByteStringWithDefaultValue_id.init(cx, "passOptionalNullableByteStringWithDefaultValue") ||
72901 !atomsCache->passOptionalNullableByteString_id.init(cx, "passOptionalNullableByteString") ||
72902 !atomsCache->passOptionalByteStringWithDefaultValue_id.init(cx, "passOptionalByteStringWithDefaultValue") ||
72903 !atomsCache->passOptionalByteString_id.init(cx, "passOptionalByteString") ||
72904 !atomsCache->passNullableByteString_id.init(cx, "passNullableByteString") ||
72905 !atomsCache->passByteString_id.init(cx, "passByteString") ||
72906 !atomsCache->passVariadicString_id.init(cx, "passVariadicString") ||
72907 !atomsCache->passOptionalNullableStringWithDefaultValue_id.init(cx, "passOptionalNullableStringWithDefaultValue") ||
72908 !atomsCache->passOptionalNullableString_id.init(cx, "passOptionalNullableString") ||
72909 !atomsCache->passOptionalStringWithDefaultValue_id.init(cx, "passOptionalStringWithDefaultValue") ||
72910 !atomsCache->passOptionalString_id.init(cx, "passOptionalString") ||
72911 !atomsCache->passNullableString_id.init(cx, "passNullableString") ||
72912 !atomsCache->passString_id.init(cx, "passString") ||
72913 !atomsCache->uint8ArrayAttr_id.init(cx, "uint8ArrayAttr") ||
72914 !atomsCache->receiveUint8Array_id.init(cx, "receiveUint8Array") ||
72915 !atomsCache->passVariadicNullableTypedArray_id.init(cx, "passVariadicNullableTypedArray") ||
72916 !atomsCache->passVariadicTypedArray_id.init(cx, "passVariadicTypedArray") ||
72917 !atomsCache->passRecordOfNullableArrayBuffers_id.init(cx, "passRecordOfNullableArrayBuffers") ||
72918 !atomsCache->passRecordOfArrayBuffers_id.init(cx, "passRecordOfArrayBuffers") ||
72919 !atomsCache->passSequenceOfNullableArrayBuffers_id.init(cx, "passSequenceOfNullableArrayBuffers") ||
72920 !atomsCache->passSequenceOfArrayBuffers_id.init(cx, "passSequenceOfArrayBuffers") ||
72921 !atomsCache->passFloat64Array_id.init(cx, "passFloat64Array") ||
72922 !atomsCache->passFloat32Array_id.init(cx, "passFloat32Array") ||
72923 !atomsCache->passUint8ClampedArray_id.init(cx, "passUint8ClampedArray") ||
72924 !atomsCache->passUint32Array_id.init(cx, "passUint32Array") ||
72925 !atomsCache->passUint16Array_id.init(cx, "passUint16Array") ||
72926 !atomsCache->passUint8Array_id.init(cx, "passUint8Array") ||
72927 !atomsCache->passInt32Array_id.init(cx, "passInt32Array") ||
72928 !atomsCache->passInt16Array_id.init(cx, "passInt16Array") ||
72929 !atomsCache->passInt8Array_id.init(cx, "passInt8Array") ||
72930 !atomsCache->passArrayBufferView_id.init(cx, "passArrayBufferView") ||
72931 !atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id.init(cx, "passOptionalNullableArrayBufferWithDefaultValue") ||
72932 !atomsCache->passOptionalNullableArrayBuffer_id.init(cx, "passOptionalNullableArrayBuffer") ||
72933 !atomsCache->passOptionalArrayBuffer_id.init(cx, "passOptionalArrayBuffer") ||
72934 !atomsCache->passNullableArrayBuffer_id.init(cx, "passNullableArrayBuffer") ||
72935 !atomsCache->passArrayBuffer_id.init(cx, "passArrayBuffer") ||
72936 !atomsCache->receiveAnyRecord_id.init(cx, "receiveAnyRecord") ||
72937 !atomsCache->receiveNullableRecordOfNullableInts_id.init(cx, "receiveNullableRecordOfNullableInts") ||
72938 !atomsCache->receiveRecordOfNullableInts_id.init(cx, "receiveRecordOfNullableInts") ||
72939 !atomsCache->receiveNullableRecord_id.init(cx, "receiveNullableRecord") ||
72940 !atomsCache->receiveRecord_id.init(cx, "receiveRecord") ||
72941 !atomsCache->passRecordOfRecords_id.init(cx, "passRecordOfRecords") ||
72942 !atomsCache->passUTF8StringRecord_id.init(cx, "passUTF8StringRecord") ||
72943 !atomsCache->passByteStringRecord_id.init(cx, "passByteStringRecord") ||
72944 !atomsCache->passStringRecord_id.init(cx, "passStringRecord") ||
72945 !atomsCache->passNullableExternalInterfaceRecord_id.init(cx, "passNullableExternalInterfaceRecord") ||
72946 !atomsCache->passExternalInterfaceRecord_id.init(cx, "passExternalInterfaceRecord") ||
72947 !atomsCache->passOptionalObjectRecord_id.init(cx, "passOptionalObjectRecord") ||
72948 !atomsCache->passOptionalNullableRecordWithDefaultValue_id.init(cx, "passOptionalNullableRecordWithDefaultValue") ||
72949 !atomsCache->passOptionalNullableRecord_id.init(cx, "passOptionalNullableRecord") ||
72950 !atomsCache->passOptionalRecord_id.init(cx, "passOptionalRecord") ||
72951 !atomsCache->passNullableCastableObjectNullableRecord_id.init(cx, "passNullableCastableObjectNullableRecord") ||
72952 !atomsCache->passCastableObjectNullableRecord_id.init(cx, "passCastableObjectNullableRecord") ||
72953 !atomsCache->passNullableCastableObjectRecord_id.init(cx, "passNullableCastableObjectRecord") ||
72954 !atomsCache->passCastableObjectRecord_id.init(cx, "passCastableObjectRecord") ||
72955 !atomsCache->passOptionalNullableRecordOfNullableInts_id.init(cx, "passOptionalNullableRecordOfNullableInts") ||
72956 !atomsCache->passOptionalRecordOfNullableInts_id.init(cx, "passOptionalRecordOfNullableInts") ||
72957 !atomsCache->passRecordOfNullableInts_id.init(cx, "passRecordOfNullableInts") ||
72958 !atomsCache->passNullableRecord_id.init(cx, "passNullableRecord") ||
72959 !atomsCache->passRecord_id.init(cx, "passRecord") ||
72960 !atomsCache->passSequenceOfSequencesOfSequences_id.init(cx, "passSequenceOfSequencesOfSequences") ||
72961 !atomsCache->passSequenceOfSequences_id.init(cx, "passSequenceOfSequences") ||
72962 !atomsCache->receiveNullableObjectSequence_id.init(cx, "receiveNullableObjectSequence") ||
72963 !atomsCache->receiveObjectSequence_id.init(cx, "receiveObjectSequence") ||
72964 !atomsCache->receiveNullableAnySequence_id.init(cx, "receiveNullableAnySequence") ||
72965 !atomsCache->receiveAnySequence_id.init(cx, "receiveAnySequence") ||
72966 !atomsCache->receiveUTF8StringSequence_id.init(cx, "receiveUTF8StringSequence") ||
72967 !atomsCache->receiveByteStringSequence_id.init(cx, "receiveByteStringSequence") ||
72968 !atomsCache->receiveStringSequence_id.init(cx, "receiveStringSequence") ||
72969 !atomsCache->passNullableExternalInterfaceSequence_id.init(cx, "passNullableExternalInterfaceSequence") ||
72970 !atomsCache->passExternalInterfaceSequence_id.init(cx, "passExternalInterfaceSequence") ||
72971 !atomsCache->passOptionalObjectSequence_id.init(cx, "passOptionalObjectSequence") ||
72972 !atomsCache->passOptionalNullableSequenceWithDefaultValue2_id.init(cx, "passOptionalNullableSequenceWithDefaultValue2") ||
72973 !atomsCache->passOptionalNullableSequenceWithDefaultValue_id.init(cx, "passOptionalNullableSequenceWithDefaultValue") ||
72974 !atomsCache->passOptionalNullableSequence_id.init(cx, "passOptionalNullableSequence") ||
72975 !atomsCache->passOptionalSequenceWithDefaultValue_id.init(cx, "passOptionalSequenceWithDefaultValue") ||
72976 !atomsCache->passOptionalSequence_id.init(cx, "passOptionalSequence") ||
72977 !atomsCache->passNullableCastableObjectNullableSequence_id.init(cx, "passNullableCastableObjectNullableSequence") ||
72978 !atomsCache->passCastableObjectNullableSequence_id.init(cx, "passCastableObjectNullableSequence") ||
72979 !atomsCache->passNullableCastableObjectSequence_id.init(cx, "passNullableCastableObjectSequence") ||
72980 !atomsCache->passCastableObjectSequence_id.init(cx, "passCastableObjectSequence") ||
72981 !atomsCache->receiveWeakNullableCastableObjectNullableSequence_id.init(cx, "receiveWeakNullableCastableObjectNullableSequence") ||
72982 !atomsCache->receiveWeakCastableObjectNullableSequence_id.init(cx, "receiveWeakCastableObjectNullableSequence") ||
72983 !atomsCache->receiveWeakNullableCastableObjectSequence_id.init(cx, "receiveWeakNullableCastableObjectSequence") ||
72984 !atomsCache->receiveWeakCastableObjectSequence_id.init(cx, "receiveWeakCastableObjectSequence") ||
72985 !atomsCache->receiveNullableCastableObjectNullableSequence_id.init(cx, "receiveNullableCastableObjectNullableSequence") ||
72986 !atomsCache->receiveCastableObjectNullableSequence_id.init(cx, "receiveCastableObjectNullableSequence") ||
72987 !atomsCache->receiveNullableCallbackObjectSequence_id.init(cx, "receiveNullableCallbackObjectSequence") ||
72988 !atomsCache->receiveNullableCastableObjectSequence_id.init(cx, "receiveNullableCastableObjectSequence") ||
72989 !atomsCache->receiveCallbackObjectSequence_id.init(cx, "receiveCallbackObjectSequence") ||
72990 !atomsCache->receiveCastableObjectSequence_id.init(cx, "receiveCastableObjectSequence") ||
72991 !atomsCache->passOptionalNullableSequenceOfNullableInts_id.init(cx, "passOptionalNullableSequenceOfNullableInts") ||
72992 !atomsCache->passOptionalSequenceOfNullableInts_id.init(cx, "passOptionalSequenceOfNullableInts") ||
72993 !atomsCache->passSequenceOfNullableInts_id.init(cx, "passSequenceOfNullableInts") ||
72994 !atomsCache->passNullableSequence_id.init(cx, "passNullableSequence") ||
72995 !atomsCache->passSequence_id.init(cx, "passSequence") ||
72996 !atomsCache->receiveNullableSequenceOfNullableInts_id.init(cx, "receiveNullableSequenceOfNullableInts") ||
72997 !atomsCache->receiveSequenceOfNullableInts_id.init(cx, "receiveSequenceOfNullableInts") ||
72998 !atomsCache->receiveNullableSequence_id.init(cx, "receiveNullableSequence") ||
72999 !atomsCache->receiveSequence_id.init(cx, "receiveSequence") ||
73000 !atomsCache->passOptionalCallbackInterfaceWithDefault_id.init(cx, "passOptionalCallbackInterfaceWithDefault") ||
73001 !atomsCache->passOptionalNonNullCallbackInterface_id.init(cx, "passOptionalNonNullCallbackInterface") ||
73002 !atomsCache->passOptionalCallbackInterface_id.init(cx, "passOptionalCallbackInterface") ||
73003 !atomsCache->nullableCallbackInterface_id.init(cx, "nullableCallbackInterface") ||
73004 !atomsCache->nonNullCallbackInterface_id.init(cx, "nonNullCallbackInterface") ||
73005 !atomsCache->passNullableCallbackInterface_id.init(cx, "passNullableCallbackInterface") ||
73006 !atomsCache->passCallbackInterface_id.init(cx, "passCallbackInterface") ||
73007 !atomsCache->receiveWeakNullableCallbackInterface_id.init(cx, "receiveWeakNullableCallbackInterface") ||
73008 !atomsCache->receiveWeakCallbackInterface_id.init(cx, "receiveWeakCallbackInterface") ||
73009 !atomsCache->receiveNullableCallbackInterface_id.init(cx, "receiveNullableCallbackInterface") ||
73010 !atomsCache->receiveCallbackInterface_id.init(cx, "receiveCallbackInterface") ||
73011 !atomsCache->passOptionalExternalWithDefault_id.init(cx, "passOptionalExternalWithDefault") ||
73012 !atomsCache->passOptionalNonNullExternal_id.init(cx, "passOptionalNonNullExternal") ||
73013 !atomsCache->passOptionalExternal_id.init(cx, "passOptionalExternal") ||
73014 !atomsCache->nullableExternal_id.init(cx, "nullableExternal") ||
73015 !atomsCache->nonNullExternal_id.init(cx, "nonNullExternal") ||
73016 !atomsCache->passNullableExternal_id.init(cx, "passNullableExternal") ||
73017 !atomsCache->passExternal_id.init(cx, "passExternal") ||
73018 !atomsCache->receiveWeakNullableExternal_id.init(cx, "receiveWeakNullableExternal") ||
73019 !atomsCache->receiveWeakExternal_id.init(cx, "receiveWeakExternal") ||
73020 !atomsCache->receiveNullableExternal_id.init(cx, "receiveNullableExternal") ||
73021 !atomsCache->receiveExternal_id.init(cx, "receiveExternal") ||
73022 !atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceNullableSequence") ||
73023 !atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNonWrapperCacheInterfaceNullableSequence") ||
73024 !atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceSequence") ||
73025 !atomsCache->receiveNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNonWrapperCacheInterfaceSequence") ||
73026 !atomsCache->receiveNullableNonWrapperCacheInterface_id.init(cx, "receiveNullableNonWrapperCacheInterface") ||
73027 !atomsCache->receiveNonWrapperCacheInterface_id.init(cx, "receiveNonWrapperCacheInterface") ||
73028 !atomsCache->passOptionalSelfWithDefault_id.init(cx, "passOptionalSelfWithDefault") ||
73029 !atomsCache->passOptionalNonNullSelf_id.init(cx, "passOptionalNonNullSelf") ||
73030 !atomsCache->passOptionalSelf_id.init(cx, "passOptionalSelf") ||
73031 !atomsCache->nullableSelf_id.init(cx, "nullableSelf") ||
73032 !atomsCache->nonNullSelf_id.init(cx, "nonNullSelf") ||
73033 !atomsCache->passNullableSelf_id.init(cx, "passNullableSelf") ||
73034 !atomsCache->passSelf_id.init(cx, "passSelf") ||
73035 !atomsCache->receiveWeakNullableSelf_id.init(cx, "receiveWeakNullableSelf") ||
73036 !atomsCache->receiveWeakSelf_id.init(cx, "receiveWeakSelf") ||
73037 !atomsCache->receiveNullableSelf_id.init(cx, "receiveNullableSelf") ||
73038 !atomsCache->receiveSelf_id.init(cx, "receiveSelf") ||
73039 !atomsCache->lenientDoubleAttr_id.init(cx, "lenientDoubleAttr") ||
73040 !atomsCache->lenientFloatAttr_id.init(cx, "lenientFloatAttr") ||
73041 !atomsCache->passLenientFloat_id.init(cx, "passLenientFloat") ||
73042 !atomsCache->passFloat_id.init(cx, "passFloat") ||
73043 !atomsCache->writableNullableUnrestrictedDouble_id.init(cx, "writableNullableUnrestrictedDouble") ||
73044 !atomsCache->writableNullableDouble_id.init(cx, "writableNullableDouble") ||
73045 !atomsCache->writableUnrestrictedDouble_id.init(cx, "writableUnrestrictedDouble") ||
73046 !atomsCache->writableDouble_id.init(cx, "writableDouble") ||
73047 !atomsCache->writableNullableUnrestrictedFloat_id.init(cx, "writableNullableUnrestrictedFloat") ||
73048 !atomsCache->writableNullableFloat_id.init(cx, "writableNullableFloat") ||
73049 !atomsCache->writableUnrestrictedFloat_id.init(cx, "writableUnrestrictedFloat") ||
73050 !atomsCache->writableFloat_id.init(cx, "writableFloat") ||
73051 !atomsCache->passOptionalUnsignedLongLongWithDefault_id.init(cx, "passOptionalUnsignedLongLongWithDefault") ||
73052 !atomsCache->passOptionalUnsignedLongLong_id.init(cx, "passOptionalUnsignedLongLong") ||
73053 !atomsCache->receiveUnsignedLongLong_id.init(cx, "receiveUnsignedLongLong") ||
73054 !atomsCache->passUnsignedLongLong_id.init(cx, "passUnsignedLongLong") ||
73055 !atomsCache->writableUnsignedLongLong_id.init(cx, "writableUnsignedLongLong") ||
73056 !atomsCache->readonlyUnsignedLongLong_id.init(cx, "readonlyUnsignedLongLong") ||
73057 !atomsCache->passOptionalUnsignedLongWithDefault_id.init(cx, "passOptionalUnsignedLongWithDefault") ||
73058 !atomsCache->passOptionalUnsignedLong_id.init(cx, "passOptionalUnsignedLong") ||
73059 !atomsCache->receiveUnsignedLong_id.init(cx, "receiveUnsignedLong") ||
73060 !atomsCache->passUnsignedLong_id.init(cx, "passUnsignedLong") ||
73061 !atomsCache->writableUnsignedLong_id.init(cx, "writableUnsignedLong") ||
73062 !atomsCache->readonlyUnsignedLong_id.init(cx, "readonlyUnsignedLong") ||
73063 !atomsCache->passOptionalUnsignedShortWithDefault_id.init(cx, "passOptionalUnsignedShortWithDefault") ||
73064 !atomsCache->passOptionalUnsignedShort_id.init(cx, "passOptionalUnsignedShort") ||
73065 !atomsCache->receiveUnsignedShort_id.init(cx, "receiveUnsignedShort") ||
73066 !atomsCache->passUnsignedShort_id.init(cx, "passUnsignedShort") ||
73067 !atomsCache->writableUnsignedShort_id.init(cx, "writableUnsignedShort") ||
73068 !atomsCache->readonlyUnsignedShort_id.init(cx, "readonlyUnsignedShort") ||
73069 !atomsCache->passOptionalOctetWithDefault_id.init(cx, "passOptionalOctetWithDefault") ||
73070 !atomsCache->passOptionalOctet_id.init(cx, "passOptionalOctet") ||
73071 !atomsCache->receiveOctet_id.init(cx, "receiveOctet") ||
73072 !atomsCache->passOctet_id.init(cx, "passOctet") ||
73073 !atomsCache->writableOctet_id.init(cx, "writableOctet") ||
73074 !atomsCache->readonlyOctet_id.init(cx, "readonlyOctet") ||
73075 !atomsCache->passOptionalLongLongWithDefault_id.init(cx, "passOptionalLongLongWithDefault") ||
73076 !atomsCache->passOptionalLongLong_id.init(cx, "passOptionalLongLong") ||
73077 !atomsCache->receiveLongLong_id.init(cx, "receiveLongLong") ||
73078 !atomsCache->passLongLong_id.init(cx, "passLongLong") ||
73079 !atomsCache->writableLongLong_id.init(cx, "writableLongLong") ||
73080 !atomsCache->readonlyLongLong_id.init(cx, "readonlyLongLong") ||
73081 !atomsCache->passOptionalLongWithDefault_id.init(cx, "passOptionalLongWithDefault") ||
73082 !atomsCache->passOptionalLong_id.init(cx, "passOptionalLong") ||
73083 !atomsCache->receiveLong_id.init(cx, "receiveLong") ||
73084 !atomsCache->passLong_id.init(cx, "passLong") ||
73085 !atomsCache->writableLong_id.init(cx, "writableLong") ||
73086 !atomsCache->readonlyLong_id.init(cx, "readonlyLong") ||
73087 !atomsCache->passOptionalShortWithDefault_id.init(cx, "passOptionalShortWithDefault") ||
73088 !atomsCache->passOptionalShort_id.init(cx, "passOptionalShort") ||
73089 !atomsCache->receiveShort_id.init(cx, "receiveShort") ||
73090 !atomsCache->passShort_id.init(cx, "passShort") ||
73091 !atomsCache->writableShort_id.init(cx, "writableShort") ||
73092 !atomsCache->readonlyShort_id.init(cx, "readonlyShort") ||
73093 !atomsCache->returnDeviceStateDependentByte_id.init(cx, "returnDeviceStateDependentByte") ||
73094 !atomsCache->returnConstantByte_id.init(cx, "returnConstantByte") ||
73095 !atomsCache->returnDOMDependentByte_id.init(cx, "returnDOMDependentByte") ||
73096 !atomsCache->returnByteSideEffectFree_id.init(cx, "returnByteSideEffectFree") ||
73097 !atomsCache->deviceStateDependentByte_id.init(cx, "deviceStateDependentByte") ||
73098 !atomsCache->constantByte_id.init(cx, "constantByte") ||
73099 !atomsCache->domDependentByte_id.init(cx, "domDependentByte") ||
73100 !atomsCache->sideEffectFreeByte_id.init(cx, "sideEffectFreeByte") ||
73101 !atomsCache->passVariadicByte_id.init(cx, "passVariadicByte") ||
73102 !atomsCache->passOptionalNullableByte_id.init(cx, "passOptionalNullableByte") ||
73103 !atomsCache->passNullableByte_id.init(cx, "passNullableByte") ||
73104 !atomsCache->passOptionalByteWithDefaultBeforeRequired_id.init(cx, "passOptionalByteWithDefaultBeforeRequired") ||
73105 !atomsCache->passOptionalByteWithDefault_id.init(cx, "passOptionalByteWithDefault") ||
73106 !atomsCache->passOptionalByteBeforeRequired_id.init(cx, "passOptionalByteBeforeRequired") ||
73107 !atomsCache->passOptionalByte_id.init(cx, "passOptionalByte") ||
73108 !atomsCache->receiveByte_id.init(cx, "receiveByte") ||
73109 !atomsCache->passByte_id.init(cx, "passByte") ||
73110 !atomsCache->writableByte_id.init(cx, "writableByte") ||
73111 !atomsCache->readonlyByte_id.init(cx, "readonlyByte")) {
73112 return false;
73113 }
73114 return true;
73115}
73116
73117
73118int8_t
73119TestJSImplInterfaceJSImpl::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm)
73120{
73121 CallSetup s(this, aRv, "TestJSImplInterface.readonlyByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73122 if (aRv.Failed()) {
73123 return int8_t(0);
73124 }
73125 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73125); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73125); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73126 BindingCallContext& cx = s.GetCallContext();
73127
73128 JS::Rooted<JS::Value> rval(cx);
73129
73130 JS::Rooted<JSObject *> callback(cx, mCallback);
73131 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73132 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73133 && !InitIds(cx, atomsCache)) ||
73134 !JS_GetPropertyById(cx, callback, atomsCache->readonlyByte_id, &rval)) {
73135 aRv.Throw(NS_ERROR_UNEXPECTED);
73136 return int8_t(0);
73137 }
73138 int8_t rvalDecl;
73139 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyByte", &rvalDecl)) {
73140 aRv.Throw(NS_ERROR_UNEXPECTED);
73141 return int8_t(0);
73142 }
73143 return rvalDecl;
73144}
73145
73146int8_t
73147TestJSImplInterfaceJSImpl::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm)
73148{
73149 CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73150 if (aRv.Failed()) {
73151 return int8_t(0);
73152 }
73153 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73153); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73153); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73154 BindingCallContext& cx = s.GetCallContext();
73155
73156 JS::Rooted<JS::Value> rval(cx);
73157
73158 JS::Rooted<JSObject *> callback(cx, mCallback);
73159 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73160 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73161 && !InitIds(cx, atomsCache)) ||
73162 !JS_GetPropertyById(cx, callback, atomsCache->writableByte_id, &rval)) {
73163 aRv.Throw(NS_ERROR_UNEXPECTED);
73164 return int8_t(0);
73165 }
73166 int8_t rvalDecl;
73167 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableByte", &rvalDecl)) {
73168 aRv.Throw(NS_ERROR_UNEXPECTED);
73169 return int8_t(0);
73170 }
73171 return rvalDecl;
73172}
73173
73174int8_t
73175TestJSImplInterfaceJSImpl::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm)
73176{
73177 CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73178 if (aRv.Failed()) {
73179 return int8_t(0);
73180 }
73181 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73181); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73181); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73182 BindingCallContext& cx = s.GetCallContext();
73183
73184 JS::Rooted<JS::Value> rval(cx);
73185
73186 JS::Rooted<JSObject *> callback(cx, mCallback);
73187 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73188 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73189 && !InitIds(cx, atomsCache)) ||
73190 !JS_GetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, &rval)) {
73191 aRv.Throw(NS_ERROR_UNEXPECTED);
73192 return int8_t(0);
73193 }
73194 int8_t rvalDecl;
73195 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.sideEffectFreeByte", &rvalDecl)) {
73196 aRv.Throw(NS_ERROR_UNEXPECTED);
73197 return int8_t(0);
73198 }
73199 return rvalDecl;
73200}
73201
73202int8_t
73203TestJSImplInterfaceJSImpl::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
73204{
73205 CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73206 if (aRv.Failed()) {
73207 return int8_t(0);
73208 }
73209 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73209); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73209); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73210 BindingCallContext& cx = s.GetCallContext();
73211
73212 JS::Rooted<JS::Value> rval(cx);
73213
73214 JS::Rooted<JSObject *> callback(cx, mCallback);
73215 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73216 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73217 && !InitIds(cx, atomsCache)) ||
73218 !JS_GetPropertyById(cx, callback, atomsCache->domDependentByte_id, &rval)) {
73219 aRv.Throw(NS_ERROR_UNEXPECTED);
73220 return int8_t(0);
73221 }
73222 int8_t rvalDecl;
73223 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.domDependentByte", &rvalDecl)) {
73224 aRv.Throw(NS_ERROR_UNEXPECTED);
73225 return int8_t(0);
73226 }
73227 return rvalDecl;
73228}
73229
73230int8_t
73231TestJSImplInterfaceJSImpl::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
73232{
73233 CallSetup s(this, aRv, "TestJSImplInterface.constantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73234 if (aRv.Failed()) {
73235 return int8_t(0);
73236 }
73237 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73237); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73237); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73238 BindingCallContext& cx = s.GetCallContext();
73239
73240 JS::Rooted<JS::Value> rval(cx);
73241
73242 JS::Rooted<JSObject *> callback(cx, mCallback);
73243 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73244 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73245 && !InitIds(cx, atomsCache)) ||
73246 !JS_GetPropertyById(cx, callback, atomsCache->constantByte_id, &rval)) {
73247 aRv.Throw(NS_ERROR_UNEXPECTED);
73248 return int8_t(0);
73249 }
73250 int8_t rvalDecl;
73251 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.constantByte", &rvalDecl)) {
73252 aRv.Throw(NS_ERROR_UNEXPECTED);
73253 return int8_t(0);
73254 }
73255 return rvalDecl;
73256}
73257
73258int8_t
73259TestJSImplInterfaceJSImpl::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
73260{
73261 CallSetup s(this, aRv, "TestJSImplInterface.deviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73262 if (aRv.Failed()) {
73263 return int8_t(0);
73264 }
73265 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73265); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73265); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73266 BindingCallContext& cx = s.GetCallContext();
73267
73268 JS::Rooted<JS::Value> rval(cx);
73269
73270 JS::Rooted<JSObject *> callback(cx, mCallback);
73271 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73272 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73273 && !InitIds(cx, atomsCache)) ||
73274 !JS_GetPropertyById(cx, callback, atomsCache->deviceStateDependentByte_id, &rval)) {
73275 aRv.Throw(NS_ERROR_UNEXPECTED);
73276 return int8_t(0);
73277 }
73278 int8_t rvalDecl;
73279 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deviceStateDependentByte", &rvalDecl)) {
73280 aRv.Throw(NS_ERROR_UNEXPECTED);
73281 return int8_t(0);
73282 }
73283 return rvalDecl;
73284}
73285
73286int16_t
73287TestJSImplInterfaceJSImpl::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm)
73288{
73289 CallSetup s(this, aRv, "TestJSImplInterface.readonlyShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73290 if (aRv.Failed()) {
73291 return int16_t(0);
73292 }
73293 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73293); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73293); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73294 BindingCallContext& cx = s.GetCallContext();
73295
73296 JS::Rooted<JS::Value> rval(cx);
73297
73298 JS::Rooted<JSObject *> callback(cx, mCallback);
73299 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73300 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73301 && !InitIds(cx, atomsCache)) ||
73302 !JS_GetPropertyById(cx, callback, atomsCache->readonlyShort_id, &rval)) {
73303 aRv.Throw(NS_ERROR_UNEXPECTED);
73304 return int16_t(0);
73305 }
73306 int16_t rvalDecl;
73307 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyShort", &rvalDecl)) {
73308 aRv.Throw(NS_ERROR_UNEXPECTED);
73309 return int16_t(0);
73310 }
73311 return rvalDecl;
73312}
73313
73314int16_t
73315TestJSImplInterfaceJSImpl::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm)
73316{
73317 CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73318 if (aRv.Failed()) {
73319 return int16_t(0);
73320 }
73321 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73321); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73321); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73322 BindingCallContext& cx = s.GetCallContext();
73323
73324 JS::Rooted<JS::Value> rval(cx);
73325
73326 JS::Rooted<JSObject *> callback(cx, mCallback);
73327 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73328 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73329 && !InitIds(cx, atomsCache)) ||
73330 !JS_GetPropertyById(cx, callback, atomsCache->writableShort_id, &rval)) {
73331 aRv.Throw(NS_ERROR_UNEXPECTED);
73332 return int16_t(0);
73333 }
73334 int16_t rvalDecl;
73335 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableShort", &rvalDecl)) {
73336 aRv.Throw(NS_ERROR_UNEXPECTED);
73337 return int16_t(0);
73338 }
73339 return rvalDecl;
73340}
73341
73342int32_t
73343TestJSImplInterfaceJSImpl::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm)
73344{
73345 CallSetup s(this, aRv, "TestJSImplInterface.readonlyLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73346 if (aRv.Failed()) {
73347 return int32_t(0);
73348 }
73349 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73349); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73349); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73350 BindingCallContext& cx = s.GetCallContext();
73351
73352 JS::Rooted<JS::Value> rval(cx);
73353
73354 JS::Rooted<JSObject *> callback(cx, mCallback);
73355 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73356 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73357 && !InitIds(cx, atomsCache)) ||
73358 !JS_GetPropertyById(cx, callback, atomsCache->readonlyLong_id, &rval)) {
73359 aRv.Throw(NS_ERROR_UNEXPECTED);
73360 return int32_t(0);
73361 }
73362 int32_t rvalDecl;
73363 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLong", &rvalDecl)) {
73364 aRv.Throw(NS_ERROR_UNEXPECTED);
73365 return int32_t(0);
73366 }
73367 return rvalDecl;
73368}
73369
73370int32_t
73371TestJSImplInterfaceJSImpl::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm)
73372{
73373 CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73374 if (aRv.Failed()) {
73375 return int32_t(0);
73376 }
73377 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73377); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73377); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73378 BindingCallContext& cx = s.GetCallContext();
73379
73380 JS::Rooted<JS::Value> rval(cx);
73381
73382 JS::Rooted<JSObject *> callback(cx, mCallback);
73383 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73384 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73385 && !InitIds(cx, atomsCache)) ||
73386 !JS_GetPropertyById(cx, callback, atomsCache->writableLong_id, &rval)) {
73387 aRv.Throw(NS_ERROR_UNEXPECTED);
73388 return int32_t(0);
73389 }
73390 int32_t rvalDecl;
73391 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLong", &rvalDecl)) {
73392 aRv.Throw(NS_ERROR_UNEXPECTED);
73393 return int32_t(0);
73394 }
73395 return rvalDecl;
73396}
73397
73398int64_t
73399TestJSImplInterfaceJSImpl::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73400{
73401 CallSetup s(this, aRv, "TestJSImplInterface.readonlyLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73402 if (aRv.Failed()) {
73403 return int64_t(0);
73404 }
73405 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73406 BindingCallContext& cx = s.GetCallContext();
73407
73408 JS::Rooted<JS::Value> rval(cx);
73409
73410 JS::Rooted<JSObject *> callback(cx, mCallback);
73411 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73412 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73413 && !InitIds(cx, atomsCache)) ||
73414 !JS_GetPropertyById(cx, callback, atomsCache->readonlyLongLong_id, &rval)) {
73415 aRv.Throw(NS_ERROR_UNEXPECTED);
73416 return int64_t(0);
73417 }
73418 int64_t rvalDecl;
73419 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLongLong", &rvalDecl)) {
73420 aRv.Throw(NS_ERROR_UNEXPECTED);
73421 return int64_t(0);
73422 }
73423 return rvalDecl;
73424}
73425
73426int64_t
73427TestJSImplInterfaceJSImpl::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73428{
73429 CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73430 if (aRv.Failed()) {
73431 return int64_t(0);
73432 }
73433 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73433); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73433); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73434 BindingCallContext& cx = s.GetCallContext();
73435
73436 JS::Rooted<JS::Value> rval(cx);
73437
73438 JS::Rooted<JSObject *> callback(cx, mCallback);
73439 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73440 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73441 && !InitIds(cx, atomsCache)) ||
73442 !JS_GetPropertyById(cx, callback, atomsCache->writableLongLong_id, &rval)) {
73443 aRv.Throw(NS_ERROR_UNEXPECTED);
73444 return int64_t(0);
73445 }
73446 int64_t rvalDecl;
73447 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLongLong", &rvalDecl)) {
73448 aRv.Throw(NS_ERROR_UNEXPECTED);
73449 return int64_t(0);
73450 }
73451 return rvalDecl;
73452}
73453
73454uint8_t
73455TestJSImplInterfaceJSImpl::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm)
73456{
73457 CallSetup s(this, aRv, "TestJSImplInterface.readonlyOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73458 if (aRv.Failed()) {
73459 return uint8_t(0);
73460 }
73461 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73461); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73461); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73462 BindingCallContext& cx = s.GetCallContext();
73463
73464 JS::Rooted<JS::Value> rval(cx);
73465
73466 JS::Rooted<JSObject *> callback(cx, mCallback);
73467 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73468 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73469 && !InitIds(cx, atomsCache)) ||
73470 !JS_GetPropertyById(cx, callback, atomsCache->readonlyOctet_id, &rval)) {
73471 aRv.Throw(NS_ERROR_UNEXPECTED);
73472 return uint8_t(0);
73473 }
73474 uint8_t rvalDecl;
73475 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyOctet", &rvalDecl)) {
73476 aRv.Throw(NS_ERROR_UNEXPECTED);
73477 return uint8_t(0);
73478 }
73479 return rvalDecl;
73480}
73481
73482uint8_t
73483TestJSImplInterfaceJSImpl::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm)
73484{
73485 CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73486 if (aRv.Failed()) {
73487 return uint8_t(0);
73488 }
73489 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73489); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73489); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73490 BindingCallContext& cx = s.GetCallContext();
73491
73492 JS::Rooted<JS::Value> rval(cx);
73493
73494 JS::Rooted<JSObject *> callback(cx, mCallback);
73495 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73496 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73497 && !InitIds(cx, atomsCache)) ||
73498 !JS_GetPropertyById(cx, callback, atomsCache->writableOctet_id, &rval)) {
73499 aRv.Throw(NS_ERROR_UNEXPECTED);
73500 return uint8_t(0);
73501 }
73502 uint8_t rvalDecl;
73503 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableOctet", &rvalDecl)) {
73504 aRv.Throw(NS_ERROR_UNEXPECTED);
73505 return uint8_t(0);
73506 }
73507 return rvalDecl;
73508}
73509
73510uint16_t
73511TestJSImplInterfaceJSImpl::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
73512{
73513 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73514 if (aRv.Failed()) {
73515 return uint16_t(0);
73516 }
73517 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73517); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73517); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73518 BindingCallContext& cx = s.GetCallContext();
73519
73520 JS::Rooted<JS::Value> rval(cx);
73521
73522 JS::Rooted<JSObject *> callback(cx, mCallback);
73523 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73524 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73525 && !InitIds(cx, atomsCache)) ||
73526 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedShort_id, &rval)) {
73527 aRv.Throw(NS_ERROR_UNEXPECTED);
73528 return uint16_t(0);
73529 }
73530 uint16_t rvalDecl;
73531 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedShort", &rvalDecl)) {
73532 aRv.Throw(NS_ERROR_UNEXPECTED);
73533 return uint16_t(0);
73534 }
73535 return rvalDecl;
73536}
73537
73538uint16_t
73539TestJSImplInterfaceJSImpl::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
73540{
73541 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73542 if (aRv.Failed()) {
73543 return uint16_t(0);
73544 }
73545 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73545); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73545); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73546 BindingCallContext& cx = s.GetCallContext();
73547
73548 JS::Rooted<JS::Value> rval(cx);
73549
73550 JS::Rooted<JSObject *> callback(cx, mCallback);
73551 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73552 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73553 && !InitIds(cx, atomsCache)) ||
73554 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, &rval)) {
73555 aRv.Throw(NS_ERROR_UNEXPECTED);
73556 return uint16_t(0);
73557 }
73558 uint16_t rvalDecl;
73559 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedShort", &rvalDecl)) {
73560 aRv.Throw(NS_ERROR_UNEXPECTED);
73561 return uint16_t(0);
73562 }
73563 return rvalDecl;
73564}
73565
73566uint32_t
73567TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
73568{
73569 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73570 if (aRv.Failed()) {
73571 return uint32_t(0);
73572 }
73573 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73573); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73573); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73574 BindingCallContext& cx = s.GetCallContext();
73575
73576 JS::Rooted<JS::Value> rval(cx);
73577
73578 JS::Rooted<JSObject *> callback(cx, mCallback);
73579 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73580 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73581 && !InitIds(cx, atomsCache)) ||
73582 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLong_id, &rval)) {
73583 aRv.Throw(NS_ERROR_UNEXPECTED);
73584 return uint32_t(0);
73585 }
73586 uint32_t rvalDecl;
73587 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLong", &rvalDecl)) {
73588 aRv.Throw(NS_ERROR_UNEXPECTED);
73589 return uint32_t(0);
73590 }
73591 return rvalDecl;
73592}
73593
73594uint32_t
73595TestJSImplInterfaceJSImpl::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
73596{
73597 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73598 if (aRv.Failed()) {
73599 return uint32_t(0);
73600 }
73601 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73601); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73601); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73602 BindingCallContext& cx = s.GetCallContext();
73603
73604 JS::Rooted<JS::Value> rval(cx);
73605
73606 JS::Rooted<JSObject *> callback(cx, mCallback);
73607 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73608 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73609 && !InitIds(cx, atomsCache)) ||
73610 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, &rval)) {
73611 aRv.Throw(NS_ERROR_UNEXPECTED);
73612 return uint32_t(0);
73613 }
73614 uint32_t rvalDecl;
73615 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLong", &rvalDecl)) {
73616 aRv.Throw(NS_ERROR_UNEXPECTED);
73617 return uint32_t(0);
73618 }
73619 return rvalDecl;
73620}
73621
73622uint64_t
73623TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73624{
73625 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73626 if (aRv.Failed()) {
73627 return uint64_t(0);
73628 }
73629 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73629); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73629); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73630 BindingCallContext& cx = s.GetCallContext();
73631
73632 JS::Rooted<JS::Value> rval(cx);
73633
73634 JS::Rooted<JSObject *> callback(cx, mCallback);
73635 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73636 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73637 && !InitIds(cx, atomsCache)) ||
73638 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLongLong_id, &rval)) {
73639 aRv.Throw(NS_ERROR_UNEXPECTED);
73640 return uint64_t(0);
73641 }
73642 uint64_t rvalDecl;
73643 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLongLong", &rvalDecl)) {
73644 aRv.Throw(NS_ERROR_UNEXPECTED);
73645 return uint64_t(0);
73646 }
73647 return rvalDecl;
73648}
73649
73650uint64_t
73651TestJSImplInterfaceJSImpl::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73652{
73653 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73654 if (aRv.Failed()) {
73655 return uint64_t(0);
73656 }
73657 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73657); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73657); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73658 BindingCallContext& cx = s.GetCallContext();
73659
73660 JS::Rooted<JS::Value> rval(cx);
73661
73662 JS::Rooted<JSObject *> callback(cx, mCallback);
73663 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73664 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73665 && !InitIds(cx, atomsCache)) ||
73666 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, &rval)) {
73667 aRv.Throw(NS_ERROR_UNEXPECTED);
73668 return uint64_t(0);
73669 }
73670 uint64_t rvalDecl;
73671 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLongLong", &rvalDecl)) {
73672 aRv.Throw(NS_ERROR_UNEXPECTED);
73673 return uint64_t(0);
73674 }
73675 return rvalDecl;
73676}
73677
73678float
73679TestJSImplInterfaceJSImpl::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm)
73680{
73681 CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73682 if (aRv.Failed()) {
73683 return float(0);
73684 }
73685 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73685); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73685); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73686 BindingCallContext& cx = s.GetCallContext();
73687
73688 JS::Rooted<JS::Value> rval(cx);
73689
73690 JS::Rooted<JSObject *> callback(cx, mCallback);
73691 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73692 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73693 && !InitIds(cx, atomsCache)) ||
73694 !JS_GetPropertyById(cx, callback, atomsCache->writableFloat_id, &rval)) {
73695 aRv.Throw(NS_ERROR_UNEXPECTED);
73696 return float(0);
73697 }
73698 float rvalDecl;
73699 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableFloat", &rvalDecl)) {
73700 aRv.Throw(NS_ERROR_UNEXPECTED);
73701 return float(0);
73702 } else if (!std::isfinite(rvalDecl)) {
73703 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableFloat");
73704 aRv.Throw(NS_ERROR_UNEXPECTED);
73705 return float(0);
73706 }
73707 return rvalDecl;
73708}
73709
73710float
73711TestJSImplInterfaceJSImpl::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm)
73712{
73713 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73714 if (aRv.Failed()) {
73715 return float(0);
73716 }
73717 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73717); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73717); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73718 BindingCallContext& cx = s.GetCallContext();
73719
73720 JS::Rooted<JS::Value> rval(cx);
73721
73722 JS::Rooted<JSObject *> callback(cx, mCallback);
73723 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73724 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73725 && !InitIds(cx, atomsCache)) ||
73726 !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, &rval)) {
73727 aRv.Throw(NS_ERROR_UNEXPECTED);
73728 return float(0);
73729 }
73730 float rvalDecl;
73731 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedFloat", &rvalDecl)) {
73732 aRv.Throw(NS_ERROR_UNEXPECTED);
73733 return float(0);
73734 }
73735 return rvalDecl;
73736}
73737
73738Nullable<float>
73739TestJSImplInterfaceJSImpl::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm)
73740{
73741 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73742 if (aRv.Failed()) {
73743 return Nullable<float>();
73744 }
73745 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73745); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73745); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73746 BindingCallContext& cx = s.GetCallContext();
73747
73748 JS::Rooted<JS::Value> rval(cx);
73749
73750 JS::Rooted<JSObject *> callback(cx, mCallback);
73751 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73752 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73753 && !InitIds(cx, atomsCache)) ||
73754 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, &rval)) {
73755 aRv.Throw(NS_ERROR_UNEXPECTED);
73756 return Nullable<float>();
73757 }
73758 Nullable<float> rvalDecl;
73759 if (rval.isNullOrUndefined()) {
73760 rvalDecl.SetNull();
73761 } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableFloat", &rvalDecl.SetValue())) {
73762 aRv.Throw(NS_ERROR_UNEXPECTED);
73763 return Nullable<float>();
73764 } else if (!std::isfinite(rvalDecl.Value())) {
73765 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableFloat");
73766 aRv.Throw(NS_ERROR_UNEXPECTED);
73767 return Nullable<float>();
73768 }
73769 return rvalDecl;
73770}
73771
73772Nullable<float>
73773TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm)
73774{
73775 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73776 if (aRv.Failed()) {
73777 return Nullable<float>();
73778 }
73779 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73779); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73779); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73780 BindingCallContext& cx = s.GetCallContext();
73781
73782 JS::Rooted<JS::Value> rval(cx);
73783
73784 JS::Rooted<JSObject *> callback(cx, mCallback);
73785 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73786 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73787 && !InitIds(cx, atomsCache)) ||
73788 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, &rval)) {
73789 aRv.Throw(NS_ERROR_UNEXPECTED);
73790 return Nullable<float>();
73791 }
73792 Nullable<float> rvalDecl;
73793 if (rval.isNullOrUndefined()) {
73794 rvalDecl.SetNull();
73795 } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedFloat", &rvalDecl.SetValue())) {
73796 aRv.Throw(NS_ERROR_UNEXPECTED);
73797 return Nullable<float>();
73798 }
73799 return rvalDecl;
73800}
73801
73802double
73803TestJSImplInterfaceJSImpl::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm)
73804{
73805 CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73806 if (aRv.Failed()) {
73807 return double(0);
73808 }
73809 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73809); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73809); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73810 BindingCallContext& cx = s.GetCallContext();
73811
73812 JS::Rooted<JS::Value> rval(cx);
73813
73814 JS::Rooted<JSObject *> callback(cx, mCallback);
73815 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73816 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73817 && !InitIds(cx, atomsCache)) ||
73818 !JS_GetPropertyById(cx, callback, atomsCache->writableDouble_id, &rval)) {
73819 aRv.Throw(NS_ERROR_UNEXPECTED);
73820 return double(0);
73821 }
73822 double rvalDecl;
73823 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableDouble", &rvalDecl)) {
73824 aRv.Throw(NS_ERROR_UNEXPECTED);
73825 return double(0);
73826 } else if (!std::isfinite(rvalDecl)) {
73827 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableDouble");
73828 aRv.Throw(NS_ERROR_UNEXPECTED);
73829 return double(0);
73830 }
73831 return rvalDecl;
73832}
73833
73834double
73835TestJSImplInterfaceJSImpl::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm)
73836{
73837 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73838 if (aRv.Failed()) {
73839 return double(0);
73840 }
73841 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73841); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73841); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73842 BindingCallContext& cx = s.GetCallContext();
73843
73844 JS::Rooted<JS::Value> rval(cx);
73845
73846 JS::Rooted<JSObject *> callback(cx, mCallback);
73847 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73848 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73849 && !InitIds(cx, atomsCache)) ||
73850 !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, &rval)) {
73851 aRv.Throw(NS_ERROR_UNEXPECTED);
73852 return double(0);
73853 }
73854 double rvalDecl;
73855 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedDouble", &rvalDecl)) {
73856 aRv.Throw(NS_ERROR_UNEXPECTED);
73857 return double(0);
73858 }
73859 return rvalDecl;
73860}
73861
73862Nullable<double>
73863TestJSImplInterfaceJSImpl::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm)
73864{
73865 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73866 if (aRv.Failed()) {
73867 return Nullable<double>();
73868 }
73869 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73869); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73869); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73870 BindingCallContext& cx = s.GetCallContext();
73871
73872 JS::Rooted<JS::Value> rval(cx);
73873
73874 JS::Rooted<JSObject *> callback(cx, mCallback);
73875 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73876 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73877 && !InitIds(cx, atomsCache)) ||
73878 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, &rval)) {
73879 aRv.Throw(NS_ERROR_UNEXPECTED);
73880 return Nullable<double>();
73881 }
73882 Nullable<double> rvalDecl;
73883 if (rval.isNullOrUndefined()) {
73884 rvalDecl.SetNull();
73885 } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableDouble", &rvalDecl.SetValue())) {
73886 aRv.Throw(NS_ERROR_UNEXPECTED);
73887 return Nullable<double>();
73888 } else if (!std::isfinite(rvalDecl.Value())) {
73889 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableDouble");
73890 aRv.Throw(NS_ERROR_UNEXPECTED);
73891 return Nullable<double>();
73892 }
73893 return rvalDecl;
73894}
73895
73896Nullable<double>
73897TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm)
73898{
73899 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73900 if (aRv.Failed()) {
73901 return Nullable<double>();
73902 }
73903 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73903); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73903); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73904 BindingCallContext& cx = s.GetCallContext();
73905
73906 JS::Rooted<JS::Value> rval(cx);
73907
73908 JS::Rooted<JSObject *> callback(cx, mCallback);
73909 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73910 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73911 && !InitIds(cx, atomsCache)) ||
73912 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, &rval)) {
73913 aRv.Throw(NS_ERROR_UNEXPECTED);
73914 return Nullable<double>();
73915 }
73916 Nullable<double> rvalDecl;
73917 if (rval.isNullOrUndefined()) {
73918 rvalDecl.SetNull();
73919 } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedDouble", &rvalDecl.SetValue())) {
73920 aRv.Throw(NS_ERROR_UNEXPECTED);
73921 return Nullable<double>();
73922 }
73923 return rvalDecl;
73924}
73925
73926float
73927TestJSImplInterfaceJSImpl::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm)
73928{
73929 CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73930 if (aRv.Failed()) {
73931 return float(0);
73932 }
73933 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73933); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73933); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73934 BindingCallContext& cx = s.GetCallContext();
73935
73936 JS::Rooted<JS::Value> rval(cx);
73937
73938 JS::Rooted<JSObject *> callback(cx, mCallback);
73939 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73940 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73941 && !InitIds(cx, atomsCache)) ||
73942 !JS_GetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, &rval)) {
73943 aRv.Throw(NS_ERROR_UNEXPECTED);
73944 return float(0);
73945 }
73946 float rvalDecl;
73947 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientFloatAttr", &rvalDecl)) {
73948 aRv.Throw(NS_ERROR_UNEXPECTED);
73949 return float(0);
73950 } else if (!std::isfinite(rvalDecl)) {
73951 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientFloatAttr");
73952 aRv.Throw(NS_ERROR_UNEXPECTED);
73953 return float(0);
73954 }
73955 return rvalDecl;
73956}
73957
73958double
73959TestJSImplInterfaceJSImpl::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm)
73960{
73961 CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73962 if (aRv.Failed()) {
73963 return double(0);
73964 }
73965 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73965); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73965); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73966 BindingCallContext& cx = s.GetCallContext();
73967
73968 JS::Rooted<JS::Value> rval(cx);
73969
73970 JS::Rooted<JSObject *> callback(cx, mCallback);
73971 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73972 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73973 && !InitIds(cx, atomsCache)) ||
73974 !JS_GetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, &rval)) {
73975 aRv.Throw(NS_ERROR_UNEXPECTED);
73976 return double(0);
73977 }
73978 double rvalDecl;
73979 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientDoubleAttr", &rvalDecl)) {
73980 aRv.Throw(NS_ERROR_UNEXPECTED);
73981 return double(0);
73982 } else if (!std::isfinite(rvalDecl)) {
73983 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientDoubleAttr");
73984 aRv.Throw(NS_ERROR_UNEXPECTED);
73985 return double(0);
73986 }
73987 return rvalDecl;
73988}
73989
73990already_AddRefed<TestJSImplInterface>
73991TestJSImplInterfaceJSImpl::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm)
73992{
73993 CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73994 if (aRv.Failed()) {
73995 return nullptr;
73996 }
73997 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73997); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 73997); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
73998 BindingCallContext& cx = s.GetCallContext();
73999
74000 JS::Rooted<JS::Value> rval(cx);
74001
74002 JS::Rooted<JSObject *> callback(cx, mCallback);
74003 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74004 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74005 && !InitIds(cx, atomsCache)) ||
74006 !JS_GetPropertyById(cx, callback, atomsCache->nonNullSelf_id, &rval)) {
74007 aRv.Throw(NS_ERROR_UNEXPECTED);
74008 return nullptr;
74009 }
74010 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
74011 if (rval.isObject()) {
74012 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
74013 {
74014 // Our JSContext should be in the right global to do unwrapping in.
74015 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
74016 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
74017 // Be careful to not wrap random DOM objects here, even if
74018 // they're wrapped in opaque security wrappers for some reason.
74019 // XXXbz Wish we could check for a JS-implemented object
74020 // that already has a content reflection...
74021 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
74022 nsCOMPtr<nsIGlobalObject> contentGlobal;
74023 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
74024 if (!callback ||
74025 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
74026 aRv.Throw(NS_ERROR_UNEXPECTED);
74027 return nullptr;
74028 }
74029 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
74030 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", 74031); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 74031); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
74031 "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", 74031); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 74031); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
74032 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
74033 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
74034 } else {
74035 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullSelf", "TestJSImplInterface");
74036 aRv.Throw(NS_ERROR_UNEXPECTED);
74037 return nullptr;
74038 }
74039 }
74040 }
74041 } else {
74042 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullSelf");
74043 aRv.Throw(NS_ERROR_UNEXPECTED);
74044 return nullptr;
74045 }
74046 return rvalDecl.forget();
74047}
74048
74049already_AddRefed<TestJSImplInterface>
74050TestJSImplInterfaceJSImpl::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
74051{
74052 CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74053 if (aRv.Failed()) {
74054 return nullptr;
74055 }
74056 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74056); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74056); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74057 BindingCallContext& cx = s.GetCallContext();
74058
74059 JS::Rooted<JS::Value> rval(cx);
74060
74061 JS::Rooted<JSObject *> callback(cx, mCallback);
74062 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74063 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74064 && !InitIds(cx, atomsCache)) ||
74065 !JS_GetPropertyById(cx, callback, atomsCache->nullableSelf_id, &rval)) {
74066 aRv.Throw(NS_ERROR_UNEXPECTED);
74067 return nullptr;
74068 }
74069 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
74070 if (rval.isObject()) {
74071 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
74072 {
74073 // Our JSContext should be in the right global to do unwrapping in.
74074 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
74075 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
74076 // Be careful to not wrap random DOM objects here, even if
74077 // they're wrapped in opaque security wrappers for some reason.
74078 // XXXbz Wish we could check for a JS-implemented object
74079 // that already has a content reflection...
74080 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
74081 nsCOMPtr<nsIGlobalObject> contentGlobal;
74082 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
74083 if (!callback ||
74084 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
74085 aRv.Throw(NS_ERROR_UNEXPECTED);
74086 return nullptr;
74087 }
74088 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
74089 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", 74090); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 74090); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
74090 "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", 74090); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 74090); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
74091 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
74092 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
74093 } else {
74094 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableSelf", "TestJSImplInterface");
74095 aRv.Throw(NS_ERROR_UNEXPECTED);
74096 return nullptr;
74097 }
74098 }
74099 }
74100 } else if (rval.isNullOrUndefined()) {
74101 rvalDecl = nullptr;
74102 } else {
74103 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableSelf");
74104 aRv.Throw(NS_ERROR_UNEXPECTED);
74105 return nullptr;
74106 }
74107 return rvalDecl.forget();
74108}
74109
74110already_AddRefed<TestExternalInterface>
74111TestJSImplInterfaceJSImpl::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm)
74112{
74113 CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74114 if (aRv.Failed()) {
74115 return nullptr;
74116 }
74117 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74117); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74117); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74118 BindingCallContext& cx = s.GetCallContext();
74119
74120 JS::Rooted<JS::Value> rval(cx);
74121
74122 JS::Rooted<JSObject *> callback(cx, mCallback);
74123 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74124 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74125 && !InitIds(cx, atomsCache)) ||
74126 !JS_GetPropertyById(cx, callback, atomsCache->nonNullExternal_id, &rval)) {
74127 aRv.Throw(NS_ERROR_UNEXPECTED);
74128 return nullptr;
74129 }
74130 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
74131 if (rval.isObject()) {
74132 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
74133 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
74134 JS::Rooted<JSObject*> source(cx, &rval.toObject());
74135 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)))
) {
74136 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullExternal", "TestExternalInterface");
74137 aRv.Throw(NS_ERROR_UNEXPECTED);
74138 return nullptr;
74139 }
74140 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"
, 74140); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 74140); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
74141 rvalDecl = rvalHolder;
74142 } else {
74143 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullExternal");
74144 aRv.Throw(NS_ERROR_UNEXPECTED);
74145 return nullptr;
74146 }
74147 return rvalDecl.forget();
74148}
74149
74150already_AddRefed<TestExternalInterface>
74151TestJSImplInterfaceJSImpl::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
74152{
74153 CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74154 if (aRv.Failed()) {
74155 return nullptr;
74156 }
74157 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74157); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74157); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74158 BindingCallContext& cx = s.GetCallContext();
74159
74160 JS::Rooted<JS::Value> rval(cx);
74161
74162 JS::Rooted<JSObject *> callback(cx, mCallback);
74163 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74164 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74165 && !InitIds(cx, atomsCache)) ||
74166 !JS_GetPropertyById(cx, callback, atomsCache->nullableExternal_id, &rval)) {
74167 aRv.Throw(NS_ERROR_UNEXPECTED);
74168 return nullptr;
74169 }
74170 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
74171 if (rval.isObject()) {
74172 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
74173 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
74174 JS::Rooted<JSObject*> source(cx, &rval.toObject());
74175 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)))
) {
74176 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableExternal", "TestExternalInterface");
74177 aRv.Throw(NS_ERROR_UNEXPECTED);
74178 return nullptr;
74179 }
74180 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"
, 74180); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { MOZ_CrashSequence(__null, 74180); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
74181 rvalDecl = rvalHolder;
74182 } else if (rval.isNullOrUndefined()) {
74183 rvalDecl = nullptr;
74184 } else {
74185 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableExternal");
74186 aRv.Throw(NS_ERROR_UNEXPECTED);
74187 return nullptr;
74188 }
74189 return rvalDecl.forget();
74190}
74191
74192already_AddRefed<TestCallbackInterface>
74193TestJSImplInterfaceJSImpl::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
74194{
74195 CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74196 if (aRv.Failed()) {
74197 return nullptr;
74198 }
74199 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74199); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74199); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74200 BindingCallContext& cx = s.GetCallContext();
74201
74202 JS::Rooted<JS::Value> rval(cx);
74203
74204 JS::Rooted<JSObject *> callback(cx, mCallback);
74205 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74206 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74207 && !InitIds(cx, atomsCache)) ||
74208 !JS_GetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, &rval)) {
74209 aRv.Throw(NS_ERROR_UNEXPECTED);
74210 return nullptr;
74211 }
74212 RefPtr<TestCallbackInterface> rvalDecl;
74213 if (rval.isObject()) {
74214 { // scope for tempRoot and tempGlobalRoot if needed
74215 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
74216 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
74217 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
74218 }
74219 } else {
74220 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullCallbackInterface");
74221 aRv.Throw(NS_ERROR_UNEXPECTED);
74222 return nullptr;
74223 }
74224 return rvalDecl.forget();
74225}
74226
74227already_AddRefed<TestCallbackInterface>
74228TestJSImplInterfaceJSImpl::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
74229{
74230 CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74231 if (aRv.Failed()) {
74232 return nullptr;
74233 }
74234 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74234); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74234); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74235 BindingCallContext& cx = s.GetCallContext();
74236
74237 JS::Rooted<JS::Value> rval(cx);
74238
74239 JS::Rooted<JSObject *> callback(cx, mCallback);
74240 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74241 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74242 && !InitIds(cx, atomsCache)) ||
74243 !JS_GetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, &rval)) {
74244 aRv.Throw(NS_ERROR_UNEXPECTED);
74245 return nullptr;
74246 }
74247 RefPtr<TestCallbackInterface> rvalDecl;
74248 if (rval.isObject()) {
74249 { // scope for tempRoot and tempGlobalRoot if needed
74250 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
74251 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
74252 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
74253 }
74254 } else if (rval.isNullOrUndefined()) {
74255 rvalDecl = nullptr;
74256 } else {
74257 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableCallbackInterface");
74258 aRv.Throw(NS_ERROR_UNEXPECTED);
74259 return nullptr;
74260 }
74261 return rvalDecl.forget();
74262}
74263
74264void
74265TestJSImplInterfaceJSImpl::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74266{
74267 CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74268 if (aRv.Failed()) {
74269 return;
74270 }
74271 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74271); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74271); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74272 BindingCallContext& cx = s.GetCallContext();
74273
74274 JS::Rooted<JS::Value> rval(cx);
74275
74276 JS::Rooted<JSObject *> callback(cx, mCallback);
74277 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74278 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74279 && !InitIds(cx, atomsCache)) ||
74280 !JS_GetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, &rval)) {
74281 aRv.Throw(NS_ERROR_UNEXPECTED);
74282 return;
74283 }
74284 RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx);
74285 if (rval.isObject()) {
74286 if (!rvalDecl.Init(&rval.toObject())) {
74287 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.uint8ArrayAttr", "Uint8Array");
74288 aRv.Throw(NS_ERROR_UNEXPECTED);
74289 return;
74290 }
74291 if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) {
74292 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.uint8ArrayAttr");
74293 aRv.Throw(NS_ERROR_UNEXPECTED);
74294 return;
74295 }
74296 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
74297 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.uint8ArrayAttr");
74298 aRv.Throw(NS_ERROR_UNEXPECTED);
74299 return;
74300 }
74301 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
74302 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.uint8ArrayAttr");
74303 aRv.Throw(NS_ERROR_UNEXPECTED);
74304 return;
74305 }
74306 if (JS::IsImmutableArrayBufferView(rvalDecl.Obj())) {
74307 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.uint8ArrayAttr");
74308 aRv.Throw(NS_ERROR_UNEXPECTED);
74309 return;
74310 }
74311 } else {
74312 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.uint8ArrayAttr");
74313 aRv.Throw(NS_ERROR_UNEXPECTED);
74314 return;
74315 }
74316 aRetVal.set(rvalDecl.Obj());
74317}
74318
74319void
74320TestJSImplInterfaceJSImpl::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74321{
74322 CallSetup s(this, aRv, "TestJSImplInterface.readonlyJSStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74323 if (aRv.Failed()) {
74324 return;
74325 }
74326 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74326); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74326); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74327 BindingCallContext& cx = s.GetCallContext();
74328
74329 JS::Rooted<JS::Value> rval(cx);
74330
74331 JS::Rooted<JSObject *> callback(cx, mCallback);
74332 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74333 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74334 && !InitIds(cx, atomsCache)) ||
74335 !JS_GetPropertyById(cx, callback, atomsCache->readonlyJSStringAttr_id, &rval)) {
74336 aRv.Throw(NS_ERROR_UNEXPECTED);
74337 return;
74338 }
74339 JS::Rooted<JSString*> rvalDecl(cx);
74340 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
74341 aRv.Throw(NS_ERROR_UNEXPECTED);
74342 return;
74343 }
74344 aRetVal.set(rvalDecl);
74345}
74346
74347void
74348TestJSImplInterfaceJSImpl::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74349{
74350 CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74351 if (aRv.Failed()) {
74352 return;
74353 }
74354 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74354); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74354); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74355 BindingCallContext& cx = s.GetCallContext();
74356
74357 JS::Rooted<JS::Value> rval(cx);
74358
74359 JS::Rooted<JSObject *> callback(cx, mCallback);
74360 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74361 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74362 && !InitIds(cx, atomsCache)) ||
74363 !JS_GetPropertyById(cx, callback, atomsCache->jsStringAttr_id, &rval)) {
74364 aRv.Throw(NS_ERROR_UNEXPECTED);
74365 return;
74366 }
74367 JS::Rooted<JSString*> rvalDecl(cx);
74368 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
74369 aRv.Throw(NS_ERROR_UNEXPECTED);
74370 return;
74371 }
74372 aRetVal.set(rvalDecl);
74373}
74374
74375MyTestEnum
74376TestJSImplInterfaceJSImpl::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74377{
74378 CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74379 if (aRv.Failed()) {
74380 return MyTestEnum(0);
74381 }
74382 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74382); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74382); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74383 BindingCallContext& cx = s.GetCallContext();
74384
74385 JS::Rooted<JS::Value> rval(cx);
74386
74387 JS::Rooted<JSObject *> callback(cx, mCallback);
74388 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74389 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74390 && !InitIds(cx, atomsCache)) ||
74391 !JS_GetPropertyById(cx, callback, atomsCache->enumAttribute_id, &rval)) {
74392 aRv.Throw(NS_ERROR_UNEXPECTED);
74393 return MyTestEnum(0);
74394 }
74395 MyTestEnum rvalDecl;
74396 {
74397 int index;
74398 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
74399 binding_detail::EnumStrings<MyTestEnum>::Values,
74400 "MyTestEnum", "return value of TestJSImplInterface.enumAttribute",
74401 &index)) {
74402 aRv.Throw(NS_ERROR_UNEXPECTED);
74403 return MyTestEnum(0);
74404 }
74405 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", 74405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 74405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74406 rvalDecl = static_cast<MyTestEnum>(index);
74407 }
74408 return rvalDecl;
74409}
74410
74411MyTestEnum
74412TestJSImplInterfaceJSImpl::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74413{
74414 CallSetup s(this, aRv, "TestJSImplInterface.readonlyEnumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74415 if (aRv.Failed()) {
74416 return MyTestEnum(0);
74417 }
74418 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74418); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74419 BindingCallContext& cx = s.GetCallContext();
74420
74421 JS::Rooted<JS::Value> rval(cx);
74422
74423 JS::Rooted<JSObject *> callback(cx, mCallback);
74424 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74425 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74426 && !InitIds(cx, atomsCache)) ||
74427 !JS_GetPropertyById(cx, callback, atomsCache->readonlyEnumAttribute_id, &rval)) {
74428 aRv.Throw(NS_ERROR_UNEXPECTED);
74429 return MyTestEnum(0);
74430 }
74431 MyTestEnum rvalDecl;
74432 {
74433 int index;
74434 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
74435 binding_detail::EnumStrings<MyTestEnum>::Values,
74436 "MyTestEnum", "return value of TestJSImplInterface.readonlyEnumAttribute",
74437 &index)) {
74438 aRv.Throw(NS_ERROR_UNEXPECTED);
74439 return MyTestEnum(0);
74440 }
74441 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", 74441); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { MOZ_CrashSequence
(__null, 74441); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74442 rvalDecl = static_cast<MyTestEnum>(index);
74443 }
74444 return rvalDecl;
74445}
74446
74447void
74448TestJSImplInterfaceJSImpl::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74449{
74450 CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74451 if (aRv.Failed()) {
74452 return;
74453 }
74454 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74454); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74454); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74455 BindingCallContext& cx = s.GetCallContext();
74456
74457 JS::Rooted<JS::Value> rval(cx);
74458
74459 JS::Rooted<JSObject *> callback(cx, mCallback);
74460 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74461 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74462 && !InitIds(cx, atomsCache)) ||
74463 !JS_GetPropertyById(cx, callback, atomsCache->writableUnion_id, &rval)) {
74464 aRv.Throw(NS_ERROR_UNEXPECTED);
74465 return;
74466 }
74467 OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal);
74468 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnion", false)) {
74469 aRv.Throw(NS_ERROR_UNEXPECTED);
74470 return;
74471 }
74472}
74473
74474void
74475TestJSImplInterfaceJSImpl::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74476{
74477 CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74478 if (aRv.Failed()) {
74479 return;
74480 }
74481 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74481); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74482 BindingCallContext& cx = s.GetCallContext();
74483
74484 JS::Rooted<JS::Value> rval(cx);
74485
74486 JS::Rooted<JSObject *> callback(cx, mCallback);
74487 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74488 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74489 && !InitIds(cx, atomsCache)) ||
74490 !JS_GetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, &rval)) {
74491 aRv.Throw(NS_ERROR_UNEXPECTED);
74492 return;
74493 }
74494 OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal);
74495 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnionContainingNull", false)) {
74496 aRv.Throw(NS_ERROR_UNEXPECTED);
74497 return;
74498 }
74499}
74500
74501void
74502TestJSImplInterfaceJSImpl::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74503{
74504 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74505 if (aRv.Failed()) {
74506 return;
74507 }
74508 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74508); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74509 BindingCallContext& cx = s.GetCallContext();
74510
74511 JS::Rooted<JS::Value> rval(cx);
74512
74513 JS::Rooted<JSObject *> callback(cx, mCallback);
74514 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74515 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74516 && !InitIds(cx, atomsCache)) ||
74517 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnion_id, &rval)) {
74518 aRv.Throw(NS_ERROR_UNEXPECTED);
74519 return;
74520 }
74521 Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal);
74522 if (rval.isNullOrUndefined()) {
74523 rvalDecl.SetNull();
74524 } else {
74525 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.writableNullableUnion", false)) {
74526 aRv.Throw(NS_ERROR_UNEXPECTED);
74527 return;
74528 }
74529 }
74530}
74531
74532int8_t
74533TestJSImplInterfaceJSImpl::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
74534{
74535 CallSetup s(this, aRv, "TestJSImplInterface.attributeGetterRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74536 if (aRv.Failed()) {
74537 return int8_t(0);
74538 }
74539 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74539); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74539); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74540 BindingCallContext& cx = s.GetCallContext();
74541
74542 JS::Rooted<JS::Value> rval(cx);
74543
74544 JS::Rooted<JSObject *> callback(cx, mCallback);
74545 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74546 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74547 && !InitIds(cx, atomsCache)) ||
74548 !JS_GetPropertyById(cx, callback, atomsCache->attributeGetterRenamedTo_id, &rval)) {
74549 aRv.Throw(NS_ERROR_UNEXPECTED);
74550 return int8_t(0);
74551 }
74552 int8_t rvalDecl;
74553 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeGetterRenamedFrom", &rvalDecl)) {
74554 aRv.Throw(NS_ERROR_UNEXPECTED);
74555 return int8_t(0);
74556 }
74557 return rvalDecl;
74558}
74559
74560int8_t
74561TestJSImplInterfaceJSImpl::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
74562{
74563 CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74564 if (aRv.Failed()) {
74565 return int8_t(0);
74566 }
74567 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74567); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74567); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74568 BindingCallContext& cx = s.GetCallContext();
74569
74570 JS::Rooted<JS::Value> rval(cx);
74571
74572 JS::Rooted<JSObject *> callback(cx, mCallback);
74573 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74574 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74575 && !InitIds(cx, atomsCache)) ||
74576 !JS_GetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, &rval)) {
74577 aRv.Throw(NS_ERROR_UNEXPECTED);
74578 return int8_t(0);
74579 }
74580 int8_t rvalDecl;
74581 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeRenamedFrom", &rvalDecl)) {
74582 aRv.Throw(NS_ERROR_UNEXPECTED);
74583 return int8_t(0);
74584 }
74585 return rvalDecl;
74586}
74587
74588int8_t
74589TestJSImplInterfaceJSImpl::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm)
74590{
74591 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74592 if (aRv.Failed()) {
74593 return int8_t(0);
74594 }
74595 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74595); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74595); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74596 BindingCallContext& cx = s.GetCallContext();
74597
74598 JS::Rooted<JS::Value> rval(cx);
74599
74600 JS::Rooted<JSObject *> callback(cx, mCallback);
74601 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74602 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74603 && !InitIds(cx, atomsCache)) ||
74604 !JS_GetPropertyById(cx, callback, atomsCache->enforcedByte_id, &rval)) {
74605 aRv.Throw(NS_ERROR_UNEXPECTED);
74606 return int8_t(0);
74607 }
74608 int8_t rvalDecl;
74609 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, rval, "Return value of TestJSImplInterface.enforcedByte", &rvalDecl)) {
74610 aRv.Throw(NS_ERROR_UNEXPECTED);
74611 return int8_t(0);
74612 }
74613 return rvalDecl;
74614}
74615
74616Nullable<int8_t>
74617TestJSImplInterfaceJSImpl::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm)
74618{
74619 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74620 if (aRv.Failed()) {
6
Taking false branch
74621 return Nullable<int8_t>();
74622 }
74623 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74623); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74623); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
7
Assuming the condition is false
8
Taking false branch
9
Loop condition is false. Exiting loop
74624 BindingCallContext& cx = s.GetCallContext();
74625
74626 JS::Rooted<JS::Value> rval(cx);
74627
74628 JS::Rooted<JSObject *> callback(cx, mCallback);
74629 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74630 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
10
Assuming the condition is false
12
Taking false branch
74631 && !InitIds(cx, atomsCache)) ||
74632 !JS_GetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, &rval)) {
11
Assuming the condition is false
74633 aRv.Throw(NS_ERROR_UNEXPECTED);
74634 return Nullable<int8_t>();
74635 }
74636 Nullable<int8_t> rvalDecl;
74637 if (rval.isNullOrUndefined()) {
13
Taking false branch
74638 rvalDecl.SetNull();
74639 } 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>'
74640 aRv.Throw(NS_ERROR_UNEXPECTED);
74641 return Nullable<int8_t>();
74642 }
74643 return rvalDecl;
74644}
74645
74646int8_t
74647TestJSImplInterfaceJSImpl::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm)
74648{
74649 CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74650 if (aRv.Failed()) {
74651 return int8_t(0);
74652 }
74653 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74653); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74653); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74654 BindingCallContext& cx = s.GetCallContext();
74655
74656 JS::Rooted<JS::Value> rval(cx);
74657
74658 JS::Rooted<JSObject *> callback(cx, mCallback);
74659 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74660 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74661 && !InitIds(cx, atomsCache)) ||
74662 !JS_GetPropertyById(cx, callback, atomsCache->clampedByte_id, &rval)) {
74663 aRv.Throw(NS_ERROR_UNEXPECTED);
74664 return int8_t(0);
74665 }
74666 int8_t rvalDecl;
74667 if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByte", &rvalDecl)) {
74668 aRv.Throw(NS_ERROR_UNEXPECTED);
74669 return int8_t(0);
74670 }
74671 return rvalDecl;
74672}
74673
74674Nullable<int8_t>
74675TestJSImplInterfaceJSImpl::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm)
74676{
74677 CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74678 if (aRv.Failed()) {
74679 return Nullable<int8_t>();
74680 }
74681 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74681); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74681); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74682 BindingCallContext& cx = s.GetCallContext();
74683
74684 JS::Rooted<JS::Value> rval(cx);
74685
74686 JS::Rooted<JSObject *> callback(cx, mCallback);
74687 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74688 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74689 && !InitIds(cx, atomsCache)) ||
74690 !JS_GetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, &rval)) {
74691 aRv.Throw(NS_ERROR_UNEXPECTED);
74692 return Nullable<int8_t>();
74693 }
74694 Nullable<int8_t> rvalDecl;
74695 if (rval.isNullOrUndefined()) {
74696 rvalDecl.SetNull();
74697 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByteNullable", &rvalDecl.SetValue())) {
74698 aRv.Throw(NS_ERROR_UNEXPECTED);
74699 return Nullable<int8_t>();
74700 }
74701 return rvalDecl;
74702}
74703
74704int8_t
74705TestJSImplInterfaceJSImpl::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74706{
74707 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74708 if (aRv.Failed()) {
74709 return int8_t(0);
74710 }
74711 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74711); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74711); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74712 BindingCallContext& cx = s.GetCallContext();
74713
74714 JS::Rooted<JS::Value> rval(cx);
74715
74716 JS::Rooted<JSObject *> callback(cx, mCallback);
74717 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74718 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74719 && !InitIds(cx, atomsCache)) ||
74720 !JS_GetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, &rval)) {
74721 aRv.Throw(NS_ERROR_UNEXPECTED);
74722 return int8_t(0);
74723 }
74724 int8_t rvalDecl;
74725 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedAttribute", &rvalDecl)) {
74726 aRv.Throw(NS_ERROR_UNEXPECTED);
74727 return int8_t(0);
74728 }
74729 return rvalDecl;
74730}
74731
74732bool
74733TestJSImplInterfaceJSImpl::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm)
74734{
74735 CallSetup s(this, aRv, "TestJSImplInterface.prefable1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74736 if (aRv.Failed()) {
74737 return bool(0);
74738 }
74739 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74739); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74739); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74740 BindingCallContext& cx = s.GetCallContext();
74741
74742 JS::Rooted<JS::Value> rval(cx);
74743
74744 JS::Rooted<JSObject *> callback(cx, mCallback);
74745 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74746 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74747 && !InitIds(cx, atomsCache)) ||
74748 !JS_GetPropertyById(cx, callback, atomsCache->prefable1_id, &rval)) {
74749 aRv.Throw(NS_ERROR_UNEXPECTED);
74750 return bool(0);
74751 }
74752 bool rvalDecl;
74753 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable1", &rvalDecl)) {
74754 aRv.Throw(NS_ERROR_UNEXPECTED);
74755 return bool(0);
74756 }
74757 return rvalDecl;
74758}
74759
74760bool
74761TestJSImplInterfaceJSImpl::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm)
74762{
74763 CallSetup s(this, aRv, "TestJSImplInterface.prefable2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74764 if (aRv.Failed()) {
74765 return bool(0);
74766 }
74767 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74767); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74767); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74768 BindingCallContext& cx = s.GetCallContext();
74769
74770 JS::Rooted<JS::Value> rval(cx);
74771
74772 JS::Rooted<JSObject *> callback(cx, mCallback);
74773 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74774 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74775 && !InitIds(cx, atomsCache)) ||
74776 !JS_GetPropertyById(cx, callback, atomsCache->prefable2_id, &rval)) {
74777 aRv.Throw(NS_ERROR_UNEXPECTED);
74778 return bool(0);
74779 }
74780 bool rvalDecl;
74781 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable2", &rvalDecl)) {
74782 aRv.Throw(NS_ERROR_UNEXPECTED);
74783 return bool(0);
74784 }
74785 return rvalDecl;
74786}
74787
74788bool
74789TestJSImplInterfaceJSImpl::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm)
74790{
74791 CallSetup s(this, aRv, "TestJSImplInterface.prefable3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74792 if (aRv.Failed()) {
74793 return bool(0);
74794 }
74795 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74795); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74795); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74796 BindingCallContext& cx = s.GetCallContext();
74797
74798 JS::Rooted<JS::Value> rval(cx);
74799
74800 JS::Rooted<JSObject *> callback(cx, mCallback);
74801 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74802 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74803 && !InitIds(cx, atomsCache)) ||
74804 !JS_GetPropertyById(cx, callback, atomsCache->prefable3_id, &rval)) {
74805 aRv.Throw(NS_ERROR_UNEXPECTED);
74806 return bool(0);
74807 }
74808 bool rvalDecl;
74809 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable3", &rvalDecl)) {
74810 aRv.Throw(NS_ERROR_UNEXPECTED);
74811 return bool(0);
74812 }
74813 return rvalDecl;
74814}
74815
74816bool
74817TestJSImplInterfaceJSImpl::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm)
74818{
74819 CallSetup s(this, aRv, "TestJSImplInterface.prefable4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74820 if (aRv.Failed()) {
74821 return bool(0);
74822 }
74823 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74823); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74823); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74824 BindingCallContext& cx = s.GetCallContext();
74825
74826 JS::Rooted<JS::Value> rval(cx);
74827
74828 JS::Rooted<JSObject *> callback(cx, mCallback);
74829 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74830 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74831 && !InitIds(cx, atomsCache)) ||
74832 !JS_GetPropertyById(cx, callback, atomsCache->prefable4_id, &rval)) {
74833 aRv.Throw(NS_ERROR_UNEXPECTED);
74834 return bool(0);
74835 }
74836 bool rvalDecl;
74837 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable4", &rvalDecl)) {
74838 aRv.Throw(NS_ERROR_UNEXPECTED);
74839 return bool(0);
74840 }
74841 return rvalDecl;
74842}
74843
74844bool
74845TestJSImplInterfaceJSImpl::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm)
74846{
74847 CallSetup s(this, aRv, "TestJSImplInterface.prefable5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74848 if (aRv.Failed()) {
74849 return bool(0);
74850 }
74851 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74851); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74851); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74852 BindingCallContext& cx = s.GetCallContext();
74853
74854 JS::Rooted<JS::Value> rval(cx);
74855
74856 JS::Rooted<JSObject *> callback(cx, mCallback);
74857 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74858 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74859 && !InitIds(cx, atomsCache)) ||
74860 !JS_GetPropertyById(cx, callback, atomsCache->prefable5_id, &rval)) {
74861 aRv.Throw(NS_ERROR_UNEXPECTED);
74862 return bool(0);
74863 }
74864 bool rvalDecl;
74865 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable5", &rvalDecl)) {
74866 aRv.Throw(NS_ERROR_UNEXPECTED);
74867 return bool(0);
74868 }
74869 return rvalDecl;
74870}
74871
74872bool
74873TestJSImplInterfaceJSImpl::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm)
74874{
74875 CallSetup s(this, aRv, "TestJSImplInterface.prefable6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74876 if (aRv.Failed()) {
74877 return bool(0);
74878 }
74879 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74879); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74880 BindingCallContext& cx = s.GetCallContext();
74881
74882 JS::Rooted<JS::Value> rval(cx);
74883
74884 JS::Rooted<JSObject *> callback(cx, mCallback);
74885 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74886 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74887 && !InitIds(cx, atomsCache)) ||
74888 !JS_GetPropertyById(cx, callback, atomsCache->prefable6_id, &rval)) {
74889 aRv.Throw(NS_ERROR_UNEXPECTED);
74890 return bool(0);
74891 }
74892 bool rvalDecl;
74893 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable6", &rvalDecl)) {
74894 aRv.Throw(NS_ERROR_UNEXPECTED);
74895 return bool(0);
74896 }
74897 return rvalDecl;
74898}
74899
74900bool
74901TestJSImplInterfaceJSImpl::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm)
74902{
74903 CallSetup s(this, aRv, "TestJSImplInterface.prefable7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74904 if (aRv.Failed()) {
74905 return bool(0);
74906 }
74907 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74907); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74907); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74908 BindingCallContext& cx = s.GetCallContext();
74909
74910 JS::Rooted<JS::Value> rval(cx);
74911
74912 JS::Rooted<JSObject *> callback(cx, mCallback);
74913 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74914 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74915 && !InitIds(cx, atomsCache)) ||
74916 !JS_GetPropertyById(cx, callback, atomsCache->prefable7_id, &rval)) {
74917 aRv.Throw(NS_ERROR_UNEXPECTED);
74918 return bool(0);
74919 }
74920 bool rvalDecl;
74921 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable7", &rvalDecl)) {
74922 aRv.Throw(NS_ERROR_UNEXPECTED);
74923 return bool(0);
74924 }
74925 return rvalDecl;
74926}
74927
74928bool
74929TestJSImplInterfaceJSImpl::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm)
74930{
74931 CallSetup s(this, aRv, "TestJSImplInterface.prefable8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74932 if (aRv.Failed()) {
74933 return bool(0);
74934 }
74935 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74935); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74935); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74936 BindingCallContext& cx = s.GetCallContext();
74937
74938 JS::Rooted<JS::Value> rval(cx);
74939
74940 JS::Rooted<JSObject *> callback(cx, mCallback);
74941 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74942 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74943 && !InitIds(cx, atomsCache)) ||
74944 !JS_GetPropertyById(cx, callback, atomsCache->prefable8_id, &rval)) {
74945 aRv.Throw(NS_ERROR_UNEXPECTED);
74946 return bool(0);
74947 }
74948 bool rvalDecl;
74949 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable8", &rvalDecl)) {
74950 aRv.Throw(NS_ERROR_UNEXPECTED);
74951 return bool(0);
74952 }
74953 return rvalDecl;
74954}
74955
74956bool
74957TestJSImplInterfaceJSImpl::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm)
74958{
74959 CallSetup s(this, aRv, "TestJSImplInterface.prefable9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74960 if (aRv.Failed()) {
74961 return bool(0);
74962 }
74963 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74963); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74963); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74964 BindingCallContext& cx = s.GetCallContext();
74965
74966 JS::Rooted<JS::Value> rval(cx);
74967
74968 JS::Rooted<JSObject *> callback(cx, mCallback);
74969 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74970 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74971 && !InitIds(cx, atomsCache)) ||
74972 !JS_GetPropertyById(cx, callback, atomsCache->prefable9_id, &rval)) {
74973 aRv.Throw(NS_ERROR_UNEXPECTED);
74974 return bool(0);
74975 }
74976 bool rvalDecl;
74977 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable9", &rvalDecl)) {
74978 aRv.Throw(NS_ERROR_UNEXPECTED);
74979 return bool(0);
74980 }
74981 return rvalDecl;
74982}
74983
74984bool
74985TestJSImplInterfaceJSImpl::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm)
74986{
74987 CallSetup s(this, aRv, "TestJSImplInterface.prefable12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74988 if (aRv.Failed()) {
74989 return bool(0);
74990 }
74991 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74991); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 74991); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
74992 BindingCallContext& cx = s.GetCallContext();
74993
74994 JS::Rooted<JS::Value> rval(cx);
74995
74996 JS::Rooted<JSObject *> callback(cx, mCallback);
74997 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74998 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74999 && !InitIds(cx, atomsCache)) ||
75000 !JS_GetPropertyById(cx, callback, atomsCache->prefable12_id, &rval)) {
75001 aRv.Throw(NS_ERROR_UNEXPECTED);
75002 return bool(0);
75003 }
75004 bool rvalDecl;
75005 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable12", &rvalDecl)) {
75006 aRv.Throw(NS_ERROR_UNEXPECTED);
75007 return bool(0);
75008 }
75009 return rvalDecl;
75010}
75011
75012bool
75013TestJSImplInterfaceJSImpl::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm)
75014{
75015 CallSetup s(this, aRv, "TestJSImplInterface.prefable14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75016 if (aRv.Failed()) {
75017 return bool(0);
75018 }
75019 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75019); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75019); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75020 BindingCallContext& cx = s.GetCallContext();
75021
75022 JS::Rooted<JS::Value> rval(cx);
75023
75024 JS::Rooted<JSObject *> callback(cx, mCallback);
75025 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75026 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75027 && !InitIds(cx, atomsCache)) ||
75028 !JS_GetPropertyById(cx, callback, atomsCache->prefable14_id, &rval)) {
75029 aRv.Throw(NS_ERROR_UNEXPECTED);
75030 return bool(0);
75031 }
75032 bool rvalDecl;
75033 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable14", &rvalDecl)) {
75034 aRv.Throw(NS_ERROR_UNEXPECTED);
75035 return bool(0);
75036 }
75037 return rvalDecl;
75038}
75039
75040bool
75041TestJSImplInterfaceJSImpl::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm)
75042{
75043 CallSetup s(this, aRv, "TestJSImplInterface.prefable15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75044 if (aRv.Failed()) {
75045 return bool(0);
75046 }
75047 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75047); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75047); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75048 BindingCallContext& cx = s.GetCallContext();
75049
75050 JS::Rooted<JS::Value> rval(cx);
75051
75052 JS::Rooted<JSObject *> callback(cx, mCallback);
75053 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75054 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75055 && !InitIds(cx, atomsCache)) ||
75056 !JS_GetPropertyById(cx, callback, atomsCache->prefable15_id, &rval)) {
75057 aRv.Throw(NS_ERROR_UNEXPECTED);
75058 return bool(0);
75059 }
75060 bool rvalDecl;
75061 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable15", &rvalDecl)) {
75062 aRv.Throw(NS_ERROR_UNEXPECTED);
75063 return bool(0);
75064 }
75065 return rvalDecl;
75066}
75067
75068bool
75069TestJSImplInterfaceJSImpl::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm)
75070{
75071 CallSetup s(this, aRv, "TestJSImplInterface.prefable16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75072 if (aRv.Failed()) {
75073 return bool(0);
75074 }
75075 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75075); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75075); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75076 BindingCallContext& cx = s.GetCallContext();
75077
75078 JS::Rooted<JS::Value> rval(cx);
75079
75080 JS::Rooted<JSObject *> callback(cx, mCallback);
75081 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75082 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75083 && !InitIds(cx, atomsCache)) ||
75084 !JS_GetPropertyById(cx, callback, atomsCache->prefable16_id, &rval)) {
75085 aRv.Throw(NS_ERROR_UNEXPECTED);
75086 return bool(0);
75087 }
75088 bool rvalDecl;
75089 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable16", &rvalDecl)) {
75090 aRv.Throw(NS_ERROR_UNEXPECTED);
75091 return bool(0);
75092 }
75093 return rvalDecl;
75094}
75095
75096bool
75097TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm)
75098{
75099 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75100 if (aRv.Failed()) {
75101 return bool(0);
75102 }
75103 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75103); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75103); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75104 BindingCallContext& cx = s.GetCallContext();
75105
75106 JS::Rooted<JS::Value> rval(cx);
75107
75108 JS::Rooted<JSObject *> callback(cx, mCallback);
75109 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75110 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75111 && !InitIds(cx, atomsCache)) ||
75112 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext1_id, &rval)) {
75113 aRv.Throw(NS_ERROR_UNEXPECTED);
75114 return bool(0);
75115 }
75116 bool rvalDecl;
75117 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext1", &rvalDecl)) {
75118 aRv.Throw(NS_ERROR_UNEXPECTED);
75119 return bool(0);
75120 }
75121 return rvalDecl;
75122}
75123
75124bool
75125TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm)
75126{
75127 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75128 if (aRv.Failed()) {
75129 return bool(0);
75130 }
75131 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75131); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75131); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75132 BindingCallContext& cx = s.GetCallContext();
75133
75134 JS::Rooted<JS::Value> rval(cx);
75135
75136 JS::Rooted<JSObject *> callback(cx, mCallback);
75137 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75138 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75139 && !InitIds(cx, atomsCache)) ||
75140 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext2_id, &rval)) {
75141 aRv.Throw(NS_ERROR_UNEXPECTED);
75142 return bool(0);
75143 }
75144 bool rvalDecl;
75145 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext2", &rvalDecl)) {
75146 aRv.Throw(NS_ERROR_UNEXPECTED);
75147 return bool(0);
75148 }
75149 return rvalDecl;
75150}
75151
75152bool
75153TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm)
75154{
75155 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75156 if (aRv.Failed()) {
75157 return bool(0);
75158 }
75159 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75159); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75159); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75160 BindingCallContext& cx = s.GetCallContext();
75161
75162 JS::Rooted<JS::Value> rval(cx);
75163
75164 JS::Rooted<JSObject *> callback(cx, mCallback);
75165 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75166 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75167 && !InitIds(cx, atomsCache)) ||
75168 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext3_id, &rval)) {
75169 aRv.Throw(NS_ERROR_UNEXPECTED);
75170 return bool(0);
75171 }
75172 bool rvalDecl;
75173 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext3", &rvalDecl)) {
75174 aRv.Throw(NS_ERROR_UNEXPECTED);
75175 return bool(0);
75176 }
75177 return rvalDecl;
75178}
75179
75180bool
75181TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm)
75182{
75183 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75184 if (aRv.Failed()) {
75185 return bool(0);
75186 }
75187 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75187); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75187); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75188 BindingCallContext& cx = s.GetCallContext();
75189
75190 JS::Rooted<JS::Value> rval(cx);
75191
75192 JS::Rooted<JSObject *> callback(cx, mCallback);
75193 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75194 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75195 && !InitIds(cx, atomsCache)) ||
75196 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext4_id, &rval)) {
75197 aRv.Throw(NS_ERROR_UNEXPECTED);
75198 return bool(0);
75199 }
75200 bool rvalDecl;
75201 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext4", &rvalDecl)) {
75202 aRv.Throw(NS_ERROR_UNEXPECTED);
75203 return bool(0);
75204 }
75205 return rvalDecl;
75206}
75207
75208int32_t
75209TestJSImplInterfaceJSImpl::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm)
75210{
75211 CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75212 if (aRv.Failed()) {
75213 return int32_t(0);
75214 }
75215 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75215); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75215); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75216 BindingCallContext& cx = s.GetCallContext();
75217
75218 JS::Rooted<JS::Value> rval(cx);
75219
75220 JS::Rooted<JSObject *> callback(cx, mCallback);
75221 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75222 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75223 && !InitIds(cx, atomsCache)) ||
75224 !JS_GetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, &rval)) {
75225 aRv.Throw(NS_ERROR_UNEXPECTED);
75226 return int32_t(0);
75227 }
75228 int32_t rvalDecl;
75229 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attrWithLenientThis", &rvalDecl)) {
75230 aRv.Throw(NS_ERROR_UNEXPECTED);
75231 return int32_t(0);
75232 }
75233 return rvalDecl;
75234}
75235
75236already_AddRefed<TestJSImplInterface>
75237TestJSImplInterfaceJSImpl::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm)
75238{
75239 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75240 if (aRv.Failed()) {
75241 return nullptr;
75242 }
75243 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75243); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75244 BindingCallContext& cx = s.GetCallContext();
75245
75246 JS::Rooted<JS::Value> rval(cx);
75247
75248 JS::Rooted<JSObject *> callback(cx, mCallback);
75249 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75250 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75251 && !InitIds(cx, atomsCache)) ||
75252 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr_id, &rval)) {
75253 aRv.Throw(NS_ERROR_UNEXPECTED);
75254 return nullptr;
75255 }
75256 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75257 if (rval.isObject()) {
75258 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75259 {
75260 // Our JSContext should be in the right global to do unwrapping in.
75261 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75262 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75263 // Be careful to not wrap random DOM objects here, even if
75264 // they're wrapped in opaque security wrappers for some reason.
75265 // XXXbz Wish we could check for a JS-implemented object
75266 // that already has a content reflection...
75267 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75268 nsCOMPtr<nsIGlobalObject> contentGlobal;
75269 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75270 if (!callback ||
75271 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75272 aRv.Throw(NS_ERROR_UNEXPECTED);
75273 return nullptr;
75274 }
75275 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75276 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", 75277); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75277); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75277 "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", 75277); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75277); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75278 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75279 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75280 } else {
75281 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr", "TestJSImplInterface");
75282 aRv.Throw(NS_ERROR_UNEXPECTED);
75283 return nullptr;
75284 }
75285 }
75286 }
75287 } else {
75288 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr");
75289 aRv.Throw(NS_ERROR_UNEXPECTED);
75290 return nullptr;
75291 }
75292 return rvalDecl.forget();
75293}
75294
75295already_AddRefed<TestJSImplInterface>
75296TestJSImplInterfaceJSImpl::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm)
75297{
75298 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75299 if (aRv.Failed()) {
75300 return nullptr;
75301 }
75302 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75302); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75303 BindingCallContext& cx = s.GetCallContext();
75304
75305 JS::Rooted<JS::Value> rval(cx);
75306
75307 JS::Rooted<JSObject *> callback(cx, mCallback);
75308 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75309 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75310 && !InitIds(cx, atomsCache)) ||
75311 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr2_id, &rval)) {
75312 aRv.Throw(NS_ERROR_UNEXPECTED);
75313 return nullptr;
75314 }
75315 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75316 if (rval.isObject()) {
75317 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75318 {
75319 // Our JSContext should be in the right global to do unwrapping in.
75320 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75321 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75322 // Be careful to not wrap random DOM objects here, even if
75323 // they're wrapped in opaque security wrappers for some reason.
75324 // XXXbz Wish we could check for a JS-implemented object
75325 // that already has a content reflection...
75326 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75327 nsCOMPtr<nsIGlobalObject> contentGlobal;
75328 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75329 if (!callback ||
75330 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75331 aRv.Throw(NS_ERROR_UNEXPECTED);
75332 return nullptr;
75333 }
75334 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75335 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", 75336); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75336); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75336 "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", 75336); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75336); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75337 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75338 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75339 } else {
75340 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr2", "TestJSImplInterface");
75341 aRv.Throw(NS_ERROR_UNEXPECTED);
75342 return nullptr;
75343 }
75344 }
75345 }
75346 } else {
75347 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr2");
75348 aRv.Throw(NS_ERROR_UNEXPECTED);
75349 return nullptr;
75350 }
75351 return rvalDecl.forget();
75352}
75353
75354already_AddRefed<TestJSImplInterface>
75355TestJSImplInterfaceJSImpl::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm)
75356{
75357 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75358 if (aRv.Failed()) {
75359 return nullptr;
75360 }
75361 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75361); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75361); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75362 BindingCallContext& cx = s.GetCallContext();
75363
75364 JS::Rooted<JS::Value> rval(cx);
75365
75366 JS::Rooted<JSObject *> callback(cx, mCallback);
75367 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75368 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75369 && !InitIds(cx, atomsCache)) ||
75370 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr3_id, &rval)) {
75371 aRv.Throw(NS_ERROR_UNEXPECTED);
75372 return nullptr;
75373 }
75374 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75375 if (rval.isObject()) {
75376 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75377 {
75378 // Our JSContext should be in the right global to do unwrapping in.
75379 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75380 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75381 // Be careful to not wrap random DOM objects here, even if
75382 // they're wrapped in opaque security wrappers for some reason.
75383 // XXXbz Wish we could check for a JS-implemented object
75384 // that already has a content reflection...
75385 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75386 nsCOMPtr<nsIGlobalObject> contentGlobal;
75387 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75388 if (!callback ||
75389 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75390 aRv.Throw(NS_ERROR_UNEXPECTED);
75391 return nullptr;
75392 }
75393 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75394 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", 75395); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75395); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75395 "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", 75395); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { MOZ_CrashSequence(__null, 75395); __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75396 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75397 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75398 } else {
75399 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr3", "TestJSImplInterface");
75400 aRv.Throw(NS_ERROR_UNEXPECTED);
75401 return nullptr;
75402 }
75403 }
75404 }
75405 } else {
75406 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr3");
75407 aRv.Throw(NS_ERROR_UNEXPECTED);
75408 return nullptr;
75409 }
75410 return rvalDecl.forget();
75411}
75412
75413bool
75414TestJSImplInterfaceJSImpl::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm)
75415{
75416 CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75417 if (aRv.Failed()) {
75418 return bool(0);
75419 }
75420 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75420); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75420); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75421 BindingCallContext& cx = s.GetCallContext();
75422
75423 JS::Rooted<JS::Value> rval(cx);
75424
75425 JS::Rooted<JSObject *> callback(cx, mCallback);
75426 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75427 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75428 && !InitIds(cx, atomsCache)) ||
75429 !JS_GetPropertyById(cx, callback, atomsCache->throwingAttr_id, &rval)) {
75430 aRv.Throw(NS_ERROR_UNEXPECTED);
75431 return bool(0);
75432 }
75433 bool rvalDecl;
75434 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingAttr", &rvalDecl)) {
75435 aRv.Throw(NS_ERROR_UNEXPECTED);
75436 return bool(0);
75437 }
75438 return rvalDecl;
75439}
75440
75441bool
75442TestJSImplInterfaceJSImpl::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75443{
75444 CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75445 if (aRv.Failed()) {
75446 return bool(0);
75447 }
75448 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75448); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75448); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75449 BindingCallContext& cx = s.GetCallContext();
75450
75451 JS::Rooted<JS::Value> rval(cx);
75452
75453 JS::Rooted<JSObject *> callback(cx, mCallback);
75454 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75455 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75456 && !InitIds(cx, atomsCache)) ||
75457 !JS_GetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, &rval)) {
75458 aRv.Throw(NS_ERROR_UNEXPECTED);
75459 return bool(0);
75460 }
75461 bool rvalDecl;
75462 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingGetterAttr", &rvalDecl)) {
75463 aRv.Throw(NS_ERROR_UNEXPECTED);
75464 return bool(0);
75465 }
75466 return rvalDecl;
75467}
75468
75469bool
75470TestJSImplInterfaceJSImpl::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75471{
75472 CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75473 if (aRv.Failed()) {
75474 return bool(0);
75475 }
75476 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75476); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75476); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75477 BindingCallContext& cx = s.GetCallContext();
75478
75479 JS::Rooted<JS::Value> rval(cx);
75480
75481 JS::Rooted<JSObject *> callback(cx, mCallback);
75482 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75483 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75484 && !InitIds(cx, atomsCache)) ||
75485 !JS_GetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, &rval)) {
75486 aRv.Throw(NS_ERROR_UNEXPECTED);
75487 return bool(0);
75488 }
75489 bool rvalDecl;
75490 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingSetterAttr", &rvalDecl)) {
75491 aRv.Throw(NS_ERROR_UNEXPECTED);
75492 return bool(0);
75493 }
75494 return rvalDecl;
75495}
75496
75497bool
75498TestJSImplInterfaceJSImpl::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm)
75499{
75500 CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75501 if (aRv.Failed()) {
75502 return bool(0);
75503 }
75504 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75504); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75504); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75505 BindingCallContext& cx = s.GetCallContext();
75506
75507 JS::Rooted<JS::Value> rval(cx);
75508
75509 JS::Rooted<JSObject *> callback(cx, mCallback);
75510 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75511 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75512 && !InitIds(cx, atomsCache)) ||
75513 !JS_GetPropertyById(cx, callback, atomsCache->canOOMAttr_id, &rval)) {
75514 aRv.Throw(NS_ERROR_UNEXPECTED);
75515 return bool(0);
75516 }
75517 bool rvalDecl;
75518 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMAttr", &rvalDecl)) {
75519 aRv.Throw(NS_ERROR_UNEXPECTED);
75520 return bool(0);
75521 }
75522 return rvalDecl;
75523}
75524
75525bool
75526TestJSImplInterfaceJSImpl::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75527{
75528 CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75529 if (aRv.Failed()) {
75530 return bool(0);
75531 }
75532 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75532); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75532); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75533 BindingCallContext& cx = s.GetCallContext();
75534
75535 JS::Rooted<JS::Value> rval(cx);
75536
75537 JS::Rooted<JSObject *> callback(cx, mCallback);
75538 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75539 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75540 && !InitIds(cx, atomsCache)) ||
75541 !JS_GetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, &rval)) {
75542 aRv.Throw(NS_ERROR_UNEXPECTED);
75543 return bool(0);
75544 }
75545 bool rvalDecl;
75546 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMGetterAttr", &rvalDecl)) {
75547 aRv.Throw(NS_ERROR_UNEXPECTED);
75548 return bool(0);
75549 }
75550 return rvalDecl;
75551}
75552
75553bool
75554TestJSImplInterfaceJSImpl::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75555{
75556 CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75557 if (aRv.Failed()) {
75558 return bool(0);
75559 }
75560 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75560); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75560); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75561 BindingCallContext& cx = s.GetCallContext();
75562
75563 JS::Rooted<JS::Value> rval(cx);
75564
75565 JS::Rooted<JSObject *> callback(cx, mCallback);
75566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75568 && !InitIds(cx, atomsCache)) ||
75569 !JS_GetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, &rval)) {
75570 aRv.Throw(NS_ERROR_UNEXPECTED);
75571 return bool(0);
75572 }
75573 bool rvalDecl;
75574 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMSetterAttr", &rvalDecl)) {
75575 aRv.Throw(NS_ERROR_UNEXPECTED);
75576 return bool(0);
75577 }
75578 return rvalDecl;
75579}
75580
75581bool
75582TestJSImplInterfaceJSImpl::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm)
75583{
75584 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75585 if (aRv.Failed()) {
75586 return bool(0);
75587 }
75588 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75588); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75589 BindingCallContext& cx = s.GetCallContext();
75590
75591 JS::Rooted<JS::Value> rval(cx);
75592
75593 JS::Rooted<JSObject *> callback(cx, mCallback);
75594 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75595 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75596 && !InitIds(cx, atomsCache)) ||
75597 !JS_GetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, &rval)) {
75598 aRv.Throw(NS_ERROR_UNEXPECTED);
75599 return bool(0);
75600 }
75601 bool rvalDecl;
75602 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.ceReactionsAttr", &rvalDecl)) {
75603 aRv.Throw(NS_ERROR_UNEXPECTED);
75604 return bool(0);
75605 }
75606 return rvalDecl;
75607}
75608
75609void
75610TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75611{
75612 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75613 if (aRv.Failed()) {
75614 return;
75615 }
75616 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75616); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75617 BindingCallContext& cx = s.GetCallContext();
75618
75619 JS::Rooted<JS::Value> rval(cx);
75620
75621 JS::Rooted<JSObject *> callback(cx, mCallback);
75622 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75623 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75624 && !InitIds(cx, atomsCache)) ||
75625 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, &rval)) {
75626 aRv.Throw(NS_ERROR_UNEXPECTED);
75627 return;
75628 }
75629 JS::Rooted<JS::Value> rvalDecl(cx);
75630#ifdef __clang__1
75631#pragma clang diagnostic push
75632#pragma clang diagnostic ignored "-Wunreachable-code"
75633#pragma clang diagnostic ignored "-Wunreachable-code-return"
75634#endif // __clang__
75635 if ((false) && !CallerSubsumes(rval)) {
75636 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSONShouldSkipThis");
75637 aRv.Throw(NS_ERROR_UNEXPECTED);
75638 return;
75639 }
75640#ifdef __clang__1
75641#pragma clang diagnostic pop
75642#endif // __clang__
75643 rvalDecl = rval;
75644 aRetVal.set(rvalDecl);
75645}
75646
75647already_AddRefed<TestParentInterface>
75648TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm)
75649{
75650 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75651 if (aRv.Failed()) {
75652 return nullptr;
75653 }
75654 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75654); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75654); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75655 BindingCallContext& cx = s.GetCallContext();
75656
75657 JS::Rooted<JS::Value> rval(cx);
75658
75659 JS::Rooted<JSObject *> callback(cx, mCallback);
75660 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75661 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75662 && !InitIds(cx, atomsCache)) ||
75663 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, &rval)) {
75664 aRv.Throw(NS_ERROR_UNEXPECTED);
75665 return nullptr;
75666 }
75667 RefPtr<mozilla::dom::TestParentInterface> rvalDecl;
75668 if (rval.isObject()) {
75669 static_assert(IsRefcounted<mozilla::dom::TestParentInterface>::value, "We can only store refcounted classes.");
75670 {
75671 // Our JSContext should be in the right global to do unwrapping in.
75672 nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(rval, rvalDecl, cx);
75673 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75674 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.toJSONShouldSkipThis2", "TestParentInterface");
75675 aRv.Throw(NS_ERROR_UNEXPECTED);
75676 return nullptr;
75677 }
75678 }
75679 } else {
75680 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis2");
75681 aRv.Throw(NS_ERROR_UNEXPECTED);
75682 return nullptr;
75683 }
75684 return rvalDecl.forget();
75685}
75686
75687already_AddRefed<TestCallbackInterface>
75688TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm)
75689{
75690 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75691 if (aRv.Failed()) {
75692 return nullptr;
75693 }
75694 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75694); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75695 BindingCallContext& cx = s.GetCallContext();
75696
75697 JS::Rooted<JS::Value> rval(cx);
75698
75699 JS::Rooted<JSObject *> callback(cx, mCallback);
75700 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75701 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75702 && !InitIds(cx, atomsCache)) ||
75703 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, &rval)) {
75704 aRv.Throw(NS_ERROR_UNEXPECTED);
75705 return nullptr;
75706 }
75707 RefPtr<TestCallbackInterface> rvalDecl;
75708 if (rval.isObject()) {
75709 { // scope for tempRoot and tempGlobalRoot if needed
75710 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
75711 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
75712 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
75713 }
75714 } else {
75715 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis3");
75716 aRv.Throw(NS_ERROR_UNEXPECTED);
75717 return nullptr;
75718 }
75719 return rvalDecl.forget();
75720}
75721
75722int8_t
75723TestJSImplInterfaceJSImpl::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm)
75724{
75725 CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75726 if (aRv.Failed()) {
75727 return int8_t(0);
75728 }
75729 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75729); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75729); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75730 BindingCallContext& cx = s.GetCallContext();
75731
75732 JS::Rooted<JS::Value> rval(cx);
75733
75734 JS::Rooted<JSObject *> callback(cx, mCallback);
75735 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75736 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75737 && !InitIds(cx, atomsCache)) ||
75738 !JS_GetPropertyById(cx, callback, atomsCache->dashed_attribute_id, &rval)) {
75739 aRv.Throw(NS_ERROR_UNEXPECTED);
75740 return int8_t(0);
75741 }
75742 int8_t rvalDecl;
75743 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.dashed-attribute", &rvalDecl)) {
75744 aRv.Throw(NS_ERROR_UNEXPECTED);
75745 return int8_t(0);
75746 }
75747 return rvalDecl;
75748}
75749
75750bool
75751TestJSImplInterfaceJSImpl::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm)
75752{
75753 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75754 if (aRv.Failed()) {
75755 return bool(0);
75756 }
75757 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75757); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75757); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75758 BindingCallContext& cx = s.GetCallContext();
75759
75760 JS::Rooted<JS::Value> rval(cx);
75761
75762 JS::Rooted<JSObject *> callback(cx, mCallback);
75763 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75764 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75765 && !InitIds(cx, atomsCache)) ||
75766 !JS_GetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, &rval)) {
75767 aRv.Throw(NS_ERROR_UNEXPECTED);
75768 return bool(0);
75769 }
75770 bool rvalDecl;
75771 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.nonEnumerableAttr", &rvalDecl)) {
75772 aRv.Throw(NS_ERROR_UNEXPECTED);
75773 return bool(0);
75774 }
75775 return rvalDecl;
75776}
75777
75778void
75779TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75780{
75781 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75782 if (aRv.Failed()) {
75783 return;
75784 }
75785 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75785); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75785); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75786 BindingCallContext& cx = s.GetCallContext();
75787
75788 JS::Rooted<JS::Value> rval(cx);
75789
75790 JS::Rooted<JSObject *> callback(cx, mCallback);
75791 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75792 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75793 && !InitIds(cx, atomsCache)) ||
75794 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, &rval)) {
75795 aRv.Throw(NS_ERROR_UNEXPECTED);
75796 return;
75797 }
75798 RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx);
75799 if (rval.isObject()) {
75800 if (!rvalDecl.Init(&rval.toObject())) {
75801 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef", "ArrayBufferView");
75802 aRv.Throw(NS_ERROR_UNEXPECTED);
75803 return;
75804 }
75805 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
75806 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75807 aRv.Throw(NS_ERROR_UNEXPECTED);
75808 return;
75809 }
75810 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
75811 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75812 aRv.Throw(NS_ERROR_UNEXPECTED);
75813 return;
75814 }
75815 if (JS::IsImmutableArrayBufferView(rvalDecl.Obj())) {
75816 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75817 aRv.Throw(NS_ERROR_UNEXPECTED);
75818 return;
75819 }
75820 } else {
75821 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75822 aRv.Throw(NS_ERROR_UNEXPECTED);
75823 return;
75824 }
75825 aRetVal.set(rvalDecl.Obj());
75826}
75827
75828void
75829TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75830{
75831 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75832 if (aRv.Failed()) {
75833 return;
75834 }
75835 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75835); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75835); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75836 BindingCallContext& cx = s.GetCallContext();
75837
75838 JS::Rooted<JS::Value> rval(cx);
75839
75840 JS::Rooted<JSObject *> callback(cx, mCallback);
75841 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75842 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75843 && !InitIds(cx, atomsCache)) ||
75844 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, &rval)) {
75845 aRv.Throw(NS_ERROR_UNEXPECTED);
75846 return;
75847 }
75848 RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx);
75849 if (rval.isObject()) {
75850 if (!rvalDecl.Init(&rval.toObject())) {
75851 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferView", "ArrayBufferView");
75852 aRv.Throw(NS_ERROR_UNEXPECTED);
75853 return;
75854 }
75855 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
75856 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75857 aRv.Throw(NS_ERROR_UNEXPECTED);
75858 return;
75859 }
75860 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
75861 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75862 aRv.Throw(NS_ERROR_UNEXPECTED);
75863 return;
75864 }
75865 if (JS::IsImmutableArrayBufferView(rvalDecl.Obj())) {
75866 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75867 aRv.Throw(NS_ERROR_UNEXPECTED);
75868 return;
75869 }
75870 } else {
75871 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75872 aRv.Throw(NS_ERROR_UNEXPECTED);
75873 return;
75874 }
75875 aRetVal.set(rvalDecl.Obj());
75876}
75877
75878void
75879TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75880{
75881 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75882 if (aRv.Failed()) {
75883 return;
75884 }
75885 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75885); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75885); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75886 BindingCallContext& cx = s.GetCallContext();
75887
75888 JS::Rooted<JS::Value> rval(cx);
75889
75890 JS::Rooted<JSObject *> callback(cx, mCallback);
75891 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75892 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75893 && !InitIds(cx, atomsCache)) ||
75894 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, &rval)) {
75895 aRv.Throw(NS_ERROR_UNEXPECTED);
75896 return;
75897 }
75898 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> rvalDecl(cx);
75899 if (rval.isObject()) {
75900 if (!rvalDecl.SetValue().Init(&rval.toObject())) {
75901 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView", "ArrayBufferViewOrNull");
75902 aRv.Throw(NS_ERROR_UNEXPECTED);
75903 return;
75904 }
75905 if (JS::IsLargeArrayBufferView(rvalDecl.SetValue().Obj())) {
75906 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75907 aRv.Throw(NS_ERROR_UNEXPECTED);
75908 return;
75909 }
75910 if (JS::IsResizableArrayBufferView(rvalDecl.SetValue().Obj())) {
75911 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75912 aRv.Throw(NS_ERROR_UNEXPECTED);
75913 return;
75914 }
75915 if (JS::IsImmutableArrayBufferView(rvalDecl.SetValue().Obj())) {
75916 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75917 aRv.Throw(NS_ERROR_UNEXPECTED);
75918 return;
75919 }
75920 } else if (rval.isNullOrUndefined()) {
75921 rvalDecl.SetNull();
75922 } else {
75923 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75924 aRv.Throw(NS_ERROR_UNEXPECTED);
75925 return;
75926 }
75927 aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj());
75928}
75929
75930void
75931TestJSImplInterfaceJSImpl::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75932{
75933 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75934 if (aRv.Failed()) {
75935 return;
75936 }
75937 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75937); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75937); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75938 BindingCallContext& cx = s.GetCallContext();
75939
75940 JS::Rooted<JS::Value> rval(cx);
75941
75942 JS::Rooted<JSObject *> callback(cx, mCallback);
75943 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75944 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75945 && !InitIds(cx, atomsCache)) ||
75946 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, &rval)) {
75947 aRv.Throw(NS_ERROR_UNEXPECTED);
75948 return;
75949 }
75950 RootedSpiderMonkeyInterface<ArrayBuffer> rvalDecl(cx);
75951 if (rval.isObject()) {
75952 if (!rvalDecl.Init(&rval.toObject())) {
75953 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBuffer", "ArrayBuffer");
75954 aRv.Throw(NS_ERROR_UNEXPECTED);
75955 return;
75956 }
75957 if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.Obj())) {
75958 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75959 aRv.Throw(NS_ERROR_UNEXPECTED);
75960 return;
75961 }
75962 if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.Obj())) {
75963 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75964 aRv.Throw(NS_ERROR_UNEXPECTED);
75965 return;
75966 }
75967 if (JS::IsImmutableArrayBufferMaybeShared(rvalDecl.Obj())) {
75968 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75969 aRv.Throw(NS_ERROR_UNEXPECTED);
75970 return;
75971 }
75972 } else {
75973 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75974 aRv.Throw(NS_ERROR_UNEXPECTED);
75975 return;
75976 }
75977 aRetVal.set(rvalDecl.Obj());
75978}
75979
75980void
75981TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75982{
75983 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75984 if (aRv.Failed()) {
75985 return;
75986 }
75987 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75987); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 75987); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
75988 BindingCallContext& cx = s.GetCallContext();
75989
75990 JS::Rooted<JS::Value> rval(cx);
75991
75992 JS::Rooted<JSObject *> callback(cx, mCallback);
75993 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75994 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75995 && !InitIds(cx, atomsCache)) ||
75996 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBuffer_id, &rval)) {
75997 aRv.Throw(NS_ERROR_UNEXPECTED);
75998 return;
75999 }
76000 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> rvalDecl(cx);
76001 if (rval.isObject()) {
76002 if (!rvalDecl.SetValue().Init(&rval.toObject())) {
76003 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer", "ArrayBufferOrNull");
76004 aRv.Throw(NS_ERROR_UNEXPECTED);
76005 return;
76006 }
76007 if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) {
76008 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
76009 aRv.Throw(NS_ERROR_UNEXPECTED);
76010 return;
76011 }
76012 if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) {
76013 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
76014 aRv.Throw(NS_ERROR_UNEXPECTED);
76015 return;
76016 }
76017 if (JS::IsImmutableArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) {
76018 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_IMMUTABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
76019 aRv.Throw(NS_ERROR_UNEXPECTED);
76020 return;
76021 }
76022 } else if (rval.isNullOrUndefined()) {
76023 rvalDecl.SetNull();
76024 } else {
76025 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
76026 aRv.Throw(NS_ERROR_UNEXPECTED);
76027 return;
76028 }
76029 aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj());
76030}
76031
76032void
76033TestJSImplInterfaceJSImpl::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76034{
76035 CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76036 if (aRv.Failed()) {
76037 return;
76038 }
76039 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76039); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76039); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76040 BindingCallContext& cx = s.GetCallContext();
76041
76042 JS::RootedVector<JS::Value> argv(cx);
76043 if (!argv.resize(1)) {
76044 // That threw an exception on the JSContext, and our CallSetup will do
76045 // the right thing with that.
76046 return;
76047 }
76048 do {
76049 argv[0].setInt32(int32_t(arg));
76050 break;
76051 } while (false);
76052
76053 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", 76053); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76053); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76054 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76055 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76056 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76057 !InitIds(cx, atomsCache)) ||
76058 !JS_SetPropertyById(cx, callback, atomsCache->writableByte_id, argv[0])) {
76059 aRv.Throw(NS_ERROR_UNEXPECTED);
76060 return;
76061 }
76062}
76063
76064void
76065TestJSImplInterfaceJSImpl::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76066{
76067 CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76068 if (aRv.Failed()) {
76069 return;
76070 }
76071 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76071); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76071); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76072 BindingCallContext& cx = s.GetCallContext();
76073
76074 JS::RootedVector<JS::Value> argv(cx);
76075 if (!argv.resize(1)) {
76076 // That threw an exception on the JSContext, and our CallSetup will do
76077 // the right thing with that.
76078 return;
76079 }
76080 do {
76081 argv[0].setInt32(int32_t(arg));
76082 break;
76083 } while (false);
76084
76085 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", 76085); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76085); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76086 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76087 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76088 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76089 !InitIds(cx, atomsCache)) ||
76090 !JS_SetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, argv[0])) {
76091 aRv.Throw(NS_ERROR_UNEXPECTED);
76092 return;
76093 }
76094}
76095
76096void
76097TestJSImplInterfaceJSImpl::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76098{
76099 CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76100 if (aRv.Failed()) {
76101 return;
76102 }
76103 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76103); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76103); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76104 BindingCallContext& cx = s.GetCallContext();
76105
76106 JS::RootedVector<JS::Value> argv(cx);
76107 if (!argv.resize(1)) {
76108 // That threw an exception on the JSContext, and our CallSetup will do
76109 // the right thing with that.
76110 return;
76111 }
76112 do {
76113 argv[0].setInt32(int32_t(arg));
76114 break;
76115 } while (false);
76116
76117 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", 76117); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76117); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76118 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76119 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76120 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76121 !InitIds(cx, atomsCache)) ||
76122 !JS_SetPropertyById(cx, callback, atomsCache->domDependentByte_id, argv[0])) {
76123 aRv.Throw(NS_ERROR_UNEXPECTED);
76124 return;
76125 }
76126}
76127
76128void
76129TestJSImplInterfaceJSImpl::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76130{
76131 CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76132 if (aRv.Failed()) {
76133 return;
76134 }
76135 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76135); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76135); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76136 BindingCallContext& cx = s.GetCallContext();
76137
76138 JS::RootedVector<JS::Value> argv(cx);
76139 if (!argv.resize(1)) {
76140 // That threw an exception on the JSContext, and our CallSetup will do
76141 // the right thing with that.
76142 return;
76143 }
76144 do {
76145 argv[0].setInt32(int32_t(arg));
76146 break;
76147 } while (false);
76148
76149 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", 76149); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76149); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76150 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76151 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76152 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76153 !InitIds(cx, atomsCache)) ||
76154 !JS_SetPropertyById(cx, callback, atomsCache->writableShort_id, argv[0])) {
76155 aRv.Throw(NS_ERROR_UNEXPECTED);
76156 return;
76157 }
76158}
76159
76160void
76161TestJSImplInterfaceJSImpl::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76162{
76163 CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76164 if (aRv.Failed()) {
76165 return;
76166 }
76167 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76167); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76167); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76168 BindingCallContext& cx = s.GetCallContext();
76169
76170 JS::RootedVector<JS::Value> argv(cx);
76171 if (!argv.resize(1)) {
76172 // That threw an exception on the JSContext, and our CallSetup will do
76173 // the right thing with that.
76174 return;
76175 }
76176 do {
76177 argv[0].setInt32(int32_t(arg));
76178 break;
76179 } while (false);
76180
76181 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", 76181); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76181); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76182 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76183 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76184 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76185 !InitIds(cx, atomsCache)) ||
76186 !JS_SetPropertyById(cx, callback, atomsCache->writableLong_id, argv[0])) {
76187 aRv.Throw(NS_ERROR_UNEXPECTED);
76188 return;
76189 }
76190}
76191
76192void
76193TestJSImplInterfaceJSImpl::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76194{
76195 CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76196 if (aRv.Failed()) {
76197 return;
76198 }
76199 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76199); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76199); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76200 BindingCallContext& cx = s.GetCallContext();
76201
76202 JS::RootedVector<JS::Value> argv(cx);
76203 if (!argv.resize(1)) {
76204 // That threw an exception on the JSContext, and our CallSetup will do
76205 // the right thing with that.
76206 return;
76207 }
76208 do {
76209 argv[0].set(JS_NumberValue(double(arg)));
76210 break;
76211 } while (false);
76212
76213 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", 76213); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76213); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76214 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76215 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76216 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76217 !InitIds(cx, atomsCache)) ||
76218 !JS_SetPropertyById(cx, callback, atomsCache->writableLongLong_id, argv[0])) {
76219 aRv.Throw(NS_ERROR_UNEXPECTED);
76220 return;
76221 }
76222}
76223
76224void
76225TestJSImplInterfaceJSImpl::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76226{
76227 CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76228 if (aRv.Failed()) {
76229 return;
76230 }
76231 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76231); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76232 BindingCallContext& cx = s.GetCallContext();
76233
76234 JS::RootedVector<JS::Value> argv(cx);
76235 if (!argv.resize(1)) {
76236 // That threw an exception on the JSContext, and our CallSetup will do
76237 // the right thing with that.
76238 return;
76239 }
76240 do {
76241 argv[0].setInt32(int32_t(arg));
76242 break;
76243 } while (false);
76244
76245 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", 76245); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76245); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76246 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76247 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76248 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76249 !InitIds(cx, atomsCache)) ||
76250 !JS_SetPropertyById(cx, callback, atomsCache->writableOctet_id, argv[0])) {
76251 aRv.Throw(NS_ERROR_UNEXPECTED);
76252 return;
76253 }
76254}
76255
76256void
76257TestJSImplInterfaceJSImpl::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76258{
76259 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76260 if (aRv.Failed()) {
76261 return;
76262 }
76263 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76263); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76264 BindingCallContext& cx = s.GetCallContext();
76265
76266 JS::RootedVector<JS::Value> argv(cx);
76267 if (!argv.resize(1)) {
76268 // That threw an exception on the JSContext, and our CallSetup will do
76269 // the right thing with that.
76270 return;
76271 }
76272 do {
76273 argv[0].setInt32(int32_t(arg));
76274 break;
76275 } while (false);
76276
76277 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", 76277); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76277); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76278 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76279 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76280 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76281 !InitIds(cx, atomsCache)) ||
76282 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, argv[0])) {
76283 aRv.Throw(NS_ERROR_UNEXPECTED);
76284 return;
76285 }
76286}
76287
76288void
76289TestJSImplInterfaceJSImpl::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76290{
76291 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76292 if (aRv.Failed()) {
76293 return;
76294 }
76295 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76295); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76295); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76296 BindingCallContext& cx = s.GetCallContext();
76297
76298 JS::RootedVector<JS::Value> argv(cx);
76299 if (!argv.resize(1)) {
76300 // That threw an exception on the JSContext, and our CallSetup will do
76301 // the right thing with that.
76302 return;
76303 }
76304 do {
76305 argv[0].setNumber(arg);
76306 break;
76307 } while (false);
76308
76309 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", 76309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76309); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76310 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76311 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76312 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76313 !InitIds(cx, atomsCache)) ||
76314 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, argv[0])) {
76315 aRv.Throw(NS_ERROR_UNEXPECTED);
76316 return;
76317 }
76318}
76319
76320void
76321TestJSImplInterfaceJSImpl::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76322{
76323 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76324 if (aRv.Failed()) {
76325 return;
76326 }
76327 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76327); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76327); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76328 BindingCallContext& cx = s.GetCallContext();
76329
76330 JS::RootedVector<JS::Value> argv(cx);
76331 if (!argv.resize(1)) {
76332 // That threw an exception on the JSContext, and our CallSetup will do
76333 // the right thing with that.
76334 return;
76335 }
76336 do {
76337 argv[0].set(JS_NumberValue(double(arg)));
76338 break;
76339 } while (false);
76340
76341 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", 76341); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76341); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76342 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76343 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76344 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76345 !InitIds(cx, atomsCache)) ||
76346 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, argv[0])) {
76347 aRv.Throw(NS_ERROR_UNEXPECTED);
76348 return;
76349 }
76350}
76351
76352void
76353TestJSImplInterfaceJSImpl::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76354{
76355 CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76356 if (aRv.Failed()) {
76357 return;
76358 }
76359 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76359); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76359); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76360 BindingCallContext& cx = s.GetCallContext();
76361
76362 JS::RootedVector<JS::Value> argv(cx);
76363 if (!argv.resize(1)) {
76364 // That threw an exception on the JSContext, and our CallSetup will do
76365 // the right thing with that.
76366 return;
76367 }
76368 do {
76369 argv[0].set(JS_NumberValue(double(arg)));
76370 break;
76371 } while (false);
76372
76373 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", 76373); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76373); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76374 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76375 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76376 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76377 !InitIds(cx, atomsCache)) ||
76378 !JS_SetPropertyById(cx, callback, atomsCache->writableFloat_id, argv[0])) {
76379 aRv.Throw(NS_ERROR_UNEXPECTED);
76380 return;
76381 }
76382}
76383
76384void
76385TestJSImplInterfaceJSImpl::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76386{
76387 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76388 if (aRv.Failed()) {
76389 return;
76390 }
76391 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76391); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76391); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76392 BindingCallContext& cx = s.GetCallContext();
76393
76394 JS::RootedVector<JS::Value> argv(cx);
76395 if (!argv.resize(1)) {
76396 // That threw an exception on the JSContext, and our CallSetup will do
76397 // the right thing with that.
76398 return;
76399 }
76400 do {
76401 argv[0].set(JS_NumberValue(double(arg)));
76402 break;
76403 } while (false);
76404
76405 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", 76405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76406 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76407 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76408 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76409 !InitIds(cx, atomsCache)) ||
76410 !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, argv[0])) {
76411 aRv.Throw(NS_ERROR_UNEXPECTED);
76412 return;
76413 }
76414}
76415
76416void
76417TestJSImplInterfaceJSImpl::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76418{
76419 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76420 if (aRv.Failed()) {
76421 return;
76422 }
76423 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76423); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76423); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76424 BindingCallContext& cx = s.GetCallContext();
76425
76426 JS::RootedVector<JS::Value> argv(cx);
76427 if (!argv.resize(1)) {
76428 // That threw an exception on the JSContext, and our CallSetup will do
76429 // the right thing with that.
76430 return;
76431 }
76432 do {
76433 if (arg.IsNull()) {
76434 argv[0].setNull();
76435 break;
76436 }
76437 argv[0].set(JS_NumberValue(double(arg.Value())));
76438 break;
76439 } while (false);
76440
76441 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", 76441); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76441); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76442 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76443 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76444 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76445 !InitIds(cx, atomsCache)) ||
76446 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, argv[0])) {
76447 aRv.Throw(NS_ERROR_UNEXPECTED);
76448 return;
76449 }
76450}
76451
76452void
76453TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76454{
76455 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76456 if (aRv.Failed()) {
76457 return;
76458 }
76459 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76459); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76459); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76460 BindingCallContext& cx = s.GetCallContext();
76461
76462 JS::RootedVector<JS::Value> argv(cx);
76463 if (!argv.resize(1)) {
76464 // That threw an exception on the JSContext, and our CallSetup will do
76465 // the right thing with that.
76466 return;
76467 }
76468 do {
76469 if (arg.IsNull()) {
76470 argv[0].setNull();
76471 break;
76472 }
76473 argv[0].set(JS_NumberValue(double(arg.Value())));
76474 break;
76475 } while (false);
76476
76477 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", 76477); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76477); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76478 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76479 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76480 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76481 !InitIds(cx, atomsCache)) ||
76482 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, argv[0])) {
76483 aRv.Throw(NS_ERROR_UNEXPECTED);
76484 return;
76485 }
76486}
76487
76488void
76489TestJSImplInterfaceJSImpl::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76490{
76491 CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76492 if (aRv.Failed()) {
76493 return;
76494 }
76495 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76495); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76495); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76496 BindingCallContext& cx = s.GetCallContext();
76497
76498 JS::RootedVector<JS::Value> argv(cx);
76499 if (!argv.resize(1)) {
76500 // That threw an exception on the JSContext, and our CallSetup will do
76501 // the right thing with that.
76502 return;
76503 }
76504 do {
76505 argv[0].set(JS_NumberValue(double(arg)));
76506 break;
76507 } while (false);
76508
76509 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", 76509); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76509); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76510 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76511 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76512 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76513 !InitIds(cx, atomsCache)) ||
76514 !JS_SetPropertyById(cx, callback, atomsCache->writableDouble_id, argv[0])) {
76515 aRv.Throw(NS_ERROR_UNEXPECTED);
76516 return;
76517 }
76518}
76519
76520void
76521TestJSImplInterfaceJSImpl::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76522{
76523 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76524 if (aRv.Failed()) {
76525 return;
76526 }
76527 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76527); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76527); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76528 BindingCallContext& cx = s.GetCallContext();
76529
76530 JS::RootedVector<JS::Value> argv(cx);
76531 if (!argv.resize(1)) {
76532 // That threw an exception on the JSContext, and our CallSetup will do
76533 // the right thing with that.
76534 return;
76535 }
76536 do {
76537 argv[0].set(JS_NumberValue(double(arg)));
76538 break;
76539 } while (false);
76540
76541 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", 76541); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76541); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76542 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76543 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76544 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76545 !InitIds(cx, atomsCache)) ||
76546 !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, argv[0])) {
76547 aRv.Throw(NS_ERROR_UNEXPECTED);
76548 return;
76549 }
76550}
76551
76552void
76553TestJSImplInterfaceJSImpl::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76554{
76555 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76556 if (aRv.Failed()) {
76557 return;
76558 }
76559 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76559); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76559); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76560 BindingCallContext& cx = s.GetCallContext();
76561
76562 JS::RootedVector<JS::Value> argv(cx);
76563 if (!argv.resize(1)) {
76564 // That threw an exception on the JSContext, and our CallSetup will do
76565 // the right thing with that.
76566 return;
76567 }
76568 do {
76569 if (arg.IsNull()) {
76570 argv[0].setNull();
76571 break;
76572 }
76573 argv[0].set(JS_NumberValue(double(arg.Value())));
76574 break;
76575 } while (false);
76576
76577 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", 76577); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76577); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76578 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76579 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76580 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76581 !InitIds(cx, atomsCache)) ||
76582 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, argv[0])) {
76583 aRv.Throw(NS_ERROR_UNEXPECTED);
76584 return;
76585 }
76586}
76587
76588void
76589TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76590{
76591 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76592 if (aRv.Failed()) {
76593 return;
76594 }
76595 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76595); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76595); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76596 BindingCallContext& cx = s.GetCallContext();
76597
76598 JS::RootedVector<JS::Value> argv(cx);
76599 if (!argv.resize(1)) {
76600 // That threw an exception on the JSContext, and our CallSetup will do
76601 // the right thing with that.
76602 return;
76603 }
76604 do {
76605 if (arg.IsNull()) {
76606 argv[0].setNull();
76607 break;
76608 }
76609 argv[0].set(JS_NumberValue(double(arg.Value())));
76610 break;
76611 } while (false);
76612
76613 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", 76613); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76613); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76614 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76615 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76616 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76617 !InitIds(cx, atomsCache)) ||
76618 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, argv[0])) {
76619 aRv.Throw(NS_ERROR_UNEXPECTED);
76620 return;
76621 }
76622}
76623
76624void
76625TestJSImplInterfaceJSImpl::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76626{
76627 CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76628 if (aRv.Failed()) {
76629 return;
76630 }
76631 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76631); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76631); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76632 BindingCallContext& cx = s.GetCallContext();
76633
76634 JS::RootedVector<JS::Value> argv(cx);
76635 if (!argv.resize(1)) {
76636 // That threw an exception on the JSContext, and our CallSetup will do
76637 // the right thing with that.
76638 return;
76639 }
76640 do {
76641 argv[0].set(JS_NumberValue(double(arg)));
76642 break;
76643 } while (false);
76644
76645 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", 76645); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76645); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76646 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76647 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76648 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76649 !InitIds(cx, atomsCache)) ||
76650 !JS_SetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, argv[0])) {
76651 aRv.Throw(NS_ERROR_UNEXPECTED);
76652 return;
76653 }
76654}
76655
76656void
76657TestJSImplInterfaceJSImpl::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76658{
76659 CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76660 if (aRv.Failed()) {
76661 return;
76662 }
76663 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76663); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76663); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76664 BindingCallContext& cx = s.GetCallContext();
76665
76666 JS::RootedVector<JS::Value> argv(cx);
76667 if (!argv.resize(1)) {
76668 // That threw an exception on the JSContext, and our CallSetup will do
76669 // the right thing with that.
76670 return;
76671 }
76672 do {
76673 argv[0].set(JS_NumberValue(double(arg)));
76674 break;
76675 } while (false);
76676
76677 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", 76677); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76677); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76678 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76679 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76680 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76681 !InitIds(cx, atomsCache)) ||
76682 !JS_SetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, argv[0])) {
76683 aRv.Throw(NS_ERROR_UNEXPECTED);
76684 return;
76685 }
76686}
76687
76688void
76689TestJSImplInterfaceJSImpl::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
76690{
76691 CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76692 if (aRv.Failed()) {
76693 return;
76694 }
76695 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76695); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76695); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76696 BindingCallContext& cx = s.GetCallContext();
76697
76698 JS::RootedVector<JS::Value> argv(cx);
76699 if (!argv.resize(1)) {
76700 // That threw an exception on the JSContext, and our CallSetup will do
76701 // the right thing with that.
76702 return;
76703 }
76704 do {
76705 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
76706 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 76706); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 76706); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76707 aRv.Throw(NS_ERROR_UNEXPECTED);
76708 return;
76709 }
76710 break;
76711 } while (false);
76712
76713 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", 76713); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76713); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76714 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76715 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76716 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76717 !InitIds(cx, atomsCache)) ||
76718 !JS_SetPropertyById(cx, callback, atomsCache->nonNullSelf_id, argv[0])) {
76719 aRv.Throw(NS_ERROR_UNEXPECTED);
76720 return;
76721 }
76722}
76723
76724void
76725TestJSImplInterfaceJSImpl::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76726{
76727 CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76728 if (aRv.Failed()) {
76729 return;
76730 }
76731 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76731); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76731); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76732 BindingCallContext& cx = s.GetCallContext();
76733
76734 JS::RootedVector<JS::Value> argv(cx);
76735 if (!argv.resize(1)) {
76736 // That threw an exception on the JSContext, and our CallSetup will do
76737 // the right thing with that.
76738 return;
76739 }
76740 do {
76741 if (!arg) {
76742 argv[0].setNull();
76743 break;
76744 }
76745 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
76746 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 76746); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 76746); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76747 aRv.Throw(NS_ERROR_UNEXPECTED);
76748 return;
76749 }
76750 break;
76751 } while (false);
76752
76753 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", 76753); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76753); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76754 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76755 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76756 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76757 !InitIds(cx, atomsCache)) ||
76758 !JS_SetPropertyById(cx, callback, atomsCache->nullableSelf_id, argv[0])) {
76759 aRv.Throw(NS_ERROR_UNEXPECTED);
76760 return;
76761 }
76762}
76763
76764void
76765TestJSImplInterfaceJSImpl::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76766{
76767 CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76768 if (aRv.Failed()) {
76769 return;
76770 }
76771 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76771); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76771); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76772 BindingCallContext& cx = s.GetCallContext();
76773
76774 JS::RootedVector<JS::Value> argv(cx);
76775 if (!argv.resize(1)) {
76776 // That threw an exception on the JSContext, and our CallSetup will do
76777 // the right thing with that.
76778 return;
76779 }
76780 do {
76781 if (!WrapObject(cx, arg, argv[0])) {
76782 aRv.Throw(NS_ERROR_UNEXPECTED);
76783 return;
76784 }
76785 break;
76786 } while (false);
76787
76788 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", 76788); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76788); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76789 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76790 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76791 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76792 !InitIds(cx, atomsCache)) ||
76793 !JS_SetPropertyById(cx, callback, atomsCache->nonNullExternal_id, argv[0])) {
76794 aRv.Throw(NS_ERROR_UNEXPECTED);
76795 return;
76796 }
76797}
76798
76799void
76800TestJSImplInterfaceJSImpl::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76801{
76802 CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76803 if (aRv.Failed()) {
76804 return;
76805 }
76806 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76806); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76806); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76807 BindingCallContext& cx = s.GetCallContext();
76808
76809 JS::RootedVector<JS::Value> argv(cx);
76810 if (!argv.resize(1)) {
76811 // That threw an exception on the JSContext, and our CallSetup will do
76812 // the right thing with that.
76813 return;
76814 }
76815 do {
76816 if (!arg) {
76817 argv[0].setNull();
76818 break;
76819 }
76820 if (!WrapObject(cx, arg, argv[0])) {
76821 aRv.Throw(NS_ERROR_UNEXPECTED);
76822 return;
76823 }
76824 break;
76825 } while (false);
76826
76827 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", 76827); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76827); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76828 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76829 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76830 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76831 !InitIds(cx, atomsCache)) ||
76832 !JS_SetPropertyById(cx, callback, atomsCache->nullableExternal_id, argv[0])) {
76833 aRv.Throw(NS_ERROR_UNEXPECTED);
76834 return;
76835 }
76836}
76837
76838void
76839TestJSImplInterfaceJSImpl::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
76840{
76841 CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76842 if (aRv.Failed()) {
76843 return;
76844 }
76845 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76845); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76845); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76846 BindingCallContext& cx = s.GetCallContext();
76847
76848 JS::RootedVector<JS::Value> argv(cx);
76849 if (!argv.resize(1)) {
76850 // That threw an exception on the JSContext, and our CallSetup will do
76851 // the right thing with that.
76852 return;
76853 }
76854 do {
76855 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
76856 if (!MaybeWrapObjectValue(cx, argv[0])) {
76857 aRv.Throw(NS_ERROR_UNEXPECTED);
76858 return;
76859 }
76860 break;
76861 } while (false);
76862
76863 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", 76863); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76863); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76864 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76865 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76866 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76867 !InitIds(cx, atomsCache)) ||
76868 !JS_SetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, argv[0])) {
76869 aRv.Throw(NS_ERROR_UNEXPECTED);
76870 return;
76871 }
76872}
76873
76874void
76875TestJSImplInterfaceJSImpl::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76876{
76877 CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76878 if (aRv.Failed()) {
76879 return;
76880 }
76881 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76881); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76881); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76882 BindingCallContext& cx = s.GetCallContext();
76883
76884 JS::RootedVector<JS::Value> argv(cx);
76885 if (!argv.resize(1)) {
76886 // That threw an exception on the JSContext, and our CallSetup will do
76887 // the right thing with that.
76888 return;
76889 }
76890 do {
76891 if (arg) {
76892 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
76893 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
76894 aRv.Throw(NS_ERROR_UNEXPECTED);
76895 return;
76896 }
76897 break;
76898 } else {
76899 argv[0].setNull();
76900 break;
76901 }
76902 } while (false);
76903
76904 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", 76904); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76904); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76905 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76906 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76907 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76908 !InitIds(cx, atomsCache)) ||
76909 !JS_SetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, argv[0])) {
76910 aRv.Throw(NS_ERROR_UNEXPECTED);
76911 return;
76912 }
76913}
76914
76915void
76916TestJSImplInterfaceJSImpl::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
76917{
76918 CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76919 if (aRv.Failed()) {
76920 return;
76921 }
76922 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76922); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76923 BindingCallContext& cx = s.GetCallContext();
76924
76925 JS::RootedVector<JS::Value> argv(cx);
76926 if (!argv.resize(1)) {
76927 // That threw an exception on the JSContext, and our CallSetup will do
76928 // the right thing with that.
76929 return;
76930 }
76931 do {
76932 argv[0].setObject(*arg.Obj());
76933 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
76934 aRv.Throw(NS_ERROR_UNEXPECTED);
76935 return;
76936 }
76937 break;
76938 } while (false);
76939
76940 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", 76940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76940); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76941 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76942 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76943 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76944 !InitIds(cx, atomsCache)) ||
76945 !JS_SetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, argv[0])) {
76946 aRv.Throw(NS_ERROR_UNEXPECTED);
76947 return;
76948 }
76949}
76950
76951void
76952TestJSImplInterfaceJSImpl::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
76953{
76954 CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76955 if (aRv.Failed()) {
76956 return;
76957 }
76958 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76958); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76958); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76959 BindingCallContext& cx = s.GetCallContext();
76960
76961 JS::RootedVector<JS::Value> argv(cx);
76962 if (!argv.resize(1)) {
76963 // That threw an exception on the JSContext, and our CallSetup will do
76964 // the right thing with that.
76965 return;
76966 }
76967 do {
76968 argv[0].setString(arg);
76969 if (!MaybeWrapStringValue(cx, argv[0])) {
76970 aRv.Throw(NS_ERROR_UNEXPECTED);
76971 return;
76972 }
76973 break;
76974 } while (false);
76975
76976 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", 76976); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 76976); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76977 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76978 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76979 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76980 !InitIds(cx, atomsCache)) ||
76981 !JS_SetPropertyById(cx, callback, atomsCache->jsStringAttr_id, argv[0])) {
76982 aRv.Throw(NS_ERROR_UNEXPECTED);
76983 return;
76984 }
76985}
76986
76987void
76988TestJSImplInterfaceJSImpl::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
76989{
76990 CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76991 if (aRv.Failed()) {
76992 return;
76993 }
76994 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76994); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 76994); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
76995 BindingCallContext& cx = s.GetCallContext();
76996
76997 JS::RootedVector<JS::Value> argv(cx);
76998 if (!argv.resize(1)) {
76999 // That threw an exception on the JSContext, and our CallSetup will do
77000 // the right thing with that.
77001 return;
77002 }
77003 do {
77004 if (!ToJSValue(cx, arg, argv[0])) {
77005 aRv.Throw(NS_ERROR_UNEXPECTED);
77006 return;
77007 }
77008 break;
77009 } while (false);
77010
77011 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", 77011); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77011); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77012 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77013 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77014 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77015 !InitIds(cx, atomsCache)) ||
77016 !JS_SetPropertyById(cx, callback, atomsCache->enumAttribute_id, argv[0])) {
77017 aRv.Throw(NS_ERROR_UNEXPECTED);
77018 return;
77019 }
77020}
77021
77022void
77023TestJSImplInterfaceJSImpl::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
77024{
77025 CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77026 if (aRv.Failed()) {
77027 return;
77028 }
77029 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77029); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77029); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77030 BindingCallContext& cx = s.GetCallContext();
77031
77032 JS::RootedVector<JS::Value> argv(cx);
77033 if (!argv.resize(1)) {
77034 // That threw an exception on the JSContext, and our CallSetup will do
77035 // the right thing with that.
77036 return;
77037 }
77038 do {
77039 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
77040 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
77041 aRv.Throw(NS_ERROR_UNEXPECTED);
77042 return;
77043 }
77044 break;
77045 } while (false);
77046
77047 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", 77047); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77047); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77048 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77049 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77050 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77051 !InitIds(cx, atomsCache)) ||
77052 !JS_SetPropertyById(cx, callback, atomsCache->writableUnion_id, argv[0])) {
77053 aRv.Throw(NS_ERROR_UNEXPECTED);
77054 return;
77055 }
77056}
77057
77058void
77059TestJSImplInterfaceJSImpl::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
77060{
77061 CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77062 if (aRv.Failed()) {
77063 return;
77064 }
77065 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77065); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77065); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77066 BindingCallContext& cx = s.GetCallContext();
77067
77068 JS::RootedVector<JS::Value> argv(cx);
77069 if (!argv.resize(1)) {
77070 // That threw an exception on the JSContext, and our CallSetup will do
77071 // the right thing with that.
77072 return;
77073 }
77074 do {
77075 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
77076 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
77077 aRv.Throw(NS_ERROR_UNEXPECTED);
77078 return;
77079 }
77080 break;
77081 } while (false);
77082
77083 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", 77083); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77083); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77084 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77085 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77086 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77087 !InitIds(cx, atomsCache)) ||
77088 !JS_SetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, argv[0])) {
77089 aRv.Throw(NS_ERROR_UNEXPECTED);
77090 return;
77091 }
77092}
77093
77094void
77095TestJSImplInterfaceJSImpl::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77096{
77097 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77098 if (aRv.Failed()) {
77099 return;
77100 }
77101 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77101); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77101); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77102 BindingCallContext& cx = s.GetCallContext();
77103
77104 JS::RootedVector<JS::Value> argv(cx);
77105 if (!argv.resize(1)) {
77106 // That threw an exception on the JSContext, and our CallSetup will do
77107 // the right thing with that.
77108 return;
77109 }
77110 do {
77111 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
77112 if (arg.IsNull()) {
77113 argv[0].setNull();
77114 break;
77115 }
77116 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
77117 aRv.Throw(NS_ERROR_UNEXPECTED);
77118 return;
77119 }
77120 break;
77121 } while (false);
77122
77123 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", 77123); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77123); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77124 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77125 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77126 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77127 !InitIds(cx, atomsCache)) ||
77128 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnion_id, argv[0])) {
77129 aRv.Throw(NS_ERROR_UNEXPECTED);
77130 return;
77131 }
77132}
77133
77134void
77135TestJSImplInterfaceJSImpl::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77136{
77137 CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77138 if (aRv.Failed()) {
77139 return;
77140 }
77141 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77141); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77142 BindingCallContext& cx = s.GetCallContext();
77143
77144 JS::RootedVector<JS::Value> argv(cx);
77145 if (!argv.resize(1)) {
77146 // That threw an exception on the JSContext, and our CallSetup will do
77147 // the right thing with that.
77148 return;
77149 }
77150 do {
77151 argv[0].setInt32(int32_t(arg));
77152 break;
77153 } while (false);
77154
77155 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", 77155); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77155); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77156 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77157 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77158 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77159 !InitIds(cx, atomsCache)) ||
77160 !JS_SetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, argv[0])) {
77161 aRv.Throw(NS_ERROR_UNEXPECTED);
77162 return;
77163 }
77164}
77165
77166void
77167TestJSImplInterfaceJSImpl::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77168{
77169 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77170 if (aRv.Failed()) {
77171 return;
77172 }
77173 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77173); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77173); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77174 BindingCallContext& cx = s.GetCallContext();
77175
77176 JS::RootedVector<JS::Value> argv(cx);
77177 if (!argv.resize(1)) {
77178 // That threw an exception on the JSContext, and our CallSetup will do
77179 // the right thing with that.
77180 return;
77181 }
77182 do {
77183 argv[0].setInt32(int32_t(arg));
77184 break;
77185 } while (false);
77186
77187 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", 77187); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77187); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77188 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77189 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77190 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77191 !InitIds(cx, atomsCache)) ||
77192 !JS_SetPropertyById(cx, callback, atomsCache->enforcedByte_id, argv[0])) {
77193 aRv.Throw(NS_ERROR_UNEXPECTED);
77194 return;
77195 }
77196}
77197
77198void
77199TestJSImplInterfaceJSImpl::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77200{
77201 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77202 if (aRv.Failed()) {
77203 return;
77204 }
77205 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77205); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77205); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77206 BindingCallContext& cx = s.GetCallContext();
77207
77208 JS::RootedVector<JS::Value> argv(cx);
77209 if (!argv.resize(1)) {
77210 // That threw an exception on the JSContext, and our CallSetup will do
77211 // the right thing with that.
77212 return;
77213 }
77214 do {
77215 if (arg.IsNull()) {
77216 argv[0].setNull();
77217 break;
77218 }
77219 argv[0].setInt32(int32_t(arg.Value()));
77220 break;
77221 } while (false);
77222
77223 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", 77223); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77223); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77224 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77225 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77226 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77227 !InitIds(cx, atomsCache)) ||
77228 !JS_SetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, argv[0])) {
77229 aRv.Throw(NS_ERROR_UNEXPECTED);
77230 return;
77231 }
77232}
77233
77234void
77235TestJSImplInterfaceJSImpl::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77236{
77237 CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77238 if (aRv.Failed()) {
77239 return;
77240 }
77241 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77241); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77241); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77242 BindingCallContext& cx = s.GetCallContext();
77243
77244 JS::RootedVector<JS::Value> argv(cx);
77245 if (!argv.resize(1)) {
77246 // That threw an exception on the JSContext, and our CallSetup will do
77247 // the right thing with that.
77248 return;
77249 }
77250 do {
77251 argv[0].setInt32(int32_t(arg));
77252 break;
77253 } while (false);
77254
77255 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", 77255); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77255); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77256 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77257 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77258 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77259 !InitIds(cx, atomsCache)) ||
77260 !JS_SetPropertyById(cx, callback, atomsCache->clampedByte_id, argv[0])) {
77261 aRv.Throw(NS_ERROR_UNEXPECTED);
77262 return;
77263 }
77264}
77265
77266void
77267TestJSImplInterfaceJSImpl::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77268{
77269 CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77270 if (aRv.Failed()) {
77271 return;
77272 }
77273 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77273); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77273); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77274 BindingCallContext& cx = s.GetCallContext();
77275
77276 JS::RootedVector<JS::Value> argv(cx);
77277 if (!argv.resize(1)) {
77278 // That threw an exception on the JSContext, and our CallSetup will do
77279 // the right thing with that.
77280 return;
77281 }
77282 do {
77283 if (arg.IsNull()) {
77284 argv[0].setNull();
77285 break;
77286 }
77287 argv[0].setInt32(int32_t(arg.Value()));
77288 break;
77289 } while (false);
77290
77291 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", 77291); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77291); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77292 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77293 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77294 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77295 !InitIds(cx, atomsCache)) ||
77296 !JS_SetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, argv[0])) {
77297 aRv.Throw(NS_ERROR_UNEXPECTED);
77298 return;
77299 }
77300}
77301
77302void
77303TestJSImplInterfaceJSImpl::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77304{
77305 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77306 if (aRv.Failed()) {
77307 return;
77308 }
77309 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77309); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77310 BindingCallContext& cx = s.GetCallContext();
77311
77312 JS::RootedVector<JS::Value> argv(cx);
77313 if (!argv.resize(1)) {
77314 // That threw an exception on the JSContext, and our CallSetup will do
77315 // the right thing with that.
77316 return;
77317 }
77318 do {
77319 argv[0].setInt32(int32_t(arg));
77320 break;
77321 } while (false);
77322
77323 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", 77323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77323); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77324 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77325 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77326 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77327 !InitIds(cx, atomsCache)) ||
77328 !JS_SetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, argv[0])) {
77329 aRv.Throw(NS_ERROR_UNEXPECTED);
77330 return;
77331 }
77332}
77333
77334void
77335TestJSImplInterfaceJSImpl::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77336{
77337 CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77338 if (aRv.Failed()) {
77339 return;
77340 }
77341 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77341); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77341); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77342 BindingCallContext& cx = s.GetCallContext();
77343
77344 JS::RootedVector<JS::Value> argv(cx);
77345 if (!argv.resize(1)) {
77346 // That threw an exception on the JSContext, and our CallSetup will do
77347 // the right thing with that.
77348 return;
77349 }
77350 do {
77351 argv[0].setInt32(int32_t(arg));
77352 break;
77353 } while (false);
77354
77355 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", 77355); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77355); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77356 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77357 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77358 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77359 !InitIds(cx, atomsCache)) ||
77360 !JS_SetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, argv[0])) {
77361 aRv.Throw(NS_ERROR_UNEXPECTED);
77362 return;
77363 }
77364}
77365
77366void
77367TestJSImplInterfaceJSImpl::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77368{
77369 CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77370 if (aRv.Failed()) {
77371 return;
77372 }
77373 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77373); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77373); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77374 BindingCallContext& cx = s.GetCallContext();
77375
77376 JS::RootedVector<JS::Value> argv(cx);
77377 if (!argv.resize(1)) {
77378 // That threw an exception on the JSContext, and our CallSetup will do
77379 // the right thing with that.
77380 return;
77381 }
77382 do {
77383 argv[0].setBoolean(arg);
77384 break;
77385 } while (false);
77386
77387 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", 77387); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77387); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77388 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77389 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77390 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77391 !InitIds(cx, atomsCache)) ||
77392 !JS_SetPropertyById(cx, callback, atomsCache->throwingAttr_id, argv[0])) {
77393 aRv.Throw(NS_ERROR_UNEXPECTED);
77394 return;
77395 }
77396}
77397
77398void
77399TestJSImplInterfaceJSImpl::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77400{
77401 CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77402 if (aRv.Failed()) {
77403 return;
77404 }
77405 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77405); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77406 BindingCallContext& cx = s.GetCallContext();
77407
77408 JS::RootedVector<JS::Value> argv(cx);
77409 if (!argv.resize(1)) {
77410 // That threw an exception on the JSContext, and our CallSetup will do
77411 // the right thing with that.
77412 return;
77413 }
77414 do {
77415 argv[0].setBoolean(arg);
77416 break;
77417 } while (false);
77418
77419 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", 77419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77419); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77420 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77421 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77422 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77423 !InitIds(cx, atomsCache)) ||
77424 !JS_SetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, argv[0])) {
77425 aRv.Throw(NS_ERROR_UNEXPECTED);
77426 return;
77427 }
77428}
77429
77430void
77431TestJSImplInterfaceJSImpl::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77432{
77433 CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77434 if (aRv.Failed()) {
77435 return;
77436 }
77437 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77437); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77438 BindingCallContext& cx = s.GetCallContext();
77439
77440 JS::RootedVector<JS::Value> argv(cx);
77441 if (!argv.resize(1)) {
77442 // That threw an exception on the JSContext, and our CallSetup will do
77443 // the right thing with that.
77444 return;
77445 }
77446 do {
77447 argv[0].setBoolean(arg);
77448 break;
77449 } while (false);
77450
77451 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", 77451); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77451); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77452 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77453 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77454 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77455 !InitIds(cx, atomsCache)) ||
77456 !JS_SetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, argv[0])) {
77457 aRv.Throw(NS_ERROR_UNEXPECTED);
77458 return;
77459 }
77460}
77461
77462void
77463TestJSImplInterfaceJSImpl::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77464{
77465 CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77466 if (aRv.Failed()) {
77467 return;
77468 }
77469 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77469); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77470 BindingCallContext& cx = s.GetCallContext();
77471
77472 JS::RootedVector<JS::Value> argv(cx);
77473 if (!argv.resize(1)) {
77474 // That threw an exception on the JSContext, and our CallSetup will do
77475 // the right thing with that.
77476 return;
77477 }
77478 do {
77479 argv[0].setBoolean(arg);
77480 break;
77481 } while (false);
77482
77483 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", 77483); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77483); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77484 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77485 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77486 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77487 !InitIds(cx, atomsCache)) ||
77488 !JS_SetPropertyById(cx, callback, atomsCache->canOOMAttr_id, argv[0])) {
77489 aRv.Throw(NS_ERROR_UNEXPECTED);
77490 return;
77491 }
77492}
77493
77494void
77495TestJSImplInterfaceJSImpl::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77496{
77497 CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77498 if (aRv.Failed()) {
77499 return;
77500 }
77501 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77501); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77501); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77502 BindingCallContext& cx = s.GetCallContext();
77503
77504 JS::RootedVector<JS::Value> argv(cx);
77505 if (!argv.resize(1)) {
77506 // That threw an exception on the JSContext, and our CallSetup will do
77507 // the right thing with that.
77508 return;
77509 }
77510 do {
77511 argv[0].setBoolean(arg);
77512 break;
77513 } while (false);
77514
77515 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", 77515); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77515); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77516 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77517 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77518 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77519 !InitIds(cx, atomsCache)) ||
77520 !JS_SetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, argv[0])) {
77521 aRv.Throw(NS_ERROR_UNEXPECTED);
77522 return;
77523 }
77524}
77525
77526void
77527TestJSImplInterfaceJSImpl::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77528{
77529 CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77530 if (aRv.Failed()) {
77531 return;
77532 }
77533 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77533); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77533); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77534 BindingCallContext& cx = s.GetCallContext();
77535
77536 JS::RootedVector<JS::Value> argv(cx);
77537 if (!argv.resize(1)) {
77538 // That threw an exception on the JSContext, and our CallSetup will do
77539 // the right thing with that.
77540 return;
77541 }
77542 do {
77543 argv[0].setBoolean(arg);
77544 break;
77545 } while (false);
77546
77547 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", 77547); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77547); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77548 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77549 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77550 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77551 !InitIds(cx, atomsCache)) ||
77552 !JS_SetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, argv[0])) {
77553 aRv.Throw(NS_ERROR_UNEXPECTED);
77554 return;
77555 }
77556}
77557
77558void
77559TestJSImplInterfaceJSImpl::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77560{
77561 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77562 if (aRv.Failed()) {
77563 return;
77564 }
77565 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77565); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77565); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77566 BindingCallContext& cx = s.GetCallContext();
77567
77568 JS::RootedVector<JS::Value> argv(cx);
77569 if (!argv.resize(1)) {
77570 // That threw an exception on the JSContext, and our CallSetup will do
77571 // the right thing with that.
77572 return;
77573 }
77574 do {
77575 argv[0].setBoolean(arg);
77576 break;
77577 } while (false);
77578
77579 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", 77579); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77579); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77580 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77581 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77582 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77583 !InitIds(cx, atomsCache)) ||
77584 !JS_SetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, argv[0])) {
77585 aRv.Throw(NS_ERROR_UNEXPECTED);
77586 return;
77587 }
77588}
77589
77590void
77591TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
77592{
77593 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77594 if (aRv.Failed()) {
77595 return;
77596 }
77597 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77597); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77597); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77598 BindingCallContext& cx = s.GetCallContext();
77599
77600 JS::RootedVector<JS::Value> argv(cx);
77601 if (!argv.resize(1)) {
77602 // That threw an exception on the JSContext, and our CallSetup will do
77603 // the right thing with that.
77604 return;
77605 }
77606 do {
77607 JS::ExposeValueToActiveJS(arg);
77608 argv[0].set(arg);
77609 if (!MaybeWrapValue(cx, argv[0])) {
77610 aRv.Throw(NS_ERROR_UNEXPECTED);
77611 return;
77612 }
77613 break;
77614 } while (false);
77615
77616 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", 77616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77616); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77617 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77618 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77619 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77620 !InitIds(cx, atomsCache)) ||
77621 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, argv[0])) {
77622 aRv.Throw(NS_ERROR_UNEXPECTED);
77623 return;
77624 }
77625}
77626
77627void
77628TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
77629{
77630 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77631 if (aRv.Failed()) {
77632 return;
77633 }
77634 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77634); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77634); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77635 BindingCallContext& cx = s.GetCallContext();
77636
77637 JS::RootedVector<JS::Value> argv(cx);
77638 if (!argv.resize(1)) {
77639 // That threw an exception on the JSContext, and our CallSetup will do
77640 // the right thing with that.
77641 return;
77642 }
77643 do {
77644 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
77645 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 77645); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 77645); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77646 aRv.Throw(NS_ERROR_UNEXPECTED);
77647 return;
77648 }
77649 break;
77650 } while (false);
77651
77652 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", 77652); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77652); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77653 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77654 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77655 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77656 !InitIds(cx, atomsCache)) ||
77657 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, argv[0])) {
77658 aRv.Throw(NS_ERROR_UNEXPECTED);
77659 return;
77660 }
77661}
77662
77663void
77664TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
77665{
77666 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77667 if (aRv.Failed()) {
77668 return;
77669 }
77670 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77670); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77671 BindingCallContext& cx = s.GetCallContext();
77672
77673 JS::RootedVector<JS::Value> argv(cx);
77674 if (!argv.resize(1)) {
77675 // That threw an exception on the JSContext, and our CallSetup will do
77676 // the right thing with that.
77677 return;
77678 }
77679 do {
77680 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
77681 if (!MaybeWrapObjectValue(cx, argv[0])) {
77682 aRv.Throw(NS_ERROR_UNEXPECTED);
77683 return;
77684 }
77685 break;
77686 } while (false);
77687
77688 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", 77688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77688); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77689 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77690 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77691 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77692 !InitIds(cx, atomsCache)) ||
77693 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, argv[0])) {
77694 aRv.Throw(NS_ERROR_UNEXPECTED);
77695 return;
77696 }
77697}
77698
77699void
77700TestJSImplInterfaceJSImpl::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77701{
77702 CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77703 if (aRv.Failed()) {
77704 return;
77705 }
77706 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77706); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77706); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77707 BindingCallContext& cx = s.GetCallContext();
77708
77709 JS::RootedVector<JS::Value> argv(cx);
77710 if (!argv.resize(1)) {
77711 // That threw an exception on the JSContext, and our CallSetup will do
77712 // the right thing with that.
77713 return;
77714 }
77715 do {
77716 argv[0].setInt32(int32_t(arg));
77717 break;
77718 } while (false);
77719
77720 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", 77720); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77720); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77721 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77722 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77723 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77724 !InitIds(cx, atomsCache)) ||
77725 !JS_SetPropertyById(cx, callback, atomsCache->dashed_attribute_id, argv[0])) {
77726 aRv.Throw(NS_ERROR_UNEXPECTED);
77727 return;
77728 }
77729}
77730
77731void
77732TestJSImplInterfaceJSImpl::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77733{
77734 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77735 if (aRv.Failed()) {
77736 return;
77737 }
77738 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77738); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77738); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77739 BindingCallContext& cx = s.GetCallContext();
77740
77741 JS::RootedVector<JS::Value> argv(cx);
77742 if (!argv.resize(1)) {
77743 // That threw an exception on the JSContext, and our CallSetup will do
77744 // the right thing with that.
77745 return;
77746 }
77747 do {
77748 argv[0].setBoolean(arg);
77749 break;
77750 } while (false);
77751
77752 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", 77752); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77752); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77753 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77754 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77755 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77756 !InitIds(cx, atomsCache)) ||
77757 !JS_SetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, argv[0])) {
77758 aRv.Throw(NS_ERROR_UNEXPECTED);
77759 return;
77760 }
77761}
77762
77763void
77764TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
77765{
77766 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77767 if (aRv.Failed()) {
77768 return;
77769 }
77770 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77770); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77770); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77771 BindingCallContext& cx = s.GetCallContext();
77772
77773 JS::RootedVector<JS::Value> argv(cx);
77774 if (!argv.resize(1)) {
77775 // That threw an exception on the JSContext, and our CallSetup will do
77776 // the right thing with that.
77777 return;
77778 }
77779 do {
77780 argv[0].setObject(*arg.Obj());
77781 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77782 aRv.Throw(NS_ERROR_UNEXPECTED);
77783 return;
77784 }
77785 break;
77786 } while (false);
77787
77788 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", 77788); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77788); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77789 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77790 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77791 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77792 !InitIds(cx, atomsCache)) ||
77793 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, argv[0])) {
77794 aRv.Throw(NS_ERROR_UNEXPECTED);
77795 return;
77796 }
77797}
77798
77799void
77800TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
77801{
77802 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77803 if (aRv.Failed()) {
77804 return;
77805 }
77806 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77806); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77806); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77807 BindingCallContext& cx = s.GetCallContext();
77808
77809 JS::RootedVector<JS::Value> argv(cx);
77810 if (!argv.resize(1)) {
77811 // That threw an exception on the JSContext, and our CallSetup will do
77812 // the right thing with that.
77813 return;
77814 }
77815 do {
77816 argv[0].setObject(*arg.Obj());
77817 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77818 aRv.Throw(NS_ERROR_UNEXPECTED);
77819 return;
77820 }
77821 break;
77822 } while (false);
77823
77824 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", 77824); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77824); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77825 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77826 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77827 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77828 !InitIds(cx, atomsCache)) ||
77829 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, argv[0])) {
77830 aRv.Throw(NS_ERROR_UNEXPECTED);
77831 return;
77832 }
77833}
77834
77835void
77836TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77837{
77838 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77839 if (aRv.Failed()) {
77840 return;
77841 }
77842 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77842); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77842); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77843 BindingCallContext& cx = s.GetCallContext();
77844
77845 JS::RootedVector<JS::Value> argv(cx);
77846 if (!argv.resize(1)) {
77847 // That threw an exception on the JSContext, and our CallSetup will do
77848 // the right thing with that.
77849 return;
77850 }
77851 do {
77852 if (arg.IsNull()) {
77853 argv[0].setNull();
77854 break;
77855 }
77856 argv[0].setObject(*arg.Value().Obj());
77857 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77858 aRv.Throw(NS_ERROR_UNEXPECTED);
77859 return;
77860 }
77861 break;
77862 } while (false);
77863
77864 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", 77864); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77864); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77865 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77866 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77867 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77868 !InitIds(cx, atomsCache)) ||
77869 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, argv[0])) {
77870 aRv.Throw(NS_ERROR_UNEXPECTED);
77871 return;
77872 }
77873}
77874
77875void
77876TestJSImplInterfaceJSImpl::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
77877{
77878 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77879 if (aRv.Failed()) {
77880 return;
77881 }
77882 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77882); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77882); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77883 BindingCallContext& cx = s.GetCallContext();
77884
77885 JS::RootedVector<JS::Value> argv(cx);
77886 if (!argv.resize(1)) {
77887 // That threw an exception on the JSContext, and our CallSetup will do
77888 // the right thing with that.
77889 return;
77890 }
77891 do {
77892 argv[0].setObject(*arg.Obj());
77893 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77894 aRv.Throw(NS_ERROR_UNEXPECTED);
77895 return;
77896 }
77897 break;
77898 } while (false);
77899
77900 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", 77900); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77900); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77901 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77902 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77903 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77904 !InitIds(cx, atomsCache)) ||
77905 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, argv[0])) {
77906 aRv.Throw(NS_ERROR_UNEXPECTED);
77907 return;
77908 }
77909}
77910
77911void
77912TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77913{
77914 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77915 if (aRv.Failed()) {
77916 return;
77917 }
77918 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77918); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { MOZ_CrashSequence
(__null, 77918); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77919 BindingCallContext& cx = s.GetCallContext();
77920
77921 JS::RootedVector<JS::Value> argv(cx);
77922 if (!argv.resize(1)) {
77923 // That threw an exception on the JSContext, and our CallSetup will do
77924 // the right thing with that.
77925 return;
77926 }
77927 do {
77928 if (arg.IsNull()) {
77929 argv[0].setNull();
77930 break;
77931 }
77932 argv[0].setObject(*arg.Value().Obj());
77933 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77934 aRv.Throw(NS_ERROR_UNEXPECTED);
77935 return;
77936 }
77937 break;
77938 } while (false);
77939
77940 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", 77940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { MOZ_CrashSequence
(__null, 77940); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
77941 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77942 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77943 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77944 !InitIds(cx, atomsCache)) ||
77945 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBuffer_id, argv[0])) {
77946 aRv.Throw(NS_ERROR_UNEXPECTED);
77947 return;
77948 }
77949}
77950
77951
77952NS_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); }
77953NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplInterface)void TestJSImplInterface::cycleCollection::Unlink(void* p) { TestJSImplInterface
* tmp = DowncastCCParticipant<TestJSImplInterface>(p);
77954 NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl);
77955 NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent);
77956 NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p);
77957 tmp->ClearWeakReferences();
77958NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; }
77959NS_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"
);
77960 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0);
77961 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0
);
77962NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; }
77963NS_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", 77963
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0"
") (" "illegal refcnt" ")"); do { MOZ_CrashSequence(__null, 77963
); __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; }
77964NS_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", 77964
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0"
") (" "dup release" ")"); do { MOZ_CrashSequence(__null, 77964
); __attribute__((nomerge)) ::abort(); } while (false); } } while
(false); _mOwningThread.AssertOwnership("TestJSImplInterface"
" not thread-safe"); nsISupports* base = TestJSImplInterface
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr
(base); if (count == 0) { NS_CycleCollectableHasRefCntZero();
} NS_LogRelease((this), (count), ("TestJSImplInterface")); return
count; } void TestJSImplInterface::DeleteCycleCollectable(void
) { delete (this); }
77965NS_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", 77965); MOZ_PretendNoReturn
(); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals
( aIID, (nsXPCOMCycleCollectionParticipant::kIID), (nsCycleCollectionISupports
::kIID)) && (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports::
kIID)))) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::kIID))) { *aInstancePtr = TestJSImplInterface::cycleCollection
::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, (
nsCycleCollectionISupports::kIID))) { *aInstancePtr = TestJSImplInterface
::cycleCollection::Upcast(this); return NS_OK; } foundInterface
= nullptr; } else
77966 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::kIID))) { *aInstancePtr = static_cast
<nsWrapperCache*>(this); return NS_OK; } else
77967 NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupports>)) foundInterface = static_cast
<nsISupports*>(this); else
77968 NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupportsWeakReference>)) foundInterface
= static_cast<nsISupportsWeakReference*>(this); else
77969NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(!aIID.Equals((nsISupports::kIID)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::kIID
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!aIID.Equals((nsISupports::kIID))", "../TestJSImplGenBinding.cpp"
, 77969); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::kIID))"
")"); do { MOZ_CrashSequence(__null, 77969); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); status
= NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status
= NS_OK; } *aInstancePtr = foundInterface; return status; }
77970
77971TestJSImplInterface::TestJSImplInterface(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent)
77972 : mImpl(new TestJSImplInterfaceJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)),
77973 mParent(aParent)
77974{
77975}
77976
77977
77978TestJSImplInterface::~TestJSImplInterface()
77979{
77980}
77981
77982nsISupports*
77983TestJSImplInterface::GetParentObject() const
77984{
77985 return mParent;
77986}
77987
77988DocGroup*
77989TestJSImplInterface::GetDocGroup() const
77990{
77991 nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(mParent);
77992 if (!window) {
77993 return nullptr;
77994 }
77995 return window->GetDocGroup();
77996}
77997
77998JSObject*
77999TestJSImplInterface::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
78000{
78001 JS::Rooted<JSObject*> obj(aCx, TestJSImplInterface_Binding::Wrap(aCx, this, aGivenProto));
78002 if (!obj) {
78003 return nullptr;
78004 }
78005
78006 // Now define it on our chrome object
78007 JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull());
78008 if (!JS_WrapObject(aCx, &obj)) {
78009 return nullptr;
78010 }
78011 JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull());
78012 if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) {
78013 return nullptr;
78014 }
78015 return obj;
78016}
78017
78018already_AddRefed<TestJSImplInterface>
78019TestJSImplInterface::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)
78020{
78021 RefPtr<TestJSImplInterface> impl =
78022 ConstructJSImplementation<TestJSImplInterface>("@mozilla.org/test-js-impl-interface;1", global, aRv);
78023 if (aRv.Failed()) {
78024 return nullptr;
78025 }
78026 // Wrap the object before calling __Init so that __DOM_IMPL__ is available.
78027 JS::Rooted<JSObject*> scopeObj(cx, global.Get());
78028 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", 78028); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(scopeObj, cx)"
")"); do { MOZ_CrashSequence(__null, 78028); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
78029 JS::Rooted<JS::Value> wrappedVal(cx);
78030 if (!GetOrCreateDOMReflector(cx, impl, &wrappedVal, aGivenProto)) {
78031 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 78031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { MOZ_CrashSequence
(__null, 78031); __attribute__((nomerge)) ::abort(); } while (
false); } } while (false)
;
78032 aRv.Throw(NS_ERROR_UNEXPECTED);
78033 return nullptr;
78034 }
78035 // Initialize the object with the constructor arguments.
78036 impl->mImpl->__Init(str, num, boolArg, iface, arg1, dict, any1, obj1, obj2, seq, any2, obj3, obj4, typedArr, arrayBuf, aRv, js::GetNonCCWObjectRealm(scopeObj));
78037 if (aRv.Failed()) {
78038 return nullptr;
78039 }
78040 return impl.forget();
78041}
78042
78043int8_t
78044TestJSImplInterface::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm) const
78045{
78046 return mImpl->GetReadonlyByte(aRv, aRealm);
78047}
78048
78049int8_t
78050TestJSImplInterface::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm) const
78051{
78052 return mImpl->GetWritableByte(aRv, aRealm);
78053}
78054
78055void
78056TestJSImplInterface::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78057{
78058 mImpl->SetWritableByte(arg, aRv, aRealm);
78059}
78060
78061void
78062TestJSImplInterface::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78063{
78064 return mImpl->PassByte(arg, aRv, aRealm);
78065}
78066
78067int8_t
78068TestJSImplInterface::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm)
78069{
78070 return mImpl->ReceiveByte(aRv, aRealm);
78071}
78072
78073void
78074TestJSImplInterface::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78075{
78076 return mImpl->PassOptionalByte(arg, aRv, aRealm);
78077}
78078
78079void
78080TestJSImplInterface::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
78081{
78082 return mImpl->PassOptionalByteBeforeRequired(arg1, arg2, aRv, aRealm);
78083}
78084
78085void
78086TestJSImplInterface::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78087{
78088 return mImpl->PassOptionalByteWithDefault(arg, aRv, aRealm);
78089}
78090
78091void
78092TestJSImplInterface::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
78093{
78094 return mImpl->PassOptionalByteWithDefaultBeforeRequired(arg1, arg2, aRv, aRealm);
78095}
78096
78097void
78098TestJSImplInterface::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78099{
78100 return mImpl->PassNullableByte(arg, aRv, aRealm);
78101}
78102
78103void
78104TestJSImplInterface::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78105{
78106 return mImpl->PassOptionalNullableByte(arg, aRv, aRealm);
78107}
78108
78109void
78110TestJSImplInterface::PassVariadicByte(const Sequence<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78111{
78112 return mImpl->PassVariadicByte(arg, aRv, aRealm);
78113}
78114
78115int8_t
78116TestJSImplInterface::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm) const
78117{
78118 return mImpl->GetSideEffectFreeByte(aRv, aRealm);
78119}
78120
78121void
78122TestJSImplInterface::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78123{
78124 mImpl->SetSideEffectFreeByte(arg, aRv, aRealm);
78125}
78126
78127int8_t
78128TestJSImplInterface::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const
78129{
78130 return mImpl->GetDomDependentByte(aRv, aRealm);
78131}
78132
78133void
78134TestJSImplInterface::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78135{
78136 mImpl->SetDomDependentByte(arg, aRv, aRealm);
78137}
78138
78139int8_t
78140TestJSImplInterface::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm) const
78141{
78142 return mImpl->GetConstantByte(aRv, aRealm);
78143}
78144
78145int8_t
78146TestJSImplInterface::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const
78147{
78148 return mImpl->GetDeviceStateDependentByte(aRv, aRealm);
78149}
78150
78151int8_t
78152TestJSImplInterface::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm)
78153{
78154 return mImpl->ReturnByteSideEffectFree(aRv, aRealm);
78155}
78156
78157int8_t
78158TestJSImplInterface::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
78159{
78160 return mImpl->ReturnDOMDependentByte(aRv, aRealm);
78161}
78162
78163int8_t
78164TestJSImplInterface::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
78165{
78166 return mImpl->ReturnConstantByte(aRv, aRealm);
78167}
78168
78169int8_t
78170TestJSImplInterface::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
78171{
78172 return mImpl->ReturnDeviceStateDependentByte(aRv, aRealm);
78173}
78174
78175int16_t
78176TestJSImplInterface::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm) const
78177{
78178 return mImpl->GetReadonlyShort(aRv, aRealm);
78179}
78180
78181int16_t
78182TestJSImplInterface::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm) const
78183{
78184 return mImpl->GetWritableShort(aRv, aRealm);
78185}
78186
78187void
78188TestJSImplInterface::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78189{
78190 mImpl->SetWritableShort(arg, aRv, aRealm);
78191}
78192
78193void
78194TestJSImplInterface::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78195{
78196 return mImpl->PassShort(arg, aRv, aRealm);
78197}
78198
78199int16_t
78200TestJSImplInterface::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm)
78201{
78202 return mImpl->ReceiveShort(aRv, aRealm);
78203}
78204
78205void
78206TestJSImplInterface::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78207{
78208 return mImpl->PassOptionalShort(arg, aRv, aRealm);
78209}
78210
78211void
78212TestJSImplInterface::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78213{
78214 return mImpl->PassOptionalShortWithDefault(arg, aRv, aRealm);
78215}
78216
78217int32_t
78218TestJSImplInterface::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm) const
78219{
78220 return mImpl->GetReadonlyLong(aRv, aRealm);
78221}
78222
78223int32_t
78224TestJSImplInterface::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm) const
78225{
78226 return mImpl->GetWritableLong(aRv, aRealm);
78227}
78228
78229void
78230TestJSImplInterface::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78231{
78232 mImpl->SetWritableLong(arg, aRv, aRealm);
78233}
78234
78235void
78236TestJSImplInterface::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78237{
78238 return mImpl->PassLong(arg, aRv, aRealm);
78239}
78240
78241int32_t
78242TestJSImplInterface::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm)
78243{
78244 return mImpl->ReceiveLong(aRv, aRealm);
78245}
78246
78247void
78248TestJSImplInterface::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78249{
78250 return mImpl->PassOptionalLong(arg, aRv, aRealm);
78251}
78252
78253void
78254TestJSImplInterface::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78255{
78256 return mImpl->PassOptionalLongWithDefault(arg, aRv, aRealm);
78257}
78258
78259int64_t
78260TestJSImplInterface::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78261{
78262 return mImpl->GetReadonlyLongLong(aRv, aRealm);
78263}
78264
78265int64_t
78266TestJSImplInterface::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78267{
78268 return mImpl->GetWritableLongLong(aRv, aRealm);
78269}
78270
78271void
78272TestJSImplInterface::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78273{
78274 mImpl->SetWritableLongLong(arg, aRv, aRealm);
78275}
78276
78277void
78278TestJSImplInterface::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78279{
78280 return mImpl->PassLongLong(arg, aRv, aRealm);
78281}
78282
78283int64_t
78284TestJSImplInterface::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm)
78285{
78286 return mImpl->ReceiveLongLong(aRv, aRealm);
78287}
78288
78289void
78290TestJSImplInterface::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78291{
78292 return mImpl->PassOptionalLongLong(arg, aRv, aRealm);
78293}
78294
78295void
78296TestJSImplInterface::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78297{
78298 return mImpl->PassOptionalLongLongWithDefault(arg, aRv, aRealm);
78299}
78300
78301uint8_t
78302TestJSImplInterface::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm) const
78303{
78304 return mImpl->GetReadonlyOctet(aRv, aRealm);
78305}
78306
78307uint8_t
78308TestJSImplInterface::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm) const
78309{
78310 return mImpl->GetWritableOctet(aRv, aRealm);
78311}
78312
78313void
78314TestJSImplInterface::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78315{
78316 mImpl->SetWritableOctet(arg, aRv, aRealm);
78317}
78318
78319void
78320TestJSImplInterface::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78321{
78322 return mImpl->PassOctet(arg, aRv, aRealm);
78323}
78324
78325uint8_t
78326TestJSImplInterface::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm)
78327{
78328 return mImpl->ReceiveOctet(aRv, aRealm);
78329}
78330
78331void
78332TestJSImplInterface::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78333{
78334 return mImpl->PassOptionalOctet(arg, aRv, aRealm);
78335}
78336
78337void
78338TestJSImplInterface::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78339{
78340 return mImpl->PassOptionalOctetWithDefault(arg, aRv, aRealm);
78341}
78342
78343uint16_t
78344TestJSImplInterface::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const
78345{
78346 return mImpl->GetReadonlyUnsignedShort(aRv, aRealm);
78347}
78348
78349uint16_t
78350TestJSImplInterface::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const
78351{
78352 return mImpl->GetWritableUnsignedShort(aRv, aRealm);
78353}
78354
78355void
78356TestJSImplInterface::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78357{
78358 mImpl->SetWritableUnsignedShort(arg, aRv, aRealm);
78359}
78360
78361void
78362TestJSImplInterface::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78363{
78364 return mImpl->PassUnsignedShort(arg, aRv, aRealm);
78365}
78366
78367uint16_t
78368TestJSImplInterface::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
78369{
78370 return mImpl->ReceiveUnsignedShort(aRv, aRealm);
78371}
78372
78373void
78374TestJSImplInterface::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78375{
78376 return mImpl->PassOptionalUnsignedShort(arg, aRv, aRealm);
78377}
78378
78379void
78380TestJSImplInterface::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78381{
78382 return mImpl->PassOptionalUnsignedShortWithDefault(arg, aRv, aRealm);
78383}
78384
78385uint32_t
78386TestJSImplInterface::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const
78387{
78388 return mImpl->GetReadonlyUnsignedLong(aRv, aRealm);
78389}
78390
78391uint32_t
78392TestJSImplInterface::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const
78393{
78394 return mImpl->GetWritableUnsignedLong(aRv, aRealm);
78395}
78396
78397void
78398TestJSImplInterface::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78399{
78400 mImpl->SetWritableUnsignedLong(arg, aRv, aRealm);
78401}
78402
78403void
78404TestJSImplInterface::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78405{
78406 return mImpl->PassUnsignedLong(arg, aRv, aRealm);
78407}
78408
78409uint32_t
78410TestJSImplInterface::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
78411{
78412 return mImpl->ReceiveUnsignedLong(aRv, aRealm);
78413}
78414
78415void
78416TestJSImplInterface::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78417{
78418 return mImpl->PassOptionalUnsignedLong(arg, aRv, aRealm);
78419}
78420
78421void
78422TestJSImplInterface::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78423{
78424 return mImpl->PassOptionalUnsignedLongWithDefault(arg, aRv, aRealm);
78425}
78426
78427uint64_t
78428TestJSImplInterface::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78429{
78430 return mImpl->GetReadonlyUnsignedLongLong(aRv, aRealm);
78431}
78432
78433uint64_t
78434TestJSImplInterface::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78435{
78436 return mImpl->GetWritableUnsignedLongLong(aRv, aRealm);
78437}
78438
78439void
78440TestJSImplInterface::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78441{
78442 mImpl->SetWritableUnsignedLongLong(arg, aRv, aRealm);
78443}
78444
78445void
78446TestJSImplInterface::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78447{
78448 return mImpl->PassUnsignedLongLong(arg, aRv, aRealm);
78449}
78450
78451uint64_t
78452TestJSImplInterface::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
78453{
78454 return mImpl->ReceiveUnsignedLongLong(aRv, aRealm);
78455}
78456
78457void
78458TestJSImplInterface::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78459{
78460 return mImpl->PassOptionalUnsignedLongLong(arg, aRv, aRealm);
78461}
78462
78463void
78464TestJSImplInterface::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78465{
78466 return mImpl->PassOptionalUnsignedLongLongWithDefault(arg, aRv, aRealm);
78467}
78468
78469float
78470TestJSImplInterface::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78471{
78472 return mImpl->GetWritableFloat(aRv, aRealm);
78473}
78474
78475void
78476TestJSImplInterface::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78477{
78478 mImpl->SetWritableFloat(arg, aRv, aRealm);
78479}
78480
78481float
78482TestJSImplInterface::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78483{
78484 return mImpl->GetWritableUnrestrictedFloat(aRv, aRealm);
78485}
78486
78487void
78488TestJSImplInterface::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78489{
78490 mImpl->SetWritableUnrestrictedFloat(arg, aRv, aRealm);
78491}
78492
78493Nullable<float>
78494TestJSImplInterface::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78495{
78496 return mImpl->GetWritableNullableFloat(aRv, aRealm);
78497}
78498
78499void
78500TestJSImplInterface::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78501{
78502 mImpl->SetWritableNullableFloat(arg, aRv, aRealm);
78503}
78504
78505Nullable<float>
78506TestJSImplInterface::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78507{
78508 return mImpl->GetWritableNullableUnrestrictedFloat(aRv, aRealm);
78509}
78510
78511void
78512TestJSImplInterface::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78513{
78514 mImpl->SetWritableNullableUnrestrictedFloat(arg, aRv, aRealm);
78515}
78516
78517double
78518TestJSImplInterface::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78519{
78520 return mImpl->GetWritableDouble(aRv, aRealm);
78521}
78522
78523void
78524TestJSImplInterface::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78525{
78526 mImpl->SetWritableDouble(arg, aRv, aRealm);
78527}
78528
78529double
78530TestJSImplInterface::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78531{
78532 return mImpl->GetWritableUnrestrictedDouble(aRv, aRealm);
78533}
78534
78535void
78536TestJSImplInterface::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78537{
78538 mImpl->SetWritableUnrestrictedDouble(arg, aRv, aRealm);
78539}
78540
78541Nullable<double>
78542TestJSImplInterface::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78543{
78544 return mImpl->GetWritableNullableDouble(aRv, aRealm);
78545}
78546
78547void
78548TestJSImplInterface::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78549{
78550 mImpl->SetWritableNullableDouble(arg, aRv, aRealm);
78551}
78552
78553Nullable<double>
78554TestJSImplInterface::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78555{
78556 return mImpl->GetWritableNullableUnrestrictedDouble(aRv, aRealm);
78557}
78558
78559void
78560TestJSImplInterface::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78561{
78562 mImpl->SetWritableNullableUnrestrictedDouble(arg, aRv, aRealm);
78563}
78564
78565void
78566TestJSImplInterface::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)
78567{
78568 return mImpl->PassFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm);
78569}
78570
78571void
78572TestJSImplInterface::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)
78573{
78574 return mImpl->PassLenientFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm);
78575}
78576
78577float
78578TestJSImplInterface::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm) const
78579{
78580 return mImpl->GetLenientFloatAttr(aRv, aRealm);
78581}
78582
78583void
78584TestJSImplInterface::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78585{
78586 mImpl->SetLenientFloatAttr(arg, aRv, aRealm);
78587}
78588
78589double
78590TestJSImplInterface::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm) const
78591{
78592 return mImpl->GetLenientDoubleAttr(aRv, aRealm);
78593}
78594
78595void
78596TestJSImplInterface::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78597{
78598 mImpl->SetLenientDoubleAttr(arg, aRv, aRealm);
78599}
78600
78601// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78602already_AddRefed<TestJSImplInterface>
78603TestJSImplInterface::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm)
78604{
78605 return mImpl->ReceiveSelf(aRv, aRealm);
78606}
78607
78608// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78609already_AddRefed<TestJSImplInterface>
78610TestJSImplInterface::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
78611{
78612 return mImpl->ReceiveNullableSelf(aRv, aRealm);
78613}
78614
78615// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78616already_AddRefed<TestJSImplInterface>
78617TestJSImplInterface::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm)
78618{
78619 return mImpl->ReceiveWeakSelf(aRv, aRealm);
78620}
78621
78622// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78623already_AddRefed<TestJSImplInterface>
78624TestJSImplInterface::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
78625{
78626 return mImpl->ReceiveWeakNullableSelf(aRv, aRealm);
78627}
78628
78629void
78630TestJSImplInterface::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78631{
78632 return mImpl->PassSelf(arg, aRv, aRealm);
78633}
78634
78635void
78636TestJSImplInterface::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78637{
78638 return mImpl->PassNullableSelf(arg, aRv, aRealm);
78639}
78640
78641// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78642already_AddRefed<TestJSImplInterface>
78643TestJSImplInterface::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm) const
78644{
78645 return mImpl->GetNonNullSelf(aRv, aRealm);
78646}
78647
78648void
78649TestJSImplInterface::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78650{
78651 mImpl->SetNonNullSelf(arg, aRv, aRealm);
78652}
78653
78654// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78655already_AddRefed<TestJSImplInterface>
78656TestJSImplInterface::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) const
78657{
78658 return mImpl->GetNullableSelf(aRv, aRealm);
78659}
78660
78661void
78662TestJSImplInterface::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78663{
78664 mImpl->SetNullableSelf(arg, aRv, aRealm);
78665}
78666
78667void
78668TestJSImplInterface::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78669{
78670 return mImpl->PassOptionalSelf(arg, aRv, aRealm);
78671}
78672
78673void
78674TestJSImplInterface::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78675{
78676 return mImpl->PassOptionalNonNullSelf(arg, aRv, aRealm);
78677}
78678
78679void
78680TestJSImplInterface::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78681{
78682 return mImpl->PassOptionalSelfWithDefault(arg, aRv, aRealm);
78683}
78684
78685already_AddRefed<TestNonWrapperCacheInterface>
78686TestJSImplInterface::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
78687{
78688 return mImpl->ReceiveNonWrapperCacheInterface(aRv, aRealm);
78689}
78690
78691already_AddRefed<TestNonWrapperCacheInterface>
78692TestJSImplInterface::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
78693{
78694 return mImpl->ReceiveNullableNonWrapperCacheInterface(aRv, aRealm);
78695}
78696
78697void
78698TestJSImplInterface::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78699{
78700 return mImpl->ReceiveNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm);
78701}
78702
78703void
78704TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78705{
78706 return mImpl->ReceiveNullableNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm);
78707}
78708
78709void
78710TestJSImplInterface::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78711{
78712 return mImpl->ReceiveNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm);
78713}
78714
78715void
78716TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78717{
78718 return mImpl->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm);
78719}
78720
78721// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78722already_AddRefed<TestExternalInterface>
78723TestJSImplInterface::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm)
78724{
78725 return mImpl->ReceiveExternal(aRv, aRealm);
78726}
78727
78728// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78729already_AddRefed<TestExternalInterface>
78730TestJSImplInterface::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
78731{
78732 return mImpl->ReceiveNullableExternal(aRv, aRealm);
78733}
78734
78735// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78736already_AddRefed<TestExternalInterface>
78737TestJSImplInterface::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm)
78738{
78739 return mImpl->ReceiveWeakExternal(aRv, aRealm);
78740}
78741
78742// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78743already_AddRefed<TestExternalInterface>
78744TestJSImplInterface::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
78745{
78746 return mImpl->ReceiveWeakNullableExternal(aRv, aRealm);
78747}
78748
78749void
78750TestJSImplInterface::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78751{
78752 return mImpl->PassExternal(arg, aRv, aRealm);
78753}
78754
78755void
78756TestJSImplInterface::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78757{
78758 return mImpl->PassNullableExternal(arg, aRv, aRealm);
78759}
78760
78761// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78762already_AddRefed<TestExternalInterface>
78763TestJSImplInterface::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm) const
78764{
78765 return mImpl->GetNonNullExternal(aRv, aRealm);
78766}
78767
78768void
78769TestJSImplInterface::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78770{
78771 mImpl->SetNonNullExternal(arg, aRv, aRealm);
78772}
78773
78774// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78775already_AddRefed<TestExternalInterface>
78776TestJSImplInterface::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) const
78777{
78778 return mImpl->GetNullableExternal(aRv, aRealm);
78779}
78780
78781void
78782TestJSImplInterface::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78783{
78784 mImpl->SetNullableExternal(arg, aRv, aRealm);
78785}
78786
78787void
78788TestJSImplInterface::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78789{
78790 return mImpl->PassOptionalExternal(arg, aRv, aRealm);
78791}
78792
78793void
78794TestJSImplInterface::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78795{
78796 return mImpl->PassOptionalNonNullExternal(arg, aRv, aRealm);
78797}
78798
78799void
78800TestJSImplInterface::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78801{
78802 return mImpl->PassOptionalExternalWithDefault(arg, aRv, aRealm);
78803}
78804
78805// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78806already_AddRefed<TestCallbackInterface>
78807TestJSImplInterface::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78808{
78809 return mImpl->ReceiveCallbackInterface(aRv, aRealm);
78810}
78811
78812// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78813already_AddRefed<TestCallbackInterface>
78814TestJSImplInterface::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78815{
78816 return mImpl->ReceiveNullableCallbackInterface(aRv, aRealm);
78817}
78818
78819// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78820already_AddRefed<TestCallbackInterface>
78821TestJSImplInterface::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78822{
78823 return mImpl->ReceiveWeakCallbackInterface(aRv, aRealm);
78824}
78825
78826// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78827already_AddRefed<TestCallbackInterface>
78828TestJSImplInterface::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78829{
78830 return mImpl->ReceiveWeakNullableCallbackInterface(aRv, aRealm);
78831}
78832
78833void
78834TestJSImplInterface::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78835{
78836 return mImpl->PassCallbackInterface(arg, aRv, aRealm);
78837}
78838
78839void
78840TestJSImplInterface::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78841{
78842 return mImpl->PassNullableCallbackInterface(arg, aRv, aRealm);
78843}
78844
78845// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78846already_AddRefed<TestCallbackInterface>
78847TestJSImplInterface::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const
78848{
78849 return mImpl->GetNonNullCallbackInterface(aRv, aRealm);
78850}
78851
78852void
78853TestJSImplInterface::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78854{
78855 mImpl->SetNonNullCallbackInterface(arg, aRv, aRealm);
78856}
78857
78858// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78859already_AddRefed<TestCallbackInterface>
78860TestJSImplInterface::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const
78861{
78862 return mImpl->GetNullableCallbackInterface(aRv, aRealm);
78863}
78864
78865void
78866TestJSImplInterface::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78867{
78868 mImpl->SetNullableCallbackInterface(arg, aRv, aRealm);
78869}
78870
78871void
78872TestJSImplInterface::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78873{
78874 return mImpl->PassOptionalCallbackInterface(arg, aRv, aRealm);
78875}
78876
78877void
78878TestJSImplInterface::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78879{
78880 return mImpl->PassOptionalNonNullCallbackInterface(arg, aRv, aRealm);
78881}
78882
78883void
78884TestJSImplInterface::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78885{
78886 return mImpl->PassOptionalCallbackInterfaceWithDefault(arg, aRv, aRealm);
78887}
78888
78889void
78890TestJSImplInterface::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78891{
78892 return mImpl->ReceiveSequence(aRetVal, aRv, aRealm);
78893}
78894
78895void
78896TestJSImplInterface::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78897{
78898 return mImpl->ReceiveNullableSequence(aRetVal, aRv, aRealm);
78899}
78900
78901void
78902TestJSImplInterface::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78903{
78904 return mImpl->ReceiveSequenceOfNullableInts(aRetVal, aRv, aRealm);
78905}
78906
78907void
78908TestJSImplInterface::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78909{
78910 return mImpl->ReceiveNullableSequenceOfNullableInts(aRetVal, aRv, aRealm);
78911}
78912
78913void
78914TestJSImplInterface::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78915{
78916 return mImpl->PassSequence(arg, aRv, aRealm);
78917}
78918
78919void
78920TestJSImplInterface::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78921{
78922 return mImpl->PassNullableSequence(arg, aRv, aRealm);
78923}
78924
78925void
78926TestJSImplInterface::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78927{
78928 return mImpl->PassSequenceOfNullableInts(arg, aRv, aRealm);
78929}
78930
78931void
78932TestJSImplInterface::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78933{
78934 return mImpl->PassOptionalSequenceOfNullableInts(arg, aRv, aRealm);
78935}
78936
78937void
78938TestJSImplInterface::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78939{
78940 return mImpl->PassOptionalNullableSequenceOfNullableInts(arg, aRv, aRealm);
78941}
78942
78943void
78944TestJSImplInterface::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78945{
78946 return mImpl->ReceiveCastableObjectSequence(aRetVal, aRv, aRealm);
78947}
78948
78949void
78950TestJSImplInterface::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78951{
78952 return mImpl->ReceiveCallbackObjectSequence(aRetVal, aRv, aRealm);
78953}
78954
78955void
78956TestJSImplInterface::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78957{
78958 return mImpl->ReceiveNullableCastableObjectSequence(aRetVal, aRv, aRealm);
78959}
78960
78961void
78962TestJSImplInterface::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78963{
78964 return mImpl->ReceiveNullableCallbackObjectSequence(aRetVal, aRv, aRealm);
78965}
78966
78967void
78968TestJSImplInterface::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78969{
78970 return mImpl->ReceiveCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78971}
78972
78973void
78974TestJSImplInterface::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78975{
78976 return mImpl->ReceiveNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78977}
78978
78979void
78980TestJSImplInterface::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78981{
78982 return mImpl->ReceiveWeakCastableObjectSequence(aRetVal, aRv, aRealm);
78983}
78984
78985void
78986TestJSImplInterface::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78987{
78988 return mImpl->ReceiveWeakNullableCastableObjectSequence(aRetVal, aRv, aRealm);
78989}
78990
78991void
78992TestJSImplInterface::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78993{
78994 return mImpl->ReceiveWeakCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78995}
78996
78997void
78998TestJSImplInterface::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78999{
79000 return mImpl->ReceiveWeakNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm);
79001}
79002
79003void
79004TestJSImplInterface::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79005{
79006 return mImpl->PassCastableObjectSequence(arg, aRv, aRealm);
79007}
79008
79009void
79010TestJSImplInterface::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79011{
79012 return mImpl->PassNullableCastableObjectSequence(arg, aRv, aRealm);
79013}
79014
79015void
79016TestJSImplInterface::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79017{
79018 return mImpl->PassCastableObjectNullableSequence(arg, aRv, aRealm);
79019}
79020
79021void
79022TestJSImplInterface::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79023{
79024 return mImpl->PassNullableCastableObjectNullableSequence(arg, aRv, aRealm);
79025}
79026
79027void
79028TestJSImplInterface::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79029{
79030 return mImpl->PassOptionalSequence(arg, aRv, aRealm);
79031}
79032
79033void
79034TestJSImplInterface::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79035{
79036 return mImpl->PassOptionalSequenceWithDefaultValue(arg, aRv, aRealm);
79037}
79038
79039void
79040TestJSImplInterface::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79041{
79042 return mImpl->PassOptionalNullableSequence(arg, aRv, aRealm);
79043}
79044
79045void
79046TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79047{
79048 return mImpl->PassOptionalNullableSequenceWithDefaultValue(arg, aRv, aRealm);
79049}
79050
79051void
79052TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79053{
79054 return mImpl->PassOptionalNullableSequenceWithDefaultValue2(arg, aRv, aRealm);
79055}
79056
79057void
79058TestJSImplInterface::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79059{
79060 return mImpl->PassOptionalObjectSequence(arg, aRv, aRealm);
79061}
79062
79063void
79064TestJSImplInterface::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79065{
79066 return mImpl->PassExternalInterfaceSequence(arg, aRv, aRealm);
79067}
79068
79069void
79070TestJSImplInterface::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79071{
79072 return mImpl->PassNullableExternalInterfaceSequence(arg, aRv, aRealm);
79073}
79074
79075void
79076TestJSImplInterface::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79077{
79078 return mImpl->ReceiveStringSequence(aRetVal, aRv, aRealm);
79079}
79080
79081void
79082TestJSImplInterface::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79083{
79084 return mImpl->ReceiveByteStringSequence(aRetVal, aRv, aRealm);
79085}
79086
79087void
79088TestJSImplInterface::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79089{
79090 return mImpl->ReceiveUTF8StringSequence(aRetVal, aRv, aRealm);
79091}
79092
79093void
79094TestJSImplInterface::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79095{
79096 return mImpl->ReceiveAnySequence(aRetVal, aRv, aRealm);
79097}
79098
79099void
79100TestJSImplInterface::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79101{
79102 return mImpl->ReceiveNullableAnySequence(aRetVal, aRv, aRealm);
79103}
79104
79105void
79106TestJSImplInterface::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79107{
79108 return mImpl->ReceiveObjectSequence(aRetVal, aRv, aRealm);
79109}
79110
79111void
79112TestJSImplInterface::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79113{
79114 return mImpl->ReceiveNullableObjectSequence(aRetVal, aRv, aRealm);
79115}
79116
79117void
79118TestJSImplInterface::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79119{
79120 return mImpl->PassSequenceOfSequences(arg, aRv, aRealm);
79121}
79122
79123void
79124TestJSImplInterface::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79125{
79126 return mImpl->PassSequenceOfSequencesOfSequences(arg, aRv, aRealm);
79127}
79128
79129void
79130TestJSImplInterface::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79131{
79132 return mImpl->PassRecord(arg, aRv, aRealm);
79133}
79134
79135void
79136TestJSImplInterface::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79137{
79138 return mImpl->PassNullableRecord(arg, aRv, aRealm);
79139}
79140
79141void
79142TestJSImplInterface::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79143{
79144 return mImpl->PassRecordOfNullableInts(arg, aRv, aRealm);
79145}
79146
79147void
79148TestJSImplInterface::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79149{
79150 return mImpl->PassOptionalRecordOfNullableInts(arg, aRv, aRealm);
79151}
79152
79153void
79154TestJSImplInterface::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79155{
79156 return mImpl->PassOptionalNullableRecordOfNullableInts(arg, aRv, aRealm);
79157}
79158
79159void
79160TestJSImplInterface::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79161{
79162 return mImpl->PassCastableObjectRecord(arg, aRv, aRealm);
79163}
79164
79165void
79166TestJSImplInterface::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79167{
79168 return mImpl->PassNullableCastableObjectRecord(arg, aRv, aRealm);
79169}
79170
79171void
79172TestJSImplInterface::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79173{
79174 return mImpl->PassCastableObjectNullableRecord(arg, aRv, aRealm);
79175}
79176
79177void
79178TestJSImplInterface::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79179{
79180 return mImpl->PassNullableCastableObjectNullableRecord(arg, aRv, aRealm);
79181}
79182
79183void
79184TestJSImplInterface::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79185{
79186 return mImpl->PassOptionalRecord(arg, aRv, aRealm);
79187}
79188
79189void
79190TestJSImplInterface::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79191{
79192 return mImpl->PassOptionalNullableRecord(arg, aRv, aRealm);
79193}
79194
79195void
79196TestJSImplInterface::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79197{
79198 return mImpl->PassOptionalNullableRecordWithDefaultValue(arg, aRv, aRealm);
79199}
79200
79201void
79202TestJSImplInterface::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79203{
79204 return mImpl->PassOptionalObjectRecord(arg, aRv, aRealm);
79205}
79206
79207void
79208TestJSImplInterface::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79209{
79210 return mImpl->PassExternalInterfaceRecord(arg, aRv, aRealm);
79211}
79212
79213void
79214TestJSImplInterface::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79215{
79216 return mImpl->PassNullableExternalInterfaceRecord(arg, aRv, aRealm);
79217}
79218
79219void
79220TestJSImplInterface::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79221{
79222 return mImpl->PassStringRecord(arg, aRv, aRealm);
79223}
79224
79225void
79226TestJSImplInterface::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79227{
79228 return mImpl->PassByteStringRecord(arg, aRv, aRealm);
79229}
79230
79231void
79232TestJSImplInterface::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79233{
79234 return mImpl->PassUTF8StringRecord(arg, aRv, aRealm);
79235}
79236
79237void
79238TestJSImplInterface::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79239{
79240 return mImpl->PassRecordOfRecords(arg, aRv, aRealm);
79241}
79242
79243void
79244TestJSImplInterface::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79245{
79246 return mImpl->ReceiveRecord(aRetVal, aRv, aRealm);
79247}
79248
79249void
79250TestJSImplInterface::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79251{
79252 return mImpl->ReceiveNullableRecord(aRetVal, aRv, aRealm);
79253}
79254
79255void
79256TestJSImplInterface::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79257{
79258 return mImpl->ReceiveRecordOfNullableInts(aRetVal, aRv, aRealm);
79259}
79260
79261void
79262TestJSImplInterface::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79263{
79264 return mImpl->ReceiveNullableRecordOfNullableInts(aRetVal, aRv, aRealm);
79265}
79266
79267void
79268TestJSImplInterface::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79269{
79270 return mImpl->ReceiveAnyRecord(aRetVal, aRv, aRealm);
79271}
79272
79273void
79274TestJSImplInterface::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
79275{
79276 return mImpl->PassArrayBuffer(arg, aRv, aRealm);
79277}
79278
79279void
79280TestJSImplInterface::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79281{
79282 return mImpl->PassNullableArrayBuffer(arg, aRv, aRealm);
79283}
79284
79285void
79286TestJSImplInterface::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79287{
79288 return mImpl->PassOptionalArrayBuffer(arg, aRv, aRealm);
79289}
79290
79291void
79292TestJSImplInterface::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79293{
79294 return mImpl->PassOptionalNullableArrayBuffer(arg, aRv, aRealm);
79295}
79296
79297void
79298TestJSImplInterface::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79299{
79300 return mImpl->PassOptionalNullableArrayBufferWithDefaultValue(arg, aRv, aRealm);
79301}
79302
79303void
79304TestJSImplInterface::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
79305{
79306 return mImpl->PassArrayBufferView(arg, aRv, aRealm);
79307}
79308
79309void
79310TestJSImplInterface::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79311{
79312 return mImpl->PassInt8Array(arg, aRv, aRealm);
79313}
79314
79315void
79316TestJSImplInterface::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79317{
79318 return mImpl->PassInt16Array(arg, aRv, aRealm);
79319}
79320
79321void
79322TestJSImplInterface::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79323{
79324 return mImpl->PassInt32Array(arg, aRv, aRealm);
79325}
79326
79327void
79328TestJSImplInterface::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79329{
79330 return mImpl->PassUint8Array(arg, aRv, aRealm);
79331}
79332
79333void
79334TestJSImplInterface::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79335{
79336 return mImpl->PassUint16Array(arg, aRv, aRealm);
79337}
79338
79339void
79340TestJSImplInterface::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79341{
79342 return mImpl->PassUint32Array(arg, aRv, aRealm);
79343}
79344
79345void
79346TestJSImplInterface::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm)
79347{
79348 return mImpl->PassUint8ClampedArray(arg, aRv, aRealm);
79349}
79350
79351void
79352TestJSImplInterface::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79353{
79354 return mImpl->PassFloat32Array(arg, aRv, aRealm);
79355}
79356
79357void
79358TestJSImplInterface::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79359{
79360 return mImpl->PassFloat64Array(arg, aRv, aRealm);
79361}
79362
79363void
79364TestJSImplInterface::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79365{
79366 return mImpl->PassSequenceOfArrayBuffers(arg, aRv, aRealm);
79367}
79368
79369void
79370TestJSImplInterface::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79371{
79372 return mImpl->PassSequenceOfNullableArrayBuffers(arg, aRv, aRealm);
79373}
79374
79375void
79376TestJSImplInterface::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79377{
79378 return mImpl->PassRecordOfArrayBuffers(arg, aRv, aRealm);
79379}
79380
79381void
79382TestJSImplInterface::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79383{
79384 return mImpl->PassRecordOfNullableArrayBuffers(arg, aRv, aRealm);
79385}
79386
79387void
79388TestJSImplInterface::PassVariadicTypedArray(const Sequence<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79389{
79390 return mImpl->PassVariadicTypedArray(arg, aRv, aRealm);
79391}
79392
79393void
79394TestJSImplInterface::PassVariadicNullableTypedArray(const Sequence<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79395{
79396 return mImpl->PassVariadicNullableTypedArray(arg, aRv, aRealm);
79397}
79398
79399void
79400TestJSImplInterface::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79401{
79402 return mImpl->ReceiveUint8Array(aRetVal, aRv, aRealm);
79403}
79404
79405void
79406TestJSImplInterface::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79407{
79408 return mImpl->GetUint8ArrayAttr(aRetVal, aRv, aRealm);
79409}
79410
79411void
79412TestJSImplInterface::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79413{
79414 mImpl->SetUint8ArrayAttr(arg, aRv, aRealm);
79415}
79416
79417void
79418TestJSImplInterface::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79419{
79420 return mImpl->PassString(arg, aRv, aRealm);
79421}
79422
79423void
79424TestJSImplInterface::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79425{
79426 return mImpl->PassNullableString(arg, aRv, aRealm);
79427}
79428
79429void
79430TestJSImplInterface::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79431{
79432 return mImpl->PassOptionalString(arg, aRv, aRealm);
79433}
79434
79435void
79436TestJSImplInterface::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79437{
79438 return mImpl->PassOptionalStringWithDefaultValue(arg, aRv, aRealm);
79439}
79440
79441void
79442TestJSImplInterface::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79443{
79444 return mImpl->PassOptionalNullableString(arg, aRv, aRealm);
79445}
79446
79447void
79448TestJSImplInterface::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79449{
79450 return mImpl->PassOptionalNullableStringWithDefaultValue(arg, aRv, aRealm);
79451}
79452
79453void
79454TestJSImplInterface::PassVariadicString(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79455{
79456 return mImpl->PassVariadicString(arg, aRv, aRealm);
79457}
79458
79459void
79460TestJSImplInterface::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79461{
79462 return mImpl->PassByteString(arg, aRv, aRealm);
79463}
79464
79465void
79466TestJSImplInterface::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79467{
79468 return mImpl->PassNullableByteString(arg, aRv, aRealm);
79469}
79470
79471void
79472TestJSImplInterface::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79473{
79474 return mImpl->PassOptionalByteString(arg, aRv, aRealm);
79475}
79476
79477void
79478TestJSImplInterface::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79479{
79480 return mImpl->PassOptionalByteStringWithDefaultValue(arg, aRv, aRealm);
79481}
79482
79483void
79484TestJSImplInterface::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79485{
79486 return mImpl->PassOptionalNullableByteString(arg, aRv, aRealm);
79487}
79488
79489void
79490TestJSImplInterface::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79491{
79492 return mImpl->PassOptionalNullableByteStringWithDefaultValue(arg, aRv, aRealm);
79493}
79494
79495void
79496TestJSImplInterface::PassVariadicByteString(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79497{
79498 return mImpl->PassVariadicByteString(arg, aRv, aRealm);
79499}
79500
79501void
79502TestJSImplInterface::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79503{
79504 return mImpl->PassUnionByteString(arg, aRv, aRealm);
79505}
79506
79507void
79508TestJSImplInterface::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79509{
79510 return mImpl->PassOptionalUnionByteString(arg, aRv, aRealm);
79511}
79512
79513void
79514TestJSImplInterface::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79515{
79516 return mImpl->PassOptionalUnionByteStringWithDefaultValue(arg, aRv, aRealm);
79517}
79518
79519void
79520TestJSImplInterface::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79521{
79522 return mImpl->PassUTF8String(arg, aRv, aRealm);
79523}
79524
79525void
79526TestJSImplInterface::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79527{
79528 return mImpl->PassNullableUTF8String(arg, aRv, aRealm);
79529}
79530
79531void
79532TestJSImplInterface::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79533{
79534 return mImpl->PassOptionalUTF8String(arg, aRv, aRealm);
79535}
79536
79537void
79538TestJSImplInterface::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79539{
79540 return mImpl->PassOptionalUTF8StringWithDefaultValue(arg, aRv, aRealm);
79541}
79542
79543void
79544TestJSImplInterface::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79545{
79546 return mImpl->PassOptionalNullableUTF8String(arg, aRv, aRealm);
79547}
79548
79549void
79550TestJSImplInterface::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79551{
79552 return mImpl->PassOptionalNullableUTF8StringWithDefaultValue(arg, aRv, aRealm);
79553}
79554
79555void
79556TestJSImplInterface::PassVariadicUTF8String(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79557{
79558 return mImpl->PassVariadicUTF8String(arg, aRv, aRealm);
79559}
79560
79561void
79562TestJSImplInterface::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79563{
79564 return mImpl->PassUnionUTF8String(arg, aRv, aRealm);
79565}
79566
79567void
79568TestJSImplInterface::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79569{
79570 return mImpl->PassOptionalUnionUTF8String(arg, aRv, aRealm);
79571}
79572
79573void
79574TestJSImplInterface::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79575{
79576 return mImpl->PassOptionalUnionUTF8StringWithDefaultValue(arg, aRv, aRealm);
79577}
79578
79579void
79580TestJSImplInterface::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79581{
79582 return mImpl->PassSVS(arg, aRv, aRealm);
79583}
79584
79585void
79586TestJSImplInterface::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79587{
79588 return mImpl->PassNullableSVS(arg, aRv, aRealm);
79589}
79590
79591void
79592TestJSImplInterface::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79593{
79594 return mImpl->PassOptionalSVS(arg, aRv, aRealm);
79595}
79596
79597void
79598TestJSImplInterface::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79599{
79600 return mImpl->PassOptionalSVSWithDefaultValue(arg, aRv, aRealm);
79601}
79602
79603void
79604TestJSImplInterface::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79605{
79606 return mImpl->PassOptionalNullableSVS(arg, aRv, aRealm);
79607}
79608
79609void
79610TestJSImplInterface::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79611{
79612 return mImpl->PassOptionalNullableSVSWithDefaultValue(arg, aRv, aRealm);
79613}
79614
79615void
79616TestJSImplInterface::PassVariadicSVS(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79617{
79618 return mImpl->PassVariadicSVS(arg, aRv, aRealm);
79619}
79620
79621void
79622TestJSImplInterface::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79623{
79624 return mImpl->ReceiveSVS(aRetVal, aRv, aRealm);
79625}
79626
79627void
79628TestJSImplInterface::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79629{
79630 return mImpl->PassJSString(arg, aRv, aRealm);
79631}
79632
79633void
79634TestJSImplInterface::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79635{
79636 return mImpl->PassOptionalJSStringWithDefaultValue(arg, aRv, aRealm);
79637}
79638
79639void
79640TestJSImplInterface::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79641{
79642 return mImpl->ReceiveJSString(aRetVal, aRv, aRealm);
79643}
79644
79645void
79646TestJSImplInterface::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79647{
79648 return mImpl->GetReadonlyJSStringAttr(aRetVal, aRv, aRealm);
79649}
79650
79651void
79652TestJSImplInterface::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79653{
79654 return mImpl->GetJsStringAttr(aRetVal, aRv, aRealm);
79655}
79656
79657void
79658TestJSImplInterface::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79659{
79660 mImpl->SetJsStringAttr(arg, aRv, aRealm);
79661}
79662
79663void
79664TestJSImplInterface::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79665{
79666 return mImpl->PassEnum(arg, aRv, aRealm);
79667}
79668
79669void
79670TestJSImplInterface::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79671{
79672 return mImpl->PassNullableEnum(arg, aRv, aRealm);
79673}
79674
79675void
79676TestJSImplInterface::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79677{
79678 return mImpl->PassOptionalEnum(arg, aRv, aRealm);
79679}
79680
79681void
79682TestJSImplInterface::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79683{
79684 return mImpl->PassEnumWithDefault(arg, aRv, aRealm);
79685}
79686
79687void
79688TestJSImplInterface::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79689{
79690 return mImpl->PassOptionalNullableEnum(arg, aRv, aRealm);
79691}
79692
79693void
79694TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79695{
79696 return mImpl->PassOptionalNullableEnumWithDefaultValue(arg, aRv, aRealm);
79697}
79698
79699void
79700TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79701{
79702 return mImpl->PassOptionalNullableEnumWithDefaultValue2(arg, aRv, aRealm);
79703}
79704
79705MyTestEnum
79706TestJSImplInterface::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm)
79707{
79708 return mImpl->ReceiveEnum(aRv, aRealm);
79709}
79710
79711Nullable<MyTestEnum>
79712TestJSImplInterface::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm)
79713{
79714 return mImpl->ReceiveNullableEnum(aRv, aRealm);
79715}
79716
79717MyTestEnum
79718TestJSImplInterface::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
79719{
79720 return mImpl->GetEnumAttribute(aRv, aRealm);
79721}
79722
79723void
79724TestJSImplInterface::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79725{
79726 mImpl->SetEnumAttribute(arg, aRv, aRealm);
79727}
79728
79729MyTestEnum
79730TestJSImplInterface::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
79731{
79732 return mImpl->GetReadonlyEnumAttribute(aRv, aRealm);
79733}
79734
79735void
79736TestJSImplInterface::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
79737{
79738 return mImpl->PassCallback(arg, aRv, aRealm);
79739}
79740
79741void
79742TestJSImplInterface::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79743{
79744 return mImpl->PassNullableCallback(arg, aRv, aRealm);
79745}
79746
79747void
79748TestJSImplInterface::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79749{
79750 return mImpl->PassOptionalCallback(arg, aRv, aRealm);
79751}
79752
79753void
79754TestJSImplInterface::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79755{
79756 return mImpl->PassOptionalNullableCallback(arg, aRv, aRealm);
79757}
79758
79759void
79760TestJSImplInterface::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79761{
79762 return mImpl->PassOptionalNullableCallbackWithDefaultValue(arg, aRv, aRealm);
79763}
79764
79765already_AddRefed<MyTestCallback>
79766TestJSImplInterface::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm)
79767{
79768 return mImpl->ReceiveCallback(aRv, aRealm);
79769}
79770
79771already_AddRefed<MyTestCallback>
79772TestJSImplInterface::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm)
79773{
79774 return mImpl->ReceiveNullableCallback(aRv, aRealm);
79775}
79776
79777void
79778TestJSImplInterface::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79779{
79780 return mImpl->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(arg, aRv, aRealm);
79781}
79782
79783void
79784TestJSImplInterface::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79785{
79786 return mImpl->PassAny(arg, aRv, aRealm);
79787}
79788
79789void
79790TestJSImplInterface::PassVariadicAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79791{
79792 return mImpl->PassVariadicAny(arg, aRv, aRealm);
79793}
79794
79795void
79796TestJSImplInterface::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79797{
79798 return mImpl->PassOptionalAny(arg, aRv, aRealm);
79799}
79800
79801void
79802TestJSImplInterface::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79803{
79804 return mImpl->PassAnyDefaultNull(arg, aRv, aRealm);
79805}
79806
79807void
79808TestJSImplInterface::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79809{
79810 return mImpl->PassSequenceOfAny(arg, aRv, aRealm);
79811}
79812
79813void
79814TestJSImplInterface::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79815{
79816 return mImpl->PassNullableSequenceOfAny(arg, aRv, aRealm);
79817}
79818
79819void
79820TestJSImplInterface::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79821{
79822 return mImpl->PassOptionalSequenceOfAny(arg, aRv, aRealm);
79823}
79824
79825void
79826TestJSImplInterface::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79827{
79828 return mImpl->PassOptionalNullableSequenceOfAny(arg, aRv, aRealm);
79829}
79830
79831void
79832TestJSImplInterface::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79833{
79834 return mImpl->PassOptionalSequenceOfAnyWithDefaultValue(arg, aRv, aRealm);
79835}
79836
79837void
79838TestJSImplInterface::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79839{
79840 return mImpl->PassSequenceOfSequenceOfAny(arg, aRv, aRealm);
79841}
79842
79843void
79844TestJSImplInterface::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79845{
79846 return mImpl->PassSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79847}
79848
79849void
79850TestJSImplInterface::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79851{
79852 return mImpl->PassNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79853}
79854
79855void
79856TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79857{
79858 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79859}
79860
79861void
79862TestJSImplInterface::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79863{
79864 return mImpl->PassRecordOfAny(arg, aRv, aRealm);
79865}
79866
79867void
79868TestJSImplInterface::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79869{
79870 return mImpl->PassNullableRecordOfAny(arg, aRv, aRealm);
79871}
79872
79873void
79874TestJSImplInterface::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79875{
79876 return mImpl->PassOptionalRecordOfAny(arg, aRv, aRealm);
79877}
79878
79879void
79880TestJSImplInterface::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79881{
79882 return mImpl->PassOptionalNullableRecordOfAny(arg, aRv, aRealm);
79883}
79884
79885void
79886TestJSImplInterface::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79887{
79888 return mImpl->PassOptionalRecordOfAnyWithDefaultValue(arg, aRv, aRealm);
79889}
79890
79891void
79892TestJSImplInterface::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79893{
79894 return mImpl->PassRecordOfRecordOfAny(arg, aRv, aRealm);
79895}
79896
79897void
79898TestJSImplInterface::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79899{
79900 return mImpl->PassRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79901}
79902
79903void
79904TestJSImplInterface::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79905{
79906 return mImpl->PassNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79907}
79908
79909void
79910TestJSImplInterface::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79911{
79912 return mImpl->PassOptionalNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79913}
79914
79915void
79916TestJSImplInterface::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79917{
79918 return mImpl->PassOptionalNullableRecordOfNullableSequenceOfAny(arg, aRv, aRealm);
79919}
79920
79921void
79922TestJSImplInterface::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79923{
79924 return mImpl->PassOptionalNullableSequenceOfNullableRecordOfAny(arg, aRv, aRealm);
79925}
79926
79927void
79928TestJSImplInterface::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79929{
79930 return mImpl->ReceiveAny(aRetVal, aRv, aRealm);
79931}
79932
79933void
79934TestJSImplInterface::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79935{
79936 return mImpl->PassObject(arg, aRv, aRealm);
79937}
79938
79939void
79940TestJSImplInterface::PassVariadicObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79941{
79942 return mImpl->PassVariadicObject(arg, aRv, aRealm);
79943}
79944
79945void
79946TestJSImplInterface::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79947{
79948 return mImpl->PassNullableObject(arg, aRv, aRealm);
79949}
79950
79951void
79952TestJSImplInterface::PassVariadicNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79953{
79954 return mImpl->PassVariadicNullableObject(arg, aRv, aRealm);
79955}
79956
79957void
79958TestJSImplInterface::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79959{
79960 return mImpl->PassOptionalObject(arg, aRv, aRealm);
79961}
79962
79963void
79964TestJSImplInterface::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79965{
79966 return mImpl->PassOptionalNullableObject(arg, aRv, aRealm);
79967}
79968
79969void
79970TestJSImplInterface::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79971{
79972 return mImpl->PassOptionalNullableObjectWithDefaultValue(arg, aRv, aRealm);
79973}
79974
79975void
79976TestJSImplInterface::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79977{
79978 return mImpl->PassSequenceOfObject(arg, aRv, aRealm);
79979}
79980
79981void
79982TestJSImplInterface::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79983{
79984 return mImpl->PassSequenceOfNullableObject(arg, aRv, aRealm);
79985}
79986
79987void
79988TestJSImplInterface::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79989{
79990 return mImpl->PassNullableSequenceOfObject(arg, aRv, aRealm);
79991}
79992
79993void
79994TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79995{
79996 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfObject(arg, aRv, aRealm);
79997}
79998
79999void
80000TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80001{
80002 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(arg, aRv, aRealm);
80003}
80004
80005void
80006TestJSImplInterface::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80007{
80008 return mImpl->PassRecordOfObject(arg, aRv, aRealm);
80009}
80010
80011void
80012TestJSImplInterface::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80013{
80014 return mImpl->ReceiveObject(aRetVal, aRv, aRealm);
80015}
80016
80017void
80018TestJSImplInterface::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80019{
80020 return mImpl->ReceiveNullableObject(aRetVal, aRv, aRealm);
80021}
80022
80023void
80024TestJSImplInterface::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80025{
80026 return mImpl->PassUnion(arg, aRv, aRealm);
80027}
80028
80029void
80030TestJSImplInterface::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80031{
80032 return mImpl->PassUnion2(arg, aRv, aRealm);
80033}
80034
80035void
80036TestJSImplInterface::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80037{
80038 return mImpl->PassUnion3(arg, aRv, aRealm);
80039}
80040
80041void
80042TestJSImplInterface::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80043{
80044 return mImpl->PassUnion4(arg, aRv, aRealm);
80045}
80046
80047void
80048TestJSImplInterface::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80049{
80050 return mImpl->PassUnion5(arg, aRv, aRealm);
80051}
80052
80053void
80054TestJSImplInterface::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80055{
80056 return mImpl->PassUnion6(arg, aRv, aRealm);
80057}
80058
80059void
80060TestJSImplInterface::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80061{
80062 return mImpl->PassUnion7(arg, aRv, aRealm);
80063}
80064
80065void
80066TestJSImplInterface::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80067{
80068 return mImpl->PassUnion8(arg, aRv, aRealm);
80069}
80070
80071void
80072TestJSImplInterface::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
80073{
80074 return mImpl->PassUnion9(arg, aRv, aRealm);
80075}
80076
80077void
80078TestJSImplInterface::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80079{
80080 return mImpl->PassUnion10(arg, aRv, aRealm);
80081}
80082
80083void
80084TestJSImplInterface::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80085{
80086 return mImpl->PassUnion11(arg, aRv, aRealm);
80087}
80088
80089void
80090TestJSImplInterface::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80091{
80092 return mImpl->PassUnion12(arg, aRv, aRealm);
80093}
80094
80095void
80096TestJSImplInterface::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80097{
80098 return mImpl->PassUnion13(arg, aRv, aRealm);
80099}
80100
80101void
80102TestJSImplInterface::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80103{
80104 return mImpl->PassUnion14(arg, aRv, aRealm);
80105}
80106
80107void
80108TestJSImplInterface::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80109{
80110 return mImpl->PassUnion15(arg, aRv, aRealm);
80111}
80112
80113void
80114TestJSImplInterface::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80115{
80116 return mImpl->PassUnion16(arg, aRv, aRealm);
80117}
80118
80119void
80120TestJSImplInterface::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80121{
80122 return mImpl->PassUnion17(arg, aRv, aRealm);
80123}
80124
80125void
80126TestJSImplInterface::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80127{
80128 return mImpl->PassUnion18(arg, aRv, aRealm);
80129}
80130
80131void
80132TestJSImplInterface::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80133{
80134 return mImpl->PassUnion19(arg, aRv, aRealm);
80135}
80136
80137void
80138TestJSImplInterface::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80139{
80140 return mImpl->PassUnion20(arg, aRv, aRealm);
80141}
80142
80143void
80144TestJSImplInterface::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80145{
80146 return mImpl->PassUnion21(arg, aRv, aRealm);
80147}
80148
80149void
80150TestJSImplInterface::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80151{
80152 return mImpl->PassUnion22(arg, aRv, aRealm);
80153}
80154
80155void
80156TestJSImplInterface::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80157{
80158 return mImpl->PassUnion23(arg, aRv, aRealm);
80159}
80160
80161void
80162TestJSImplInterface::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80163{
80164 return mImpl->PassUnion24(arg, aRv, aRealm);
80165}
80166
80167void
80168TestJSImplInterface::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80169{
80170 return mImpl->PassUnion25(arg, aRv, aRealm);
80171}
80172
80173void
80174TestJSImplInterface::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80175{
80176 return mImpl->PassUnion26(arg, aRv, aRealm);
80177}
80178
80179void
80180TestJSImplInterface::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm)
80181{
80182 return mImpl->PassUnion27(arg, aRv, aRealm);
80183}
80184
80185void
80186TestJSImplInterface::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
80187{
80188 return mImpl->PassUnion28(arg, aRv, aRealm);
80189}
80190
80191void
80192TestJSImplInterface::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80193{
80194 return mImpl->PassUnionWithCallback(arg, aRv, aRealm);
80195}
80196
80197void
80198TestJSImplInterface::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80199{
80200 return mImpl->PassUnionWithByteString(arg, aRv, aRealm);
80201}
80202
80203void
80204TestJSImplInterface::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80205{
80206 return mImpl->PassUnionWithUTF8String(arg, aRv, aRealm);
80207}
80208
80209void
80210TestJSImplInterface::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80211{
80212 return mImpl->PassUnionWithRecord(arg, aRv, aRealm);
80213}
80214
80215void
80216TestJSImplInterface::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
80217{
80218 return mImpl->PassUnionWithRecordAndSequence(arg, aRv, aRealm);
80219}
80220
80221void
80222TestJSImplInterface::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm)
80223{
80224 return mImpl->PassUnionWithSequenceAndRecord(arg, aRv, aRealm);
80225}
80226
80227void
80228TestJSImplInterface::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80229{
80230 return mImpl->PassUnionWithSVS(arg, aRv, aRealm);
80231}
80232
80233void
80234TestJSImplInterface::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80235{
80236 return mImpl->PassUnionWithNullable(arg, aRv, aRealm);
80237}
80238
80239void
80240TestJSImplInterface::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80241{
80242 return mImpl->PassNullableUnion(arg, aRv, aRealm);
80243}
80244
80245void
80246TestJSImplInterface::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80247{
80248 return mImpl->PassOptionalUnion(arg, aRv, aRealm);
80249}
80250
80251void
80252TestJSImplInterface::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80253{
80254 return mImpl->PassOptionalNullableUnion(arg, aRv, aRealm);
80255}
80256
80257void
80258TestJSImplInterface::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80259{
80260 return mImpl->PassOptionalNullableUnionWithDefaultValue(arg, aRv, aRealm);
80261}
80262
80263void
80264TestJSImplInterface::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
80265{
80266 return mImpl->PassUnionWithArrayBuffer(arg, aRv, aRealm);
80267}
80268
80269void
80270TestJSImplInterface::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80271{
80272 return mImpl->PassUnionWithArrayBufferOrNull(arg, aRv, aRealm);
80273}
80274
80275void
80276TestJSImplInterface::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
80277{
80278 return mImpl->PassUnionWithTypedArrays(arg, aRv, aRealm);
80279}
80280
80281void
80282TestJSImplInterface::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80283{
80284 return mImpl->PassUnionWithTypedArraysOrNull(arg, aRv, aRealm);
80285}
80286
80287void
80288TestJSImplInterface::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
80289{
80290 return mImpl->PassUnionWithString(arg, aRv, aRealm);
80291}
80292
80293void
80294TestJSImplInterface::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
80295{
80296 return mImpl->PassUnionWithEnum(arg, aRv, aRealm);
80297}
80298
80299void
80300TestJSImplInterface::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80301{
80302 return mImpl->PassUnionWithObject(arg, aRv, aRealm);
80303}
80304
80305void
80306TestJSImplInterface::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80307{
80308 return mImpl->PassUnionWithDefaultValue1(arg, aRv, aRealm);
80309}
80310
80311void
80312TestJSImplInterface::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80313{
80314 return mImpl->PassUnionWithDefaultValue2(arg, aRv, aRealm);
80315}
80316
80317void
80318TestJSImplInterface::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80319{
80320 return mImpl->PassUnionWithDefaultValue3(arg, aRv, aRealm);
80321}
80322
80323void
80324TestJSImplInterface::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80325{
80326 return mImpl->PassUnionWithDefaultValue4(arg, aRv, aRealm);
80327}
80328
80329void
80330TestJSImplInterface::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80331{
80332 return mImpl->PassUnionWithDefaultValue5(arg, aRv, aRealm);
80333}
80334
80335void
80336TestJSImplInterface::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80337{
80338 return mImpl->PassUnionWithDefaultValue6(arg, aRv, aRealm);
80339}
80340
80341void
80342TestJSImplInterface::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80343{
80344 return mImpl->PassUnionWithDefaultValue7(arg, aRv, aRealm);
80345}
80346
80347void
80348TestJSImplInterface::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80349{
80350 return mImpl->PassUnionWithDefaultValue8(arg, aRv, aRealm);
80351}
80352
80353void
80354TestJSImplInterface::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80355{
80356 return mImpl->PassUnionWithDefaultValue9(arg, aRv, aRealm);
80357}
80358
80359void
80360TestJSImplInterface::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80361{
80362 return mImpl->PassUnionWithDefaultValue10(arg, aRv, aRealm);
80363}
80364
80365void
80366TestJSImplInterface::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80367{
80368 return mImpl->PassUnionWithDefaultValue11(arg, aRv, aRealm);
80369}
80370
80371void
80372TestJSImplInterface::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80373{
80374 return mImpl->PassUnionWithDefaultValue12(arg, aRv, aRealm);
80375}
80376
80377void
80378TestJSImplInterface::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80379{
80380 return mImpl->PassUnionWithDefaultValue13(arg, aRv, aRealm);
80381}
80382
80383void
80384TestJSImplInterface::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80385{
80386 return mImpl->PassUnionWithDefaultValue14(arg, aRv, aRealm);
80387}
80388
80389void
80390TestJSImplInterface::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80391{
80392 return mImpl->PassUnionWithDefaultValue15(arg, aRv, aRealm);
80393}
80394
80395void
80396TestJSImplInterface::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80397{
80398 return mImpl->PassUnionWithDefaultValue16(arg, aRv, aRealm);
80399}
80400
80401void
80402TestJSImplInterface::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80403{
80404 return mImpl->PassUnionWithDefaultValue17(arg, aRv, aRealm);
80405}
80406
80407void
80408TestJSImplInterface::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80409{
80410 return mImpl->PassUnionWithDefaultValue18(arg, aRv, aRealm);
80411}
80412
80413void
80414TestJSImplInterface::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80415{
80416 return mImpl->PassUnionWithDefaultValue19(arg, aRv, aRealm);
80417}
80418
80419void
80420TestJSImplInterface::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80421{
80422 return mImpl->PassUnionWithDefaultValue20(arg, aRv, aRealm);
80423}
80424
80425void
80426TestJSImplInterface::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80427{
80428 return mImpl->PassUnionWithDefaultValue21(arg, aRv, aRealm);
80429}
80430
80431void
80432TestJSImplInterface::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80433{
80434 return mImpl->PassUnionWithDefaultValue22(arg, aRv, aRealm);
80435}
80436
80437void
80438TestJSImplInterface::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80439{
80440 return mImpl->PassUnionWithDefaultValue23(arg, aRv, aRealm);
80441}
80442
80443void
80444TestJSImplInterface::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80445{
80446 return mImpl->PassUnionWithDefaultValue24(arg, aRv, aRealm);
80447}
80448
80449void
80450TestJSImplInterface::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80451{
80452 return mImpl->PassUnionWithDefaultValue25(arg, aRv, aRealm);
80453}
80454
80455void
80456TestJSImplInterface::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80457{
80458 return mImpl->PassNullableUnionWithDefaultValue1(arg, aRv, aRealm);
80459}
80460
80461void
80462TestJSImplInterface::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80463{
80464 return mImpl->PassNullableUnionWithDefaultValue2(arg, aRv, aRealm);
80465}
80466
80467void
80468TestJSImplInterface::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80469{
80470 return mImpl->PassNullableUnionWithDefaultValue3(arg, aRv, aRealm);
80471}
80472
80473void
80474TestJSImplInterface::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80475{
80476 return mImpl->PassNullableUnionWithDefaultValue4(arg, aRv, aRealm);
80477}
80478
80479void
80480TestJSImplInterface::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80481{
80482 return mImpl->PassNullableUnionWithDefaultValue5(arg, aRv, aRealm);
80483}
80484
80485void
80486TestJSImplInterface::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80487{
80488 return mImpl->PassNullableUnionWithDefaultValue6(arg, aRv, aRealm);
80489}
80490
80491void
80492TestJSImplInterface::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80493{
80494 return mImpl->PassNullableUnionWithDefaultValue7(arg, aRv, aRealm);
80495}
80496
80497void
80498TestJSImplInterface::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80499{
80500 return mImpl->PassNullableUnionWithDefaultValue8(arg, aRv, aRealm);
80501}
80502
80503void
80504TestJSImplInterface::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80505{
80506 return mImpl->PassNullableUnionWithDefaultValue9(arg, aRv, aRealm);
80507}
80508
80509void
80510TestJSImplInterface::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80511{
80512 return mImpl->PassNullableUnionWithDefaultValue10(arg, aRv, aRealm);
80513}
80514
80515void
80516TestJSImplInterface::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80517{
80518 return mImpl->PassNullableUnionWithDefaultValue11(arg, aRv, aRealm);
80519}
80520
80521void
80522TestJSImplInterface::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80523{
80524 return mImpl->PassNullableUnionWithDefaultValue12(arg, aRv, aRealm);
80525}
80526
80527void
80528TestJSImplInterface::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80529{
80530 return mImpl->PassNullableUnionWithDefaultValue13(arg, aRv, aRealm);
80531}
80532
80533void
80534TestJSImplInterface::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80535{
80536 return mImpl->PassNullableUnionWithDefaultValue14(arg, aRv, aRealm);
80537}
80538
80539void
80540TestJSImplInterface::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80541{
80542 return mImpl->PassNullableUnionWithDefaultValue15(arg, aRv, aRealm);
80543}
80544
80545void
80546TestJSImplInterface::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80547{
80548 return mImpl->PassNullableUnionWithDefaultValue16(arg, aRv, aRealm);
80549}
80550
80551void
80552TestJSImplInterface::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80553{
80554 return mImpl->PassNullableUnionWithDefaultValue17(arg, aRv, aRealm);
80555}
80556
80557void
80558TestJSImplInterface::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80559{
80560 return mImpl->PassNullableUnionWithDefaultValue18(arg, aRv, aRealm);
80561}
80562
80563void
80564TestJSImplInterface::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80565{
80566 return mImpl->PassNullableUnionWithDefaultValue19(arg, aRv, aRealm);
80567}
80568
80569void
80570TestJSImplInterface::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80571{
80572 return mImpl->PassNullableUnionWithDefaultValue20(arg, aRv, aRealm);
80573}
80574
80575void
80576TestJSImplInterface::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80577{
80578 return mImpl->PassNullableUnionWithDefaultValue21(arg, aRv, aRealm);
80579}
80580
80581void
80582TestJSImplInterface::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80583{
80584 return mImpl->PassNullableUnionWithDefaultValue22(arg, aRv, aRealm);
80585}
80586
80587void
80588TestJSImplInterface::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80589{
80590 return mImpl->PassNullableUnionWithDefaultValue23(arg, aRv, aRealm);
80591}
80592
80593void
80594TestJSImplInterface::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80595{
80596 return mImpl->PassNullableUnionWithDefaultValue24(arg, aRv, aRealm);
80597}
80598
80599void
80600TestJSImplInterface::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80601{
80602 return mImpl->PassNullableUnionWithDefaultValue25(arg, aRv, aRealm);
80603}
80604
80605void
80606TestJSImplInterface::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80607{
80608 return mImpl->PassNullableUnionWithDefaultValue26(arg, aRv, aRealm);
80609}
80610
80611void
80612TestJSImplInterface::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80613{
80614 return mImpl->PassNullableUnionWithDefaultValue27(arg, aRv, aRealm);
80615}
80616
80617void
80618TestJSImplInterface::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80619{
80620 return mImpl->PassNullableUnionWithDefaultValue28(arg, aRv, aRealm);
80621}
80622
80623void
80624TestJSImplInterface::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80625{
80626 return mImpl->PassSequenceOfUnions(arg, aRv, aRealm);
80627}
80628
80629void
80630TestJSImplInterface::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80631{
80632 return mImpl->PassSequenceOfUnions2(arg, aRv, aRealm);
80633}
80634
80635void
80636TestJSImplInterface::PassVariadicUnion(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80637{
80638 return mImpl->PassVariadicUnion(arg, aRv, aRealm);
80639}
80640
80641void
80642TestJSImplInterface::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80643{
80644 return mImpl->PassSequenceOfNullableUnions(arg, aRv, aRealm);
80645}
80646
80647void
80648TestJSImplInterface::PassVariadicNullableUnion(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80649{
80650 return mImpl->PassVariadicNullableUnion(arg, aRv, aRealm);
80651}
80652
80653void
80654TestJSImplInterface::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80655{
80656 return mImpl->PassRecordOfUnions(arg, aRv, aRealm);
80657}
80658
80659void
80660TestJSImplInterface::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80661{
80662 return mImpl->ReceiveUnion(aRetVal, aRv, aRealm);
80663}
80664
80665void
80666TestJSImplInterface::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80667{
80668 return mImpl->ReceiveUnion2(aRetVal, aRv, aRealm);
80669}
80670
80671void
80672TestJSImplInterface::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80673{
80674 return mImpl->ReceiveUnionContainingNull(aRetVal, aRv, aRealm);
80675}
80676
80677void
80678TestJSImplInterface::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80679{
80680 return mImpl->ReceiveNullableUnion(aRetVal, aRv, aRealm);
80681}
80682
80683void
80684TestJSImplInterface::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80685{
80686 return mImpl->ReceiveNullableUnion2(aRetVal, aRv, aRealm);
80687}
80688
80689void
80690TestJSImplInterface::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80691{
80692 return mImpl->GetWritableUnion(aRetVal, aRv, aRealm);
80693}
80694
80695void
80696TestJSImplInterface::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
80697{
80698 mImpl->SetWritableUnion(arg, aRv, aRealm);
80699}
80700
80701void
80702TestJSImplInterface::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80703{
80704 return mImpl->GetWritableUnionContainingNull(aRetVal, aRv, aRealm);
80705}
80706
80707void
80708TestJSImplInterface::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
80709{
80710 mImpl->SetWritableUnionContainingNull(arg, aRv, aRealm);
80711}
80712
80713void
80714TestJSImplInterface::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80715{
80716 return mImpl->GetWritableNullableUnion(aRetVal, aRv, aRealm);
80717}
80718
80719void
80720TestJSImplInterface::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80721{
80722 mImpl->SetWritableNullableUnion(arg, aRv, aRealm);
80723}
80724
80725void
80726TestJSImplInterface::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm)
80727{
80728 return mImpl->PassPromise(arg, aRv, aRealm);
80729}
80730
80731void
80732TestJSImplInterface::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80733{
80734 return mImpl->PassOptionalPromise(arg, aRv, aRealm);
80735}
80736
80737void
80738TestJSImplInterface::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80739{
80740 return mImpl->PassPromiseSequence(arg, aRv, aRealm);
80741}
80742
80743// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80744already_AddRefed<Promise>
80745TestJSImplInterface::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm)
80746{
80747 return mImpl->ReceivePromise(aRv, aRealm);
80748}
80749
80750// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80751already_AddRefed<Promise>
80752TestJSImplInterface::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm)
80753{
80754 return mImpl->ReceiveAddrefedPromise(aRv, aRealm);
80755}
80756
80757void
80758TestJSImplInterface::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
80759{
80760 return mImpl->MethodRenamedTo(aRv, aRealm);
80761}
80762
80763void
80764TestJSImplInterface::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm)
80765{
80766 return mImpl->MethodRenamedTo(argument, aRv, aRealm);
80767}
80768
80769int8_t
80770TestJSImplInterface::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const
80771{
80772 return mImpl->GetAttributeGetterRenamedTo(aRv, aRealm);
80773}
80774
80775int8_t
80776TestJSImplInterface::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const
80777{
80778 return mImpl->GetAttributeRenamedTo(aRv, aRealm);
80779}
80780
80781void
80782TestJSImplInterface::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80783{
80784 mImpl->SetAttributeRenamedTo(arg, aRv, aRealm);
80785}
80786
80787void
80788TestJSImplInterface::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80789{
80790 return mImpl->PassDictionary(x, aRv, aRealm);
80791}
80792
80793void
80794TestJSImplInterface::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80795{
80796 return mImpl->PassDictionary2(x, aRv, aRealm);
80797}
80798
80799void
80800TestJSImplInterface::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80801{
80802 return mImpl->ReceiveDictionary(aRetVal, aRv, aRealm);
80803}
80804
80805void
80806TestJSImplInterface::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80807{
80808 return mImpl->ReceiveNullableDictionary(aRetVal, aRv, aRealm);
80809}
80810
80811void
80812TestJSImplInterface::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm)
80813{
80814 return mImpl->PassOtherDictionary(x, aRv, aRealm);
80815}
80816
80817void
80818TestJSImplInterface::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm)
80819{
80820 return mImpl->PassSequenceOfDictionaries(x, aRv, aRealm);
80821}
80822
80823void
80824TestJSImplInterface::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm)
80825{
80826 return mImpl->PassRecordOfDictionaries(x, aRv, aRealm);
80827}
80828
80829void
80830TestJSImplInterface::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80831{
80832 return mImpl->PassDictionaryOrLong(x, aRv, aRealm);
80833}
80834
80835void
80836TestJSImplInterface::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm)
80837{
80838 return mImpl->PassDictionaryOrLong(x, aRv, aRealm);
80839}
80840
80841void
80842TestJSImplInterface::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm)
80843{
80844 return mImpl->PassDictContainingDict(arg, aRv, aRealm);
80845}
80846
80847void
80848TestJSImplInterface::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
80849{
80850 return mImpl->PassDictContainingSequence(arg, aRv, aRealm);
80851}
80852
80853void
80854TestJSImplInterface::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80855{
80856 return mImpl->ReceiveDictContainingSequence(aRetVal, aRv, aRealm);
80857}
80858
80859void
80860TestJSImplInterface::PassVariadicDictionary(const Sequence<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80861{
80862 return mImpl->PassVariadicDictionary(arg, aRv, aRealm);
80863}
80864
80865void
80866TestJSImplInterface::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80867{
80868 return mImpl->DontEnforceRangeOrClamp(arg, aRv, aRealm);
80869}
80870
80871void
80872TestJSImplInterface::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80873{
80874 return mImpl->DoEnforceRange(arg, aRv, aRealm);
80875}
80876
80877void
80878TestJSImplInterface::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80879{
80880 return mImpl->DoEnforceRangeNullable(arg, aRv, aRealm);
80881}
80882
80883void
80884TestJSImplInterface::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80885{
80886 return mImpl->DoClamp(arg, aRv, aRealm);
80887}
80888
80889void
80890TestJSImplInterface::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80891{
80892 return mImpl->DoClampNullable(arg, aRv, aRealm);
80893}
80894
80895int8_t
80896TestJSImplInterface::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm) const
80897{
80898 return mImpl->GetEnforcedByte(aRv, aRealm);
80899}
80900
80901void
80902TestJSImplInterface::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80903{
80904 mImpl->SetEnforcedByte(arg, aRv, aRealm);
80905}
80906
80907Nullable<int8_t>
80908TestJSImplInterface::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const
80909{
80910 return mImpl->GetEnforcedByteNullable(aRv, aRealm);
5
Calling 'TestJSImplInterfaceJSImpl::GetEnforcedByteNullable'
80911}
80912
80913void
80914TestJSImplInterface::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80915{
80916 mImpl->SetEnforcedByteNullable(arg, aRv, aRealm);
80917}
80918
80919int8_t
80920TestJSImplInterface::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm) const
80921{
80922 return mImpl->GetClampedByte(aRv, aRealm);
80923}
80924
80925void
80926TestJSImplInterface::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80927{
80928 mImpl->SetClampedByte(arg, aRv, aRealm);
80929}
80930
80931Nullable<int8_t>
80932TestJSImplInterface::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const
80933{
80934 return mImpl->GetClampedByteNullable(aRv, aRealm);
80935}
80936
80937void
80938TestJSImplInterface::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80939{
80940 mImpl->SetClampedByteNullable(arg, aRv, aRealm);
80941}
80942
80943void
80944TestJSImplInterface::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80945{
80946 return mImpl->ExerciseTypedefInterfaces1(arg, aRv, aRealm);
80947}
80948
80949// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80950already_AddRefed<TestJSImplInterface>
80951TestJSImplInterface::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
80952{
80953 return mImpl->ExerciseTypedefInterfaces2(arg, aRv, aRealm);
80954}
80955
80956void
80957TestJSImplInterface::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80958{
80959 return mImpl->ExerciseTypedefInterfaces3(arg, aRv, aRealm);
80960}
80961
80962int8_t
80963TestJSImplInterface::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
80964{
80965 return mImpl->GetDeprecatedAttribute(aRv, aRealm);
80966}
80967
80968void
80969TestJSImplInterface::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80970{
80971 mImpl->SetDeprecatedAttribute(arg, aRv, aRealm);
80972}
80973
80974int8_t
80975TestJSImplInterface::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm)
80976{
80977 return mImpl->DeprecatedMethod(aRv, aRealm);
80978}
80979
80980void
80981TestJSImplInterface::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
80982{
80983 return mImpl->DeprecatedMethodWithContext(arg, aRv, aRealm);
80984}
80985
80986bool
80987TestJSImplInterface::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80988{
80989 return mImpl->Overload1(arg, aRv, aRealm);
80990}
80991
80992// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80993already_AddRefed<TestJSImplInterface>
80994TestJSImplInterface::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80995{
80996 return mImpl->Overload1(strs, arg, aRv, aRealm);
80997}
80998
80999void
81000TestJSImplInterface::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81001{
81002 return mImpl->Overload2(arg, aRv, aRealm);
81003}
81004
81005void
81006TestJSImplInterface::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
81007{
81008 return mImpl->Overload2(arg, aRv, aRealm);
81009}
81010
81011void
81012TestJSImplInterface::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81013{
81014 return mImpl->Overload2(arg, aRv, aRealm);
81015}
81016
81017void
81018TestJSImplInterface::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
81019{
81020 return mImpl->Overload2(arg, aRv, aRealm);
81021}
81022
81023void
81024TestJSImplInterface::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81025{
81026 return mImpl->Overload3(arg, aRv, aRealm);
81027}
81028
81029void
81030TestJSImplInterface::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
81031{
81032 return mImpl->Overload3(arg, aRv, aRealm);
81033}
81034
81035void
81036TestJSImplInterface::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81037{
81038 return mImpl->Overload3(arg, aRv, aRealm);
81039}
81040
81041void
81042TestJSImplInterface::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81043{
81044 return mImpl->Overload4(arg, aRv, aRealm);
81045}
81046
81047void
81048TestJSImplInterface::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81049{
81050 return mImpl->Overload4(arg, aRv, aRealm);
81051}
81052
81053void
81054TestJSImplInterface::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
81055{
81056 return mImpl->Overload4(arg, aRv, aRealm);
81057}
81058
81059void
81060TestJSImplInterface::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81061{
81062 return mImpl->Overload5(arg, aRv, aRealm);
81063}
81064
81065void
81066TestJSImplInterface::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
81067{
81068 return mImpl->Overload5(arg, aRv, aRealm);
81069}
81070
81071void
81072TestJSImplInterface::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81073{
81074 return mImpl->Overload6(arg, aRv, aRealm);
81075}
81076
81077void
81078TestJSImplInterface::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81079{
81080 return mImpl->Overload6(arg, aRv, aRealm);
81081}
81082
81083void
81084TestJSImplInterface::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81085{
81086 return mImpl->Overload7(arg, aRv, aRealm);
81087}
81088
81089void
81090TestJSImplInterface::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81091{
81092 return mImpl->Overload7(arg, aRv, aRealm);
81093}
81094
81095void
81096TestJSImplInterface::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
81097{
81098 return mImpl->Overload7(arg, aRv, aRealm);
81099}
81100
81101void
81102TestJSImplInterface::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81103{
81104 return mImpl->Overload8(arg, aRv, aRealm);
81105}
81106
81107void
81108TestJSImplInterface::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81109{
81110 return mImpl->Overload8(arg, aRv, aRealm);
81111}
81112
81113void
81114TestJSImplInterface::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81115{
81116 return mImpl->Overload9(arg, aRv, aRealm);
81117}
81118
81119void
81120TestJSImplInterface::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
81121{
81122 return mImpl->Overload9(arg, aRv, aRealm);
81123}
81124
81125void
81126TestJSImplInterface::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81127{
81128 return mImpl->Overload10(arg, aRv, aRealm);
81129}
81130
81131void
81132TestJSImplInterface::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
81133{
81134 return mImpl->Overload10(arg, aRv, aRealm);
81135}
81136
81137void
81138TestJSImplInterface::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81139{
81140 return mImpl->Overload11(arg, aRv, aRealm);
81141}
81142
81143void
81144TestJSImplInterface::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
81145{
81146 return mImpl->Overload11(arg, aRv, aRealm);
81147}
81148
81149void
81150TestJSImplInterface::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81151{
81152 return mImpl->Overload12(arg, aRv, aRealm);
81153}
81154
81155void
81156TestJSImplInterface::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81157{
81158 return mImpl->Overload12(arg, aRv, aRealm);
81159}
81160
81161void
81162TestJSImplInterface::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81163{
81164 return mImpl->Overload13(arg, aRv, aRealm);
81165}
81166
81167void
81168TestJSImplInterface::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81169{
81170 return mImpl->Overload13(arg, aRv, aRealm);
81171}
81172
81173void
81174TestJSImplInterface::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81175{
81176 return mImpl->Overload14(arg, aRv, aRealm);
81177}
81178
81179void
81180TestJSImplInterface::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81181{
81182 return mImpl->Overload14(arg, aRv, aRealm);
81183}
81184
81185void
81186TestJSImplInterface::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81187{
81188 return mImpl->Overload15(arg, aRv, aRealm);
81189}
81190
81191void
81192TestJSImplInterface::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81193{
81194 return mImpl->Overload15(arg, aRv, aRealm);
81195}
81196
81197void
81198TestJSImplInterface::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81199{
81200 return mImpl->Overload16(arg, aRv, aRealm);
81201}
81202
81203void
81204TestJSImplInterface::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81205{
81206 return mImpl->Overload16(arg, aRv, aRealm);
81207}
81208
81209void
81210TestJSImplInterface::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81211{
81212 return mImpl->Overload17(arg, aRv, aRealm);
81213}
81214
81215void
81216TestJSImplInterface::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81217{
81218 return mImpl->Overload17(arg, aRv, aRealm);
81219}
81220
81221void
81222TestJSImplInterface::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81223{
81224 return mImpl->Overload18(arg, aRv, aRealm);
81225}
81226
81227void
81228TestJSImplInterface::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81229{
81230 return mImpl->Overload18(arg, aRv, aRealm);
81231}
81232
81233void
81234TestJSImplInterface::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81235{
81236 return mImpl->Overload19(arg, aRv, aRealm);
81237}
81238
81239void
81240TestJSImplInterface::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
81241{
81242 return mImpl->Overload19(arg, aRv, aRealm);
81243}
81244
81245void
81246TestJSImplInterface::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
81247{
81248 return mImpl->Overload20(arg, aRv, aRealm);
81249}
81250
81251void
81252TestJSImplInterface::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81253{
81254 return mImpl->Overload20(arg, aRv, aRealm);
81255}
81256
81257void
81258TestJSImplInterface::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const Sequence<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm)
81259{
81260 return mImpl->PassVariadicThirdArg(arg1, arg2, arg3, aRv, aRealm);
81261}
81262
81263bool
81264TestJSImplInterface::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm) const
81265{
81266 return mImpl->GetPrefable1(aRv, aRealm);
81267}
81268
81269bool
81270TestJSImplInterface::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm) const
81271{
81272 return mImpl->GetPrefable2(aRv, aRealm);
81273}
81274
81275bool
81276TestJSImplInterface::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm) const
81277{
81278 return mImpl->GetPrefable3(aRv, aRealm);
81279}
81280
81281bool
81282TestJSImplInterface::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm) const
81283{
81284 return mImpl->GetPrefable4(aRv, aRealm);
81285}
81286
81287bool
81288TestJSImplInterface::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm) const
81289{
81290 return mImpl->GetPrefable5(aRv, aRealm);
81291}
81292
81293bool
81294TestJSImplInterface::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm) const
81295{
81296 return mImpl->GetPrefable6(aRv, aRealm);
81297}
81298
81299bool
81300TestJSImplInterface::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm) const
81301{
81302 return mImpl->GetPrefable7(aRv, aRealm);
81303}
81304
81305bool
81306TestJSImplInterface::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm) const
81307{
81308 return mImpl->GetPrefable8(aRv, aRealm);
81309}
81310
81311bool
81312TestJSImplInterface::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm) const
81313{
81314 return mImpl->GetPrefable9(aRv, aRealm);
81315}
81316
81317void
81318TestJSImplInterface::Prefable10(ErrorResult& aRv, JS::Realm* aRealm)
81319{
81320 return mImpl->Prefable10(aRv, aRealm);
81321}
81322
81323void
81324TestJSImplInterface::Prefable11(ErrorResult& aRv, JS::Realm* aRealm)
81325{
81326 return mImpl->Prefable11(aRv, aRealm);
81327}
81328
81329bool
81330TestJSImplInterface::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm) const
81331{
81332 return mImpl->GetPrefable12(aRv, aRealm);
81333}
81334
81335void
81336TestJSImplInterface::Prefable13(ErrorResult& aRv, JS::Realm* aRealm)
81337{
81338 return mImpl->Prefable13(aRv, aRealm);
81339}
81340
81341bool
81342TestJSImplInterface::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm) const
81343{
81344 return mImpl->GetPrefable14(aRv, aRealm);
81345}
81346
81347bool
81348TestJSImplInterface::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm) const
81349{
81350 return mImpl->GetPrefable15(aRv, aRealm);
81351}
81352
81353bool
81354TestJSImplInterface::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm) const
81355{
81356 return mImpl->GetPrefable16(aRv, aRealm);
81357}
81358
81359void
81360TestJSImplInterface::Prefable17(ErrorResult& aRv, JS::Realm* aRealm)
81361{
81362 return mImpl->Prefable17(aRv, aRealm);
81363}
81364
81365void
81366TestJSImplInterface::Prefable18(ErrorResult& aRv, JS::Realm* aRealm)
81367{
81368 return mImpl->Prefable18(aRv, aRealm);
81369}
81370
81371void
81372TestJSImplInterface::Prefable19(ErrorResult& aRv, JS::Realm* aRealm)
81373{
81374 return mImpl->Prefable19(aRv, aRealm);
81375}
81376
81377void
81378TestJSImplInterface::Prefable20(ErrorResult& aRv, JS::Realm* aRealm)
81379{
81380 return mImpl->Prefable20(aRv, aRealm);
81381}
81382
81383bool
81384TestJSImplInterface::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm) const
81385{
81386 return mImpl->GetConditionalOnSecureContext1(aRv, aRealm);
81387}
81388
81389bool
81390TestJSImplInterface::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm) const
81391{
81392 return mImpl->GetConditionalOnSecureContext2(aRv, aRealm);
81393}
81394
81395bool
81396TestJSImplInterface::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm) const
81397{
81398 return mImpl->GetConditionalOnSecureContext3(aRv, aRealm);
81399}
81400
81401bool
81402TestJSImplInterface::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm) const
81403{
81404 return mImpl->GetConditionalOnSecureContext4(aRv, aRealm);
81405}
81406
81407void
81408TestJSImplInterface::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm)
81409{
81410 return mImpl->ConditionalOnSecureContext5(aRv, aRealm);
81411}
81412
81413void
81414TestJSImplInterface::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm)
81415{
81416 return mImpl->ConditionalOnSecureContext6(aRv, aRealm);
81417}
81418
81419void
81420TestJSImplInterface::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm)
81421{
81422 return mImpl->ConditionalOnSecureContext7(aRv, aRealm);
81423}
81424
81425void
81426TestJSImplInterface::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm)
81427{
81428 return mImpl->ConditionalOnSecureContext8(aRv, aRealm);
81429}
81430
81431int32_t
81432TestJSImplInterface::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm) const
81433{
81434 return mImpl->GetAttrWithLenientThis(aRv, aRealm);
81435}
81436
81437void
81438TestJSImplInterface::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81439{
81440 mImpl->SetAttrWithLenientThis(arg, aRv, aRealm);
81441}
81442
81443void
81444TestJSImplInterface::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81445{
81446 return mImpl->PassRenamedInterface(arg, aRv, aRealm);
81447}
81448
81449// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81450already_AddRefed<TestJSImplInterface>
81451TestJSImplInterface::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81452{
81453 return mImpl->GetPutForwardsAttr(aRv, aRealm);
81454}
81455
81456// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81457already_AddRefed<TestJSImplInterface>
81458TestJSImplInterface::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm) const
81459{
81460 return mImpl->GetPutForwardsAttr2(aRv, aRealm);
81461}
81462
81463// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81464already_AddRefed<TestJSImplInterface>
81465TestJSImplInterface::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm) const
81466{
81467 return mImpl->GetPutForwardsAttr3(aRv, aRealm);
81468}
81469
81470void
81471TestJSImplInterface::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm)
81472{
81473 return mImpl->ThrowingMethod(aRv, aRealm);
81474}
81475
81476bool
81477TestJSImplInterface::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81478{
81479 return mImpl->GetThrowingAttr(aRv, aRealm);
81480}
81481
81482void
81483TestJSImplInterface::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81484{
81485 mImpl->SetThrowingAttr(arg, aRv, aRealm);
81486}
81487
81488bool
81489TestJSImplInterface::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81490{
81491 return mImpl->GetThrowingGetterAttr(aRv, aRealm);
81492}
81493
81494void
81495TestJSImplInterface::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81496{
81497 mImpl->SetThrowingGetterAttr(arg, aRv, aRealm);
81498}
81499
81500bool
81501TestJSImplInterface::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81502{
81503 return mImpl->GetThrowingSetterAttr(aRv, aRealm);
81504}
81505
81506void
81507TestJSImplInterface::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81508{
81509 mImpl->SetThrowingSetterAttr(arg, aRv, aRealm);
81510}
81511
81512void
81513TestJSImplInterface::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm)
81514{
81515 return mImpl->CanOOMMethod(aRv, aRealm);
81516}
81517
81518bool
81519TestJSImplInterface::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81520{
81521 return mImpl->GetCanOOMAttr(aRv, aRealm);
81522}
81523
81524void
81525TestJSImplInterface::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81526{
81527 mImpl->SetCanOOMAttr(arg, aRv, aRealm);
81528}
81529
81530bool
81531TestJSImplInterface::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81532{
81533 return mImpl->GetCanOOMGetterAttr(aRv, aRealm);
81534}
81535
81536void
81537TestJSImplInterface::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81538{
81539 mImpl->SetCanOOMGetterAttr(arg, aRv, aRealm);
81540}
81541
81542bool
81543TestJSImplInterface::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81544{
81545 return mImpl->GetCanOOMSetterAttr(aRv, aRealm);
81546}
81547
81548void
81549TestJSImplInterface::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81550{
81551 mImpl->SetCanOOMSetterAttr(arg, aRv, aRealm);
81552}
81553
81554void
81555TestJSImplInterface::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm)
81556{
81557 return mImpl->CeReactionsMethod(aRv, aRealm);
81558}
81559
81560void
81561TestJSImplInterface::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm)
81562{
81563 return mImpl->CeReactionsMethodOverload(aRv, aRealm);
81564}
81565
81566void
81567TestJSImplInterface::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm)
81568{
81569 return mImpl->CeReactionsMethodOverload(bar, aRv, aRealm);
81570}
81571
81572bool
81573TestJSImplInterface::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81574{
81575 return mImpl->GetCeReactionsAttr(aRv, aRealm);
81576}
81577
81578void
81579TestJSImplInterface::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81580{
81581 mImpl->SetCeReactionsAttr(arg, aRv, aRealm);
81582}
81583
81584void
81585TestJSImplInterface::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm)
81586{
81587 return mImpl->PassArgsWithDefaults(arg1, arg2, arg3, arg4, arg5, aRv, aRealm);
81588}
81589
81590void
81591TestJSImplInterface::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81592{
81593 return mImpl->GetToJSONShouldSkipThis(aRetVal, aRv, aRealm);
81594}
81595
81596void
81597TestJSImplInterface::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
81598{
81599 mImpl->SetToJSONShouldSkipThis(arg, aRv, aRealm);
81600}
81601
81602// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81603already_AddRefed<TestParentInterface>
81604TestJSImplInterface::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm) const
81605{
81606 return mImpl->GetToJSONShouldSkipThis2(aRv, aRealm);
81607}
81608
81609void
81610TestJSImplInterface::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81611{
81612 mImpl->SetToJSONShouldSkipThis2(arg, aRv, aRealm);
81613}
81614
81615// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81616already_AddRefed<TestCallbackInterface>
81617TestJSImplInterface::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm) const
81618{
81619 return mImpl->GetToJSONShouldSkipThis3(aRv, aRealm);
81620}
81621
81622void
81623TestJSImplInterface::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81624{
81625 mImpl->SetToJSONShouldSkipThis3(arg, aRv, aRealm);
81626}
81627
81628void
81629TestJSImplInterface::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
81630{
81631 return mImpl->ToJSON(aRetVal, aRv, aRealm);
81632}
81633
81634int8_t
81635TestJSImplInterface::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm) const
81636{
81637 return mImpl->GetDashed_attribute(aRv, aRealm);
81638}
81639
81640void
81641TestJSImplInterface::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81642{
81643 mImpl->SetDashed_attribute(arg, aRv, aRealm);
81644}
81645
81646void
81647TestJSImplInterface::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm)
81648{
81649 return mImpl->Dashed_method(aRv, aRealm);
81650}
81651
81652bool
81653TestJSImplInterface::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81654{
81655 return mImpl->GetNonEnumerableAttr(aRv, aRealm);
81656}
81657
81658void
81659TestJSImplInterface::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81660{
81661 mImpl->SetNonEnumerableAttr(arg, aRv, aRealm);
81662}
81663
81664void
81665TestJSImplInterface::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm)
81666{
81667 return mImpl->NonEnumerableMethod(aRv, aRealm);
81668}
81669
81670void
81671TestJSImplInterface::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81672{
81673 return mImpl->GetAllowSharedArrayBufferViewTypedef(aRetVal, aRv, aRealm);
81674}
81675
81676void
81677TestJSImplInterface::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
81678{
81679 mImpl->SetAllowSharedArrayBufferViewTypedef(arg, aRv, aRealm);
81680}
81681
81682void
81683TestJSImplInterface::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81684{
81685 return mImpl->GetAllowSharedArrayBufferView(aRetVal, aRv, aRealm);
81686}
81687
81688void
81689TestJSImplInterface::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
81690{
81691 mImpl->SetAllowSharedArrayBufferView(arg, aRv, aRealm);
81692}
81693
81694void
81695TestJSImplInterface::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81696{
81697 return mImpl->GetAllowSharedNullableArrayBufferView(aRetVal, aRv, aRealm);
81698}
81699
81700void
81701TestJSImplInterface::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81702{
81703 mImpl->SetAllowSharedNullableArrayBufferView(arg, aRv, aRealm);
81704}
81705
81706void
81707TestJSImplInterface::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81708{
81709 return mImpl->GetAllowSharedArrayBuffer(aRetVal, aRv, aRealm);
81710}
81711
81712void
81713TestJSImplInterface::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
81714{
81715 mImpl->SetAllowSharedArrayBuffer(arg, aRv, aRealm);
81716}
81717
81718void
81719TestJSImplInterface::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81720{
81721 return mImpl->GetAllowSharedNullableArrayBuffer(aRetVal, aRv, aRealm);
81722}
81723
81724void
81725TestJSImplInterface::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81726{
81727 mImpl->SetAllowSharedNullableArrayBuffer(arg, aRv, aRealm);
81728}
81729
81730void
81731TestJSImplInterface::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
81732{
81733 return mImpl->PassAllowSharedArrayBufferViewTypedef(foo, aRv, aRealm);
81734}
81735
81736void
81737TestJSImplInterface::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
81738{
81739 return mImpl->PassAllowSharedArrayBufferView(foo, aRv, aRealm);
81740}
81741
81742void
81743TestJSImplInterface::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm)
81744{
81745 return mImpl->PassAllowSharedNullableArrayBufferView(foo, aRv, aRealm);
81746}
81747
81748void
81749TestJSImplInterface::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81750{
81751 return mImpl->PassAllowSharedArrayBuffer(foo, aRv, aRealm);
81752}
81753
81754void
81755TestJSImplInterface::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm)
81756{
81757 return mImpl->PassAllowSharedNullableArrayBuffer(foo, aRv, aRealm);
81758}
81759
81760void
81761TestJSImplInterface::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81762{
81763 return mImpl->PassUnionArrayBuffer(foo, aRv, aRealm);
81764}
81765
81766void
81767TestJSImplInterface::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81768{
81769 return mImpl->PassUnionAllowSharedArrayBuffer(foo, aRv, aRealm);
81770}
81771
81772void
81773TestJSImplInterface::PassAllowSharedInt8ArrayOrInt16Array(const MaybeSharedInt8ArrayOrMaybeSharedInt16Array& foo, ErrorResult& aRv, JS::Realm* aRealm)
81774{
81775 return mImpl->PassAllowSharedInt8ArrayOrInt16Array(foo, aRv, aRealm);
81776}
81777
81778bool
81779TestJSImplInterface::_Create(JSContext* cx, unsigned argc, JS::Value* vp)
81780{
81781 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
81782 if (!args.requireAtLeast(cx, "TestJSImplInterface._create", 2)) {
81783 return false;
81784 }
81785 BindingCallContext callCx(cx, "TestJSImplInterface._create");
81786 if (!args[0].isObject()) {
81787 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
81788 }
81789 if (!args[1].isObject()) {
81790 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
81791 }
81792
81793 // GlobalObject will go through wrappers as needed for us, and
81794 // is simpler than the right UnwrapArg incantation.
81795 GlobalObject global(cx, &args[0].toObject());
81796 if (global.Failed()) {
81797 return false;
81798 }
81799 nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports());
81800 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"
, 81800); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder"
")"); do { MOZ_CrashSequence(__null, 81800); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81801 JS::Rooted<JSObject*> arg(cx, &args[1].toObject());
81802 JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx));
81803 RefPtr<TestJSImplInterface> impl = new TestJSImplInterface(arg, argGlobal, globalHolder);
81804 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", 81804); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)"
")"); do { MOZ_CrashSequence(__null, 81804); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81805 return GetOrCreateDOMReflector(cx, impl, args.rval());
81806}
81807
81808
81809NS_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); }
81810NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplNoInterfaceObject)void TestJSImplNoInterfaceObject::cycleCollection::Unlink(void
* p) { TestJSImplNoInterfaceObject* tmp = DowncastCCParticipant
<TestJSImplNoInterfaceObject>(p);
81811 NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl);
81812 NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent);
81813 NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p);
81814 tmp->ClearWeakReferences();
81815NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; }
81816NS_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"
);
81817 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0);
81818 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0
);
81819NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; }
81820NS_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", 81820
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0"
") (" "illegal refcnt" ")"); do { MOZ_CrashSequence(__null, 81820
); __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; }
81821NS_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", 81821
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0"
") (" "dup release" ")"); do { MOZ_CrashSequence(__null, 81821
); __attribute__((nomerge)) ::abort(); } while (false); } } while
(false); _mOwningThread.AssertOwnership("TestJSImplNoInterfaceObject"
" not thread-safe"); nsISupports* base = TestJSImplNoInterfaceObject
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr
(base); if (count == 0) { NS_CycleCollectableHasRefCntZero();
} NS_LogRelease((this), (count), ("TestJSImplNoInterfaceObject"
)); return count; } void TestJSImplNoInterfaceObject::DeleteCycleCollectable
(void) { delete (this); }
81822NS_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", 81822); MOZ_PretendNoReturn
(); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals
( aIID, (nsXPCOMCycleCollectionParticipant::kIID), (nsCycleCollectionISupports
::kIID)) && (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports::
kIID)))) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject::cycleCollection
::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, (
nsCycleCollectionISupports::kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject
::cycleCollection::Upcast(this); return NS_OK; } foundInterface
= nullptr; } else
81823 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::kIID))) { *aInstancePtr = static_cast
<nsWrapperCache*>(this); return NS_OK; } else
81824 NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupports>)) foundInterface = static_cast
<nsISupports*>(this); else
81825 NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupportsWeakReference>)) foundInterface
= static_cast<nsISupportsWeakReference*>(this); else
81826NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(!aIID.Equals((nsISupports::kIID)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::kIID
))))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!aIID.Equals((nsISupports::kIID))", "../TestJSImplGenBinding.cpp"
, 81826); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::kIID))"
")"); do { MOZ_CrashSequence(__null, 81826); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); status
= NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status
= NS_OK; } *aInstancePtr = foundInterface; return status; }
81827
81828TestJSImplNoInterfaceObject::TestJSImplNoInterfaceObject(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent)
81829 : mImpl(new TestJSImplNoInterfaceObjectJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)),
81830 mParent(aParent)
81831{
81832}
81833
81834
81835TestJSImplNoInterfaceObject::~TestJSImplNoInterfaceObject()
81836{
81837}
81838
81839nsISupports*
81840TestJSImplNoInterfaceObject::GetParentObject() const
81841{
81842 return mParent;
81843}
81844
81845JSObject*
81846TestJSImplNoInterfaceObject::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
81847{
81848 JS::Rooted<JSObject*> obj(aCx, TestJSImplNoInterfaceObject_Binding::Wrap(aCx, this, aGivenProto));
81849 if (!obj) {
81850 return nullptr;
81851 }
81852
81853 // Now define it on our chrome object
81854 JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull());
81855 if (!JS_WrapObject(aCx, &obj)) {
81856 return nullptr;
81857 }
81858 JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull());
81859 if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) {
81860 return nullptr;
81861 }
81862 return obj;
81863}
81864
81865bool
81866TestJSImplNoInterfaceObject::_Create(JSContext* cx, unsigned argc, JS::Value* vp)
81867{
81868 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
81869 if (!args.requireAtLeast(cx, "TestJSImplNoInterfaceObject._create", 2)) {
81870 return false;
81871 }
81872 BindingCallContext callCx(cx, "TestJSImplNoInterfaceObject._create");
81873 if (!args[0].isObject()) {
81874 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
81875 }
81876 if (!args[1].isObject()) {
81877 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
81878 }
81879
81880 // GlobalObject will go through wrappers as needed for us, and
81881 // is simpler than the right UnwrapArg incantation.
81882 GlobalObject global(cx, &args[0].toObject());
81883 if (global.Failed()) {
81884 return false;
81885 }
81886 nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports());
81887 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"
, 81887); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder"
")"); do { MOZ_CrashSequence(__null, 81887); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81888 JS::Rooted<JSObject*> arg(cx, &args[1].toObject());
81889 JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx));
81890 RefPtr<TestJSImplNoInterfaceObject> impl = new TestJSImplNoInterfaceObject(arg, argGlobal, globalHolder);
81891 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", 81891); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)"
")"); do { MOZ_CrashSequence(__null, 81891); __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81892 return GetOrCreateDOMReflector(cx, impl, args.rval());
81893}
81894
81895
81896} // namespace dom
81897
81898
81899} // namespace mozilla

/root/firefox-clang/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!"
, "/root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h"
, 75); AnnotateMozCrashReason("MOZ_CRASH(" "This should never be instantiated!"
")"); do { MOZ_CrashSequence(__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)"
, "/root/firefox-clang/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h"
, 245); AnnotateMozCrashReason("MOZ_ASSERT" "(" "std::isfinite(d)"
")"); do { MOZ_CrashSequence(__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 uninitialized
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 */